diff options
| author | Jubilee <workingjubilee@gmail.com> | 2024-11-08 20:46:11 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-08 20:46:11 -0800 |
| commit | 1077c08ad5fbf4c8aad28e8681fa80d9297005bc (patch) | |
| tree | 1c445a15e2a70d3d16b928c2a573ca8d9f739e00 | |
| parent | 328b759142ddeae96da83176f103200009d3e3f1 (diff) | |
| parent | 13ab08d7dc353d1d30ad055eea4c7ec4e5310237 (diff) | |
| download | rust-1077c08ad5fbf4c8aad28e8681fa80d9297005bc.tar.gz rust-1077c08ad5fbf4c8aad28e8681fa80d9297005bc.zip | |
Rollup merge of #132755 - compiler-errors:reveal-param, r=lcnr
Do not reveal opaques in the param-env, we got lazy norm instead r? lcnr
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/util.rs | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 6d9ba3d60e3..1a3128ed936 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1076,11 +1076,6 @@ impl<'tcx> ParamEnv<'tcx> { ty::ParamEnv { packed: CopyTaggedPtr::new(caller_bounds, ParamTag { reveal }) } } - pub fn with_user_facing(mut self) -> Self { - self.packed.set_tag(ParamTag { reveal: Reveal::UserFacing, ..self.packed.tag() }); - self - } - /// Returns a new parameter environment with the same clauses, but /// which "reveals" the true results of projections in all cases /// (even for associated types that are specializable). This is @@ -1095,6 +1090,12 @@ impl<'tcx> ParamEnv<'tcx> { return self; } + // No need to reveal opaques with the new solver enabled, + // since we have lazy norm. + if tcx.next_trait_solver_globally() { + return ParamEnv::new(self.caller_bounds(), Reveal::All); + } + ParamEnv::new(tcx.reveal_opaque_types_in_bounds(self.caller_bounds()), Reveal::All) } diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index fc5a3b762e5..3c6e34160f4 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -1751,6 +1751,7 @@ pub fn reveal_opaque_types_in_bounds<'tcx>( tcx: TyCtxt<'tcx>, val: ty::Clauses<'tcx>, ) -> ty::Clauses<'tcx> { + assert!(!tcx.next_trait_solver_globally()); let mut visitor = OpaqueTypeExpander { seen_opaque_tys: FxHashSet::default(), expanded_cache: FxHashMap::default(), |
