Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
b-naber committed Dec 1, 2021
1 parent 84bcd40 commit 4d9a0bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,11 @@ rustc_queries! {
desc { "normalizing `{:?}`", goal }
}

// FIXME: Implement `normalize_generic_arg_after_erasing_regions` and
// `normalize_mir_const_after_erasing_regions` in terms of
// `try_normalize_generic_arg_after_erasing_regions` and
// `try_normalize_mir_const_after_erasing_regions`, respectively.

/// Do not call this query directly: invoke `normalize_erasing_regions` instead.
query normalize_generic_arg_after_erasing_regions(
goal: ParamEnvAnd<'tcx, GenericArg<'tcx>>
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ fn layout_of<'tcx>(
let param_env = param_env.with_reveal_all_normalized(tcx);
let unnormalized_ty = ty;

// FIXME: We might want to have two different versions of `layout_of`:
// One that can be called after typecheck has completed and can use
// `normalize_erasing_regions` here and another one that can be called
// before typecheck has completed and uses `try_normalize_erasing_regions`.
let ty = match tcx.try_normalize_erasing_regions(param_env, ty) {
Ok(t) => t,
Err(normalization_error) => {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
writeln!(
w,
"<p><strong>Note:</strong> Encountered an error during type layout; \
the type was not normalizable.</p>"
the type failed to be normalized.</p>"
)
}
}
Expand Down

0 comments on commit 4d9a0bf

Please sign in to comment.