diff options
| author | Michael Goulet <michael@errs.io> | 2023-02-17 21:01:22 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-02-18 19:49:40 +0000 |
| commit | f4a4a3147955ceb359204d85a74e15ee9d98046b (patch) | |
| tree | 7cbed8c2e2c7887011d76f46b130f731f6c50616 /compiler | |
| parent | 3eb5c4581a386b13c414e8c8bd73846ef37236d1 (diff) | |
| download | rust-f4a4a3147955ceb359204d85a74e15ee9d98046b.tar.gz rust-f4a4a3147955ceb359204d85a74e15ee9d98046b.zip | |
Don't ICE on bound types in sized conditions
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index e6fc9bb9239..4b15dd408b3 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -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); } } |
