Normalize type before deferred sizedness checking.
This commit is contained in:
parent
691a7f8e2b
commit
9d35e57907
2 changed files with 12 additions and 0 deletions
|
|
@ -914,6 +914,7 @@ fn typeck_tables_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
fcx.resolve_generator_interiors(def_id);
|
||||
|
||||
for (ty, span, code) in fcx.deferred_sized_obligations.borrow_mut().drain(..) {
|
||||
let ty = fcx.normalize_ty(span, ty);
|
||||
fcx.require_type_is_sized(ty, span, code);
|
||||
}
|
||||
fcx.select_all_obligations_or_error();
|
||||
|
|
|
|||
11
src/test/run-pass/issue-56237.rs
Normal file
11
src/test/run-pass/issue-56237.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use std::ops::Deref;
|
||||
|
||||
fn foo<P>(_value: <P as Deref>::Target)
|
||||
where
|
||||
P: Deref,
|
||||
<P as Deref>::Target: Sized,
|
||||
{}
|
||||
|
||||
fn main() {
|
||||
foo::<Box<u32>>(2);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue