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!(
8787impl < ' tcx > LateLintPass < ' tcx > for DropTraitConstraints {
8888 fn check_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx hir:: Item < ' tcx > ) {
8989 use rustc_middle:: ty:: PredicateKind :: * ;
90+ use rustc_middle:: ty;
9091
9192 let predicates = cx. tcx . explicit_predicates_of ( item. def_id ) ;
9293 for & ( predicate, span) in predicates. predicates {
9394 let trait_predicate = match predicate. kind ( ) . skip_binder ( ) {
9495 Trait ( trait_predicate) => trait_predicate,
9596 _ => continue ,
9697 } ;
98+ if trait_predicate. constness == ty:: BoundConstness :: ConstIfConst {
99+ // `~const Drop` definitely have meanings so avoid linting here.
100+ continue
101+ }
97102 let def_id = trait_predicate. trait_ref . def_id ;
98103 if cx. tcx . lang_items ( ) . drop_trait ( ) == Some ( def_id) {
99104 // Explicitly allow `impl Drop`, a drop-guards-as-Voldemort-type pattern.
You can’t perform that action at this time.
0 commit comments