about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lints.rs
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2023-12-11 20:15:52 +0100
committerNadrieril <nadrieril+git@gmail.com>2023-12-15 16:58:37 +0100
commitcb622f3994a23d09bb24ef1add67a1569009d558 (patch)
tree71b35f5dcb0d6d1864c9a607ca8f864e0a8fafe4 /compiler/rustc_pattern_analysis/src/lints.rs
parent3d7c4df3260f80593c70f901029d696520234b64 (diff)
downloadrust-cb622f3994a23d09bb24ef1add67a1569009d558.tar.gz
rust-cb622f3994a23d09bb24ef1add67a1569009d558.zip
Name rustc-specific things "rustc"
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lints.rs')
-rw-r--r--compiler/rustc_pattern_analysis/src/lints.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lints.rs b/compiler/rustc_pattern_analysis/src/lints.rs
index 88967ab9010..89eb439c3f0 100644
--- a/compiler/rustc_pattern_analysis/src/lints.rs
+++ b/compiler/rustc_pattern_analysis/src/lints.rs
@@ -8,14 +8,13 @@ use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
 use rustc_span::Span;
 
 use crate::constructor::{IntRange, MaybeInfiniteInt};
-use crate::cx::{
-    Constructor, DeconstructedPat, MatchArm, MatchCheckCtxt, PatCtxt, SplitConstructorSet,
-    WitnessPat,
-};
 use crate::errors::{
     NonExhaustiveOmittedPattern, NonExhaustiveOmittedPatternLintOnArm, Overlap,
     OverlappingRangeEndpoints, Uncovered,
 };
+use crate::rustc::{
+    Constructor, DeconstructedPat, MatchArm, PatCtxt, RustcCtxt, SplitConstructorSet, WitnessPat,
+};
 use crate::MatchCx;
 
 /// A column of patterns in the matrix, where a column is the intuitive notion of "subpatterns that
@@ -56,10 +55,10 @@ impl<'a, 'p, 'tcx> PatternColumn<'a, 'p, 'tcx> {
         // If the type is opaque and it is revealed anywhere in the column, we take the revealed
         // version. Otherwise we could encounter constructors for the revealed type and crash.
         let first_ty = self.patterns[0].ty();
-        if MatchCheckCtxt::is_opaque_ty(first_ty) {
+        if RustcCtxt::is_opaque_ty(first_ty) {
             for pat in &self.patterns {
                 let ty = pat.ty();
-                if !MatchCheckCtxt::is_opaque_ty(ty) {
+                if !RustcCtxt::is_opaque_ty(ty) {
                     return Some(ty);
                 }
             }
@@ -126,7 +125,7 @@ impl<'a, 'p, 'tcx> PatternColumn<'a, 'p, 'tcx> {
 /// in a given column.
 #[instrument(level = "debug", skip(cx, wildcard_arena), ret)]
 fn collect_nonexhaustive_missing_variants<'a, 'p, 'tcx>(
-    cx: &MatchCheckCtxt<'p, 'tcx>,
+    cx: &RustcCtxt<'p, 'tcx>,
     column: &PatternColumn<'a, 'p, 'tcx>,
     wildcard_arena: &TypedArena<DeconstructedPat<'p, 'tcx>>,
 ) -> Vec<WitnessPat<'p, 'tcx>> {
@@ -174,7 +173,7 @@ fn collect_nonexhaustive_missing_variants<'a, 'p, 'tcx>(
 }
 
 pub(crate) fn lint_nonexhaustive_missing_variants<'a, 'p, 'tcx>(
-    cx: &MatchCheckCtxt<'p, 'tcx>,
+    cx: &RustcCtxt<'p, 'tcx>,
     arms: &[MatchArm<'p, 'tcx>],
     pat_column: &PatternColumn<'a, 'p, 'tcx>,
     scrut_ty: Ty<'tcx>,
@@ -228,7 +227,7 @@ pub(crate) fn lint_nonexhaustive_missing_variants<'a, 'p, 'tcx>(
 /// Traverse the patterns to warn the user about ranges that overlap on their endpoints.
 #[instrument(level = "debug", skip(cx, wildcard_arena))]
 pub(crate) fn lint_overlapping_range_endpoints<'a, 'p, 'tcx>(
-    cx: &MatchCheckCtxt<'p, 'tcx>,
+    cx: &RustcCtxt<'p, 'tcx>,
     column: &PatternColumn<'a, 'p, 'tcx>,
     wildcard_arena: &TypedArena<DeconstructedPat<'p, 'tcx>>,
 ) {