summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lib.rs
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2024-01-03 01:34:38 +0100
committerNadrieril <nadrieril+git@gmail.com>2024-01-12 18:55:27 +0100
commitdb36304102fd86305b0319d5a3d8f440aa4b139d (patch)
tree50952a3955cb3b606839b9a3153d171396148b29 /compiler/rustc_pattern_analysis/src/lib.rs
parent174e73a3f6df6f96ab453493796e461164dea94a (diff)
downloadrust-db36304102fd86305b0319d5a3d8f440aa4b139d.tar.gz
rust-db36304102fd86305b0319d5a3d8f440aa4b139d.zip
rustc_pattern_analysis no longer needs to be passed an arena
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
-rw-r--r--compiler/rustc_pattern_analysis/src/lib.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs
index 374914055d8..ed10a515508 100644
--- a/compiler/rustc_pattern_analysis/src/lib.rs
+++ b/compiler/rustc_pattern_analysis/src/lib.rs
@@ -38,13 +38,6 @@ use crate::rustc::RustcMatchCheckCtxt;
 #[cfg(feature = "rustc")]
 use crate::usefulness::{compute_match_usefulness, ValidityConstraint};
 
-// It's not possible to only enable the `typed_arena` dependency when the `rustc` feature is off, so
-// we use another feature instead. The crate won't compile if one of these isn't enabled.
-#[cfg(feature = "rustc")]
-pub(crate) use rustc_arena::TypedArena;
-#[cfg(feature = "stable")]
-pub(crate) use typed_arena::Arena as TypedArena;
-
 pub trait Captures<'a> {}
 impl<'a, T: ?Sized> Captures<'a> for T {}
 
@@ -89,11 +82,9 @@ pub trait TypeCx: Sized + fmt::Debug {
 /// Context that provides information global to a match.
 #[derive(derivative::Derivative)]
 #[derivative(Clone(bound = ""), Copy(bound = ""))]
-pub struct MatchCtxt<'a, 'p, Cx: TypeCx> {
+pub struct MatchCtxt<'a, Cx: TypeCx> {
     /// The context for type information.
     pub tycx: &'a Cx,
-    /// An arena to store the wildcards we produce during analysis.
-    pub wildcard_arena: &'p TypedArena<DeconstructedPat<'p, Cx>>,
 }
 
 /// The arm of a match expression.
@@ -114,11 +105,9 @@ pub fn analyze_match<'p, 'tcx>(
     arms: &[rustc::MatchArm<'p, 'tcx>],
     scrut_ty: Ty<'tcx>,
 ) -> Result<rustc::UsefulnessReport<'p, 'tcx>, ErrorGuaranteed> {
-    // Arena to store the extra wildcards we construct during analysis.
-    let wildcard_arena = tycx.pattern_arena;
     let scrut_ty = tycx.reveal_opaque_ty(scrut_ty);
     let scrut_validity = ValidityConstraint::from_bool(tycx.known_valid_scrutinee);
-    let cx = MatchCtxt { tycx, wildcard_arena };
+    let cx = MatchCtxt { tycx };
 
     let report = compute_match_usefulness(cx, arms, scrut_ty, scrut_validity)?;