mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
never type is const Drop
This commit is contained in:
parent
ba87be05cf
commit
e3f01b2b6f
@ -932,7 +932,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
| ty::Bound(..)
|
||||
| ty::Param(_)
|
||||
| ty::Placeholder(_)
|
||||
| ty::Never
|
||||
| ty::Foreign(_)
|
||||
| ty::Projection(_) => {
|
||||
// We don't know if these are `~const Drop`, at least
|
||||
@ -951,6 +950,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
| ty::Ref(..)
|
||||
| ty::FnDef(..)
|
||||
| ty::FnPtr(_)
|
||||
| ty::Never
|
||||
| ty::Array(..)
|
||||
| ty::Slice(_)
|
||||
| ty::Closure(..)
|
||||
|
@ -1103,6 +1103,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
let tcx = self.tcx();
|
||||
let self_ty = self.infcx.shallow_resolve(obligation.self_ty());
|
||||
|
||||
// Skip binder here (*)
|
||||
let nested_tys = match *self_ty.skip_binder().kind() {
|
||||
ty::Bool
|
||||
| ty::Char
|
||||
@ -1116,7 +1117,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
| ty::Ref(..)
|
||||
| ty::FnDef(..)
|
||||
| ty::FnPtr(_)
|
||||
| ty::Projection(_) => vec![],
|
||||
| ty::Never => vec![],
|
||||
|
||||
ty::Adt(def, substs) => def.all_fields().map(|f| f.ty(tcx, substs)).collect(),
|
||||
|
||||
@ -1138,8 +1139,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
| ty::Bound(_, _)
|
||||
| ty::Param(_)
|
||||
| ty::Placeholder(_)
|
||||
| ty::Never
|
||||
| ty::Foreign(_)
|
||||
| ty::Projection(_)
|
||||
| ty::Infer(_) => {
|
||||
unreachable!();
|
||||
}
|
||||
@ -1165,6 +1166,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
obligation.param_env,
|
||||
cause.clone(),
|
||||
obligation.recursion_depth + 1,
|
||||
// Rebinding here (*)
|
||||
self_ty
|
||||
.rebind(ty::TraitPredicate {
|
||||
trait_ref: ty::TraitRef {
|
||||
|
Loading…
Reference in New Issue
Block a user