about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-03 22:26:29 +0000
committerbors <bors@rust-lang.org>2025-04-03 22:26:29 +0000
commit4fd8c04da0674af2c51310c9982370bfadfa1b98 (patch)
tree7aee17dc3b8ceab21f70145eb63978256e6ae775 /compiler/rustc_pattern_analysis/src
parent00095b3da4f23d9b3e7a809ac6a4e2b2530df84c (diff)
parent4cf6c21f3afebd54653c92d3bb7efc4e662042c7 (diff)
downloadrust-4fd8c04da0674af2c51310c9982370bfadfa1b98.tar.gz
rust-4fd8c04da0674af2c51310c9982370bfadfa1b98.zip
Auto merge of #139336 - matthiaskrgr:rollup-zsi8pgf, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #138017 (Tighten up assignment operator representations.)
 - #138462 (Dedup `&mut *` reborrow suggestion in loops)
 - #138610 (impl !PartialOrd for HirId)
 - #138767 (Allow boolean literals in `check-cfg`)
 - #139068 (io: Avoid marking some bytes as uninit)
 - #139255 (Remove unused variables generated in merged doctests)
 - #139270 (Add a mailmap entry for myself)
 - #139303 (Put Noratrieb on vacation)
 - #139312 (add Marco Ieni to mailmap)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
-rw-r--r--compiler/rustc_pattern_analysis/src/lints.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lints.rs b/compiler/rustc_pattern_analysis/src/lints.rs
index 585cda1d24b..3da744dc8c0 100644
--- a/compiler/rustc_pattern_analysis/src/lints.rs
+++ b/compiler/rustc_pattern_analysis/src/lints.rs
@@ -1,3 +1,4 @@
+use rustc_middle::lint::LevelAndSource;
 use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
 use rustc_span::ErrorGuaranteed;
 use tracing::instrument;
@@ -64,7 +65,7 @@ pub(crate) fn lint_nonexhaustive_missing_variants<'p, 'tcx>(
     scrut_ty: RevealedTy<'tcx>,
 ) -> Result<(), ErrorGuaranteed> {
     if !matches!(
-        rcx.tcx.lint_level_at_node(NON_EXHAUSTIVE_OMITTED_PATTERNS, rcx.match_lint_level).0,
+        rcx.tcx.lint_level_at_node(NON_EXHAUSTIVE_OMITTED_PATTERNS, rcx.match_lint_level).level,
         rustc_session::lint::Level::Allow
     ) {
         let witnesses = collect_nonexhaustive_missing_variants(rcx, pat_column)?;
@@ -88,13 +89,13 @@ pub(crate) fn lint_nonexhaustive_missing_variants<'p, 'tcx>(
         // arm. This no longer makes sense so we warn users, to avoid silently breaking their
         // usage of the lint.
         for arm in arms {
-            let (lint_level, lint_level_source) =
+            let LevelAndSource { level, src, .. } =
                 rcx.tcx.lint_level_at_node(NON_EXHAUSTIVE_OMITTED_PATTERNS, arm.arm_data);
-            if !matches!(lint_level, rustc_session::lint::Level::Allow) {
+            if !matches!(level, rustc_session::lint::Level::Allow) {
                 let decorator = NonExhaustiveOmittedPatternLintOnArm {
-                    lint_span: lint_level_source.span(),
+                    lint_span: src.span(),
                     suggest_lint_on_match: rcx.whole_match_span.map(|span| span.shrink_to_lo()),
-                    lint_level: lint_level.as_str(),
+                    lint_level: level.as_str(),
                     lint_name: "non_exhaustive_omitted_patterns",
                 };