diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-21 00:57:58 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-08-21 01:31:11 -0400 |
| commit | 25ff9b6bcbba9e7831eb4d6eba2df6bbcd267c55 (patch) | |
| tree | 7c081b337e865ac7a20217d90e29a14ce63dcef0 /compiler/rustc_parse/src/parser/diagnostics.rs | |
| parent | 4d5b3b196284aded6ae99d12bcf149ffdc8ef379 (diff) | |
| download | rust-25ff9b6bcbba9e7831eb4d6eba2df6bbcd267c55.tar.gz rust-25ff9b6bcbba9e7831eb4d6eba2df6bbcd267c55.zip | |
Use bool in favor of Option<()> for diagnostics
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index ef1387c50fa..fcdc10c0837 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -1403,7 +1403,7 @@ impl<'a> Parser<'a> { let mut err = ComparisonOperatorsCannotBeChained { span: vec![op.span, self.prev_token.span], suggest_turbofish: None, - help_turbofish: None, + help_turbofish: false, chaining_sugg: None, }; @@ -1436,7 +1436,7 @@ impl<'a> Parser<'a> { { err.suggest_turbofish = Some(op.span.shrink_to_lo()); } else { - err.help_turbofish = Some(()); + err.help_turbofish = true; } let snapshot = self.create_snapshot_for_diagnostic(); @@ -1468,7 +1468,7 @@ impl<'a> Parser<'a> { { err.suggest_turbofish = Some(op.span.shrink_to_lo()); } else { - err.help_turbofish = Some(()); + err.help_turbofish = true; } // Consume the fn call arguments. match self.consume_fn_args() { @@ -1487,7 +1487,7 @@ impl<'a> Parser<'a> { { // All we know is that this is `foo < bar >` and *nothing* else. Try to // be helpful, but don't attempt to recover. - err.help_turbofish = Some(()); + err.help_turbofish = true; } // If it looks like a genuine attempt to chain operators (as opposed to a @@ -1895,7 +1895,7 @@ impl<'a> Parser<'a> { { self.dcx().emit_err(ColonAsSemi { span: self.token.span, - type_ascription: self.psess.unstable_features.is_nightly_build().then_some(()), + type_ascription: self.psess.unstable_features.is_nightly_build(), }); self.bump(); return true; |
