Skip to content

Commit

Permalink
Explain with_reveal_all_normalized usage
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Sep 18, 2023
1 parent de68911 commit ee59531
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_ty_utils/src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ fn layout_of<'tcx>(
let (param_env, ty) = query.into_parts();
debug!(?ty);

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

Expand Down

0 comments on commit ee59531

Please sign in to comment.