1
Fork 0

never is trivially const-drop, and add test

This commit is contained in:
Michael Goulet 2022-01-19 12:59:28 -08:00
parent 0eccd5feef
commit 8547f5732c
2 changed files with 4 additions and 2 deletions

View file

@ -1054,7 +1054,8 @@ pub fn trivial_const_drop<'tcx>(ty: Ty<'tcx>) -> bool {
| ty::RawPtr(_)
| ty::Ref(..)
| ty::FnDef(..)
| ty::FnPtr(_) => true,
| ty::FnPtr(_)
| ty::Never => true,
ty::Opaque(..)
| ty::Dynamic(..)
@ -1062,7 +1063,6 @@ pub fn trivial_const_drop<'tcx>(ty: Ty<'tcx>) -> bool {
| ty::Bound(..)
| ty::Param(_)
| ty::Placeholder(_)
| ty::Never
| ty::Foreign(_)
| ty::Projection(_)
| ty::Infer(_) => false,