1
Fork 0

Begin to implement type system layer of unsafe binders

This commit is contained in:
Michael Goulet 2024-12-21 17:05:40 +00:00
parent b22856d192
commit 9a1c5eb5b3
79 changed files with 536 additions and 305 deletions

View file

@ -2095,6 +2095,9 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
}
}
// FIXME(unsafe_binders): This binder needs to be squashed
ty::UnsafeBinder(binder_ty) => Where(binder_ty.map_bound(|ty| vec![ty])),
ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => None,
ty::Infer(ty::TyVar(_)) => Ambiguous,
@ -2133,6 +2136,10 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
None
}
// FIXME(unsafe_binder): Should we conditionally
// (i.e. universally) implement copy/clone?
ty::UnsafeBinder(_) => None,
ty::Dynamic(..)
| ty::Str
| ty::Slice(..)
@ -2285,6 +2292,9 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
| ty::Never
| ty::Char => ty::Binder::dummy(Vec::new()),
// FIXME(unsafe_binders): Squash the double binder for now, I guess.
ty::UnsafeBinder(_) => return Err(SelectionError::Unimplemented),
// Treat this like `struct str([u8]);`
ty::Str => ty::Binder::dummy(vec![Ty::new_slice(self.tcx(), self.tcx().types.u8)]),