Skip to content

Commit ee59531

Browse files
committed
Explain with_reveal_all_normalized usage
1 parent de68911 commit ee59531

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_ty_utils/src/layout.rs

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ fn layout_of<'tcx>(
3636
let (param_env, ty) = query.into_parts();
3737
debug!(?ty);
3838

39+
// Optimization: We convert to RevealAll and convert opaque types in the where bounds
40+
// to their hidden types. This reduces overall uncached invocations of `layout_of` and
41+
// is thus a small performance improvement.
3942
let param_env = param_env.with_reveal_all_normalized(tcx);
4043
let unnormalized_ty = ty;
4144

0 commit comments

Comments
 (0)