Check drop is trivial before checking ty needs drop
This commit is contained in:
parent
af0d566e76
commit
69a38de977
12 changed files with 57 additions and 180 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
pub mod tls;
|
||||
|
||||
use std::assert_matches::assert_matches;
|
||||
use std::assert_matches::{assert_matches, debug_assert_matches};
|
||||
use std::borrow::Borrow;
|
||||
use std::cmp::Ordering;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
@ -377,14 +377,17 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
|
|||
}
|
||||
|
||||
fn impl_is_const(self, def_id: DefId) -> bool {
|
||||
debug_assert_matches!(self.def_kind(def_id), DefKind::Impl { of_trait: true });
|
||||
self.is_conditionally_const(def_id)
|
||||
}
|
||||
|
||||
fn fn_is_const(self, def_id: DefId) -> bool {
|
||||
debug_assert_matches!(self.def_kind(def_id), DefKind::Fn | DefKind::AssocFn);
|
||||
self.is_conditionally_const(def_id)
|
||||
}
|
||||
|
||||
fn alias_has_const_conditions(self, def_id: DefId) -> bool {
|
||||
debug_assert_matches!(self.def_kind(def_id), DefKind::AssocTy | DefKind::OpaqueTy);
|
||||
self.is_conditionally_const(def_id)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue