Use ty::type_is_sized() so that we handle projection types properly.
This commit is contained in:
parent
6300a97216
commit
9e4e8823c7
3 changed files with 21 additions and 8 deletions
|
|
@ -135,10 +135,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
|
|||
t
|
||||
}
|
||||
|
||||
ty::ty_open(..) => {
|
||||
self.tcx().sess.bug("Cannot freshen an open existential type");
|
||||
}
|
||||
|
||||
ty::ty_open(..) |
|
||||
ty::ty_bool |
|
||||
ty::ty_char |
|
||||
ty::ty_int(..) |
|
||||
|
|
|
|||
|
|
@ -1457,11 +1457,26 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
Ok(AmbiguousBuiltin)
|
||||
}
|
||||
|
||||
ty::ty_open(ty) => {
|
||||
// these only crop up in trans, and represent an
|
||||
// "opened" unsized/existential type (one that has
|
||||
// been dereferenced)
|
||||
match bound {
|
||||
ty::BoundCopy |
|
||||
ty::BoundSync |
|
||||
ty::BoundSend => {
|
||||
Ok(If(vec!(ty)))
|
||||
}
|
||||
|
||||
ty::BoundSized => {
|
||||
Err(Unimplemented)
|
||||
}
|
||||
}
|
||||
}
|
||||
ty::ty_err => {
|
||||
Ok(If(Vec::new()))
|
||||
}
|
||||
|
||||
ty::ty_open(_) |
|
||||
ty::ty_infer(ty::FreshTy(_)) |
|
||||
ty::ty_infer(ty::FreshIntTy(_)) => {
|
||||
self.tcx().sess.bug(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue