diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2024-12-04 05:10:54 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2024-12-04 05:10:54 +0000 |
| commit | 1300e4628d33bcf15999d4a134b807424e24fa62 (patch) | |
| tree | 547a075be58e2f3ebc10a6b50200676f2040c06b /compiler/rustc_parse/src/errors.rs | |
| parent | db8bef50736160db2c06064fcdacda3c2e6dfeb0 (diff) | |
| parent | f4217f42967621c53dbeb1ecdd698c1d17e97b7a (diff) | |
| download | rust-1300e4628d33bcf15999d4a134b807424e24fa62.tar.gz rust-1300e4628d33bcf15999d4a134b807424e24fa62.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
| -rw-r--r-- | compiler/rustc_parse/src/errors.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 9bdb99dc000..2579e4c1f25 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -3,6 +3,7 @@ use std::borrow::Cow; use rustc_ast::token::Token; +use rustc_ast::util::parser::ExprPrecedence; use rustc_ast::{Path, Visibility}; use rustc_errors::codes::*; use rustc_errors::{ @@ -2152,6 +2153,15 @@ pub(crate) enum UnknownPrefixSugg { } #[derive(Diagnostic)] +#[diag(parse_reserved_multihash)] +#[note] +pub(crate) struct ReservedMultihash { + #[primary_span] + pub span: Span, + #[subdiagnostic] + pub sugg: Option<GuardedStringSugg>, +} +#[derive(Diagnostic)] #[diag(parse_reserved_string)] #[note] pub(crate) struct ReservedString { @@ -2611,8 +2621,9 @@ pub(crate) enum InvalidMutInPattern { #[diag(parse_repeated_mut_in_pattern)] pub(crate) struct RepeatedMutInPattern { #[primary_span] - #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")] pub span: Span, + #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")] + pub suggestion: Span, } #[derive(Diagnostic)] @@ -2676,7 +2687,7 @@ pub(crate) struct UnexpectedExpressionInPattern { /// Was a `RangePatternBound` expected? pub is_bound: bool, /// The unexpected expr's precedence (used in match arm guard suggestions). - pub expr_precedence: i8, + pub expr_precedence: ExprPrecedence, } #[derive(Subdiagnostic)] |
