Eliminate magic numbers from expression precedence

This commit is contained in:
David Tolnay 2024-11-28 12:47:18 -08:00
parent 539c863eaf
commit 7ced18f329
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
18 changed files with 162 additions and 138 deletions

View file

@ -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::{
@ -2686,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)]