We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1dc6b2a commit 0c78648Copy full SHA for 0c78648
compiler/rustc_mir_transform/src/reveal_all.rs
@@ -32,6 +32,10 @@ impl<'tcx> MutVisitor<'tcx> for RevealAllVisitor<'tcx> {
32
_context: PlaceContext,
33
_location: Location,
34
) {
35
+ // Performance optimization: don't reintern if there is no `OpaqueCast` to remove.
36
+ if place.projection.iter().all(|elem| !matches!(elem, ProjectionElem::OpaqueCast(_))) {
37
+ return;
38
+ }
39
// `OpaqueCast` projections are only needed if there are opaque types on which projections are performed.
40
// After the `RevealAll` pass, all opaque types are replaced with their hidden types, so we don't need these
41
// projections anymore.
0 commit comments