Skip to content

Commit

Permalink
Normalize type before deferred sizedness checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
qnighy committed Nov 27, 2018
1 parent 691a7f8 commit 9d35e57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_typeck/check/mod.rs
Expand Up @@ -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();
Expand Down
11 changes: 11 additions & 0 deletions src/test/run-pass/issue-56237.rs
@@ -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);
}

0 comments on commit 9d35e57

Please sign in to comment.