Rollup merge of #108189 - compiler-errors:non_lifetime_binders-bound-stuff, r=jackh726
Fix some more `non_lifetime_binders` stuff with higher-ranked trait bounds 1. When assembling candidates for `for<T> T: Sized`, we can't ICE because the self-type is a bound type. 2. Fix an issue where, when canonicalizing in non-universe preserving mode, we don't actually set the universe for placeholders to the root even though we do the same for region vars. 3. Make `Placeholder("T")` format like `T` in error messages. Fixes #108180 Fixes #108182 r? types
This commit is contained in:
commit
c5d5c57666
5 changed files with 103 additions and 9 deletions
|
@ -2148,12 +2148,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
}))
|
||||
}
|
||||
|
||||
ty::Alias(..) | ty::Param(_) => None,
|
||||
ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => None,
|
||||
ty::Infer(ty::TyVar(_)) => Ambiguous,
|
||||
|
||||
ty::Placeholder(..)
|
||||
| ty::Bound(..)
|
||||
| ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
|
||||
// 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(_)) => {
|
||||
bug!("asked to assemble builtin bounds of unexpected type: {:?}", self_ty);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue