File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,18 @@ declare_lint_pass!(
87
87
impl < ' tcx > LateLintPass < ' tcx > for DropTraitConstraints {
88
88
fn check_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx hir:: Item < ' tcx > ) {
89
89
use rustc_middle:: ty:: PredicateKind :: * ;
90
+ use rustc_middle:: ty;
90
91
91
92
let predicates = cx. tcx . explicit_predicates_of ( item. def_id ) ;
92
93
for & ( predicate, span) in predicates. predicates {
93
94
let trait_predicate = match predicate. kind ( ) . skip_binder ( ) {
94
95
Trait ( trait_predicate) => trait_predicate,
95
96
_ => continue ,
96
97
} ;
98
+ if trait_predicate. constness == ty:: BoundConstness :: ConstIfConst {
99
+ // `~const Drop` definitely have meanings so avoid linting here.
100
+ continue
101
+ }
97
102
let def_id = trait_predicate. trait_ref . def_id ;
98
103
if cx. tcx . lang_items ( ) . drop_trait ( ) == Some ( def_id) {
99
104
// Explicitly allow `impl Drop`, a drop-guards-as-Voldemort-type pattern.
You can’t perform that action at this time.
0 commit comments