Skip to content

Commit e3c1139

Browse files
committed
super_const and comments
1 parent 8bc1355 commit e3c1139

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

compiler/rustc_mir_transform/src/add_subtyping_projections.rs

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ impl<'a, 'tcx> MutVisitor<'tcx> for SubTypeChecker<'a, 'tcx> {
2424
rvalue: &mut Rvalue<'tcx>,
2525
location: Location,
2626
) {
27+
// We don't need to do anything for internal locals as they are
28+
// not part of the source code, but used for desugaring purposes.
2729
if self.local_decls[place.local].internal {
2830
return;
2931
}

compiler/rustc_mir_transform/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ fn run_runtime_lowering_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
482482
// These next passes must be executed together
483483
&add_call_guards::CriticalCallEdges,
484484
&reveal_all::RevealAll, // has to be done before drop elaboration, since we need to drop opaque types, too.
485-
&add_subtyping_projections::Subtyper,
485+
&add_subtyping_projections::Subtyper, // calling this after reveal_all ensures that we don't deal with opaque types
486486
&elaborate_drops::ElaborateDrops,
487487
// This will remove extraneous landing pads which are no longer
488488
// necessary as well as well as forcing any call in a non-unwinding

compiler/rustc_mir_transform/src/reveal_all.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ impl<'tcx> MutVisitor<'tcx> for RevealAllVisitor<'tcx> {
5050
}
5151

5252
#[inline]
53-
fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, _: Location) {
53+
fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
5454
// We have to use `try_normalize_erasing_regions` here, since it's
5555
// possible that we visit impossible-to-satisfy where clauses here,
5656
// see #91745
5757
if let Ok(c) = self.tcx.try_normalize_erasing_regions(self.param_env, constant.const_) {
5858
constant.const_ = c;
5959
}
60+
self.super_constant(constant, location);
6061
}
6162

6263
#[inline]

0 commit comments

Comments
 (0)