Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
I can't reproduce this? On master, that is.
Ah oops, looks like I minimized wrongly, give me a sec...
This should do: `
Minimized -- PR coming up.

Discussion:
bug!("encountered a fresh type during canonicalization") } <del> ty::Placeholder(placeholder) => self.canonicalize_ty_var( CanonicalVarInfo { kind: CanonicalVarKind::PlaceholderTy(placeholder) }, t, ), </del> <ins> ty::Placeholder(mut placeholder) => { if !self.canonicalize_mode.preserve_universes() { placeholder.universe = ty::UniverseIndex::ROOT; } self.canonicalize_ty_var( CanonicalVarInfo { kind: CanonicalVarKind::PlaceholderTy(placeholder) }, t, ) } </ins> ty::Bound(debruijn, _) => { if debruijn >= self.binder_index {

p!(print(data)) } } <del> ty::Placeholder(placeholder) => p!(write("Placeholder({:?})", placeholder)), </del> <ins> ty::Placeholder(placeholder) => match placeholder.name { ty::BoundTyKind::Anon(_) => p!(write("Placeholder({:?})", placeholder)), ty::BoundTyKind::Param(_, name) => p!(write("{}", name)), }, </ins> ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. }) => { // We use verbose printing in 'NO_QUERIES' mode, to // avoid needing to call `predicates_of`. This should

})) } <del> ty::Alias(..) | ty::Param(_) => None, </del> <ins> ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => None, </ins> ty::Infer(ty::TyVar(_)) => Ambiguous, <del> ty::Placeholder(..) | ty::Bound(..) | ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => { </del> <ins> // We can make this an ICE if/once we actually instantiate the trait obligation. ty::Bound(..) => None, ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => { </ins> bug!("asked to assemble builtin bounds of unexpected type: {:?}", self_ty); } }

<ins> #![feature(non_lifetime_binders)] //~^ WARN is incomplete and may not be safe pub fn foo() where for<V> V: Sized, { } pub fn bar() where for<V> V: IntoIterator, { } fn main() { foo(); //~^ ERROR the size for values of type `V` cannot be known at compilation time bar(); //~^ ERROR the size for values of type `V` cannot be known at compilation time //~| ERROR `V` is not an iterator } </ins>

<ins> warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/bad-sized-cond.rs:1:12 | LL | #![feature(non_lifetime_binders)] |            ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information = note: `#[warn(incomplete_features)]` on by default error[E0277]: the size for values of type `V` cannot be known at compilation time --> $DIR/bad-sized-cond.rs:17:5 | LL |     foo(); |     ^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `V` note: required by a bound in `foo` --> $DIR/bad-sized-cond.rs:6:15 | LL | pub fn foo() |        --- required by a bound in this LL | where LL |     for<V> V: Sized, |               ^^^^^ required by this bound in `foo` error[E0277]: the size for values of type `V` cannot be known at compilation time --> $DIR/bad-sized-cond.rs:20:5 | LL |     bar(); |     ^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `V` = note: required for `V` to implement `IntoIterator` note: required by a bound in `bar` --> $DIR/bad-sized-cond.rs:12:15 | LL | pub fn bar() |        --- required by a bound in this LL | where LL |     for<V> V: IntoIterator, |               ^^^^^^^^^^^^ required by this bound in `bar` error[E0277]: `V` is not an iterator --> $DIR/bad-sized-cond.rs:20:5 | LL |     bar(); |     ^^^ `V` is not an iterator | = help: the trait `Iterator` is not implemented for `V` = note: required for `V` to implement `IntoIterator` note: required by a bound in `bar` --> $DIR/bad-sized-cond.rs:12:15 | LL | pub fn bar() |        --- required by a bound in this LL | where LL |     for<V> V: IntoIterator, |               ^^^^^^^^^^^^ required by this bound in `bar` error: aborting due to 3 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0277`. </ins>