diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2023-12-26 13:21:35 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2024-01-01 23:10:03 +0100 |
| commit | c35272058dfb9d93df35069c2ec55d2b7ce491b4 (patch) | |
| tree | 0a84b033043cfc02aab0f49494622ae7aef3b677 /compiler/rustc_pattern_analysis/src/lib.rs | |
| parent | e51e98dde6a60637b6a71b8105245b629ac3fe77 (diff) | |
| download | rust-c35272058dfb9d93df35069c2ec55d2b7ce491b4.tar.gz rust-c35272058dfb9d93df35069c2ec55d2b7ce491b4.zip | |
Statically enforce revealing of opaques
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/lib.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index e01b571ede1..8ea8dd61ab4 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -61,8 +61,6 @@ pub trait TypeCx: Sized + fmt::Debug { /// Extra data to store in a pattern. type PatData: Clone; - /// FIXME(Nadrieril): `Cx` should only give us revealed types. - fn reveal_opaque_ty(&self, ty: Self::Ty) -> Self::Ty; fn is_exhaustive_patterns_feature_on(&self) -> bool; /// The number of fields for this constructor. @@ -114,6 +112,7 @@ pub fn analyze_match<'p, 'tcx>( ) -> rustc::UsefulnessReport<'p, 'tcx> { // 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 }; |
