fmt
This commit is contained in:
parent
f6f5180d5f
commit
48a3ba9a33
@ -990,8 +990,10 @@ fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location
|
|||||||
|
|
||||||
// Check to see if the type of this place can ever have a drop impl. If not, this
|
// Check to see if the type of this place can ever have a drop impl. If not, this
|
||||||
// `Drop` terminator is frivolous.
|
// `Drop` terminator is frivolous.
|
||||||
let ty_needs_drop =
|
let ty_needs_drop = dropped_place
|
||||||
dropped_place.ty(self.body, self.tcx).ty.needs_non_const_drop(self.tcx, self.param_env);
|
.ty(self.body, self.tcx)
|
||||||
|
.ty
|
||||||
|
.needs_non_const_drop(self.tcx, self.param_env);
|
||||||
|
|
||||||
if !ty_needs_drop {
|
if !ty_needs_drop {
|
||||||
return;
|
return;
|
||||||
|
@ -86,8 +86,8 @@
|
|||||||
|
|
||||||
impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints {
|
impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints {
|
||||||
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
|
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
|
||||||
use rustc_middle::ty::PredicateKind::*;
|
|
||||||
use rustc_middle::ty;
|
use rustc_middle::ty;
|
||||||
|
use rustc_middle::ty::PredicateKind::*;
|
||||||
|
|
||||||
let predicates = cx.tcx.explicit_predicates_of(item.def_id);
|
let predicates = cx.tcx.explicit_predicates_of(item.def_id);
|
||||||
for &(predicate, span) in predicates.predicates {
|
for &(predicate, span) in predicates.predicates {
|
||||||
@ -97,7 +97,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
|
|||||||
};
|
};
|
||||||
if trait_predicate.constness == ty::BoundConstness::ConstIfConst {
|
if trait_predicate.constness == ty::BoundConstness::ConstIfConst {
|
||||||
// `~const Drop` definitely have meanings so avoid linting here.
|
// `~const Drop` definitely have meanings so avoid linting here.
|
||||||
continue
|
continue;
|
||||||
}
|
}
|
||||||
let def_id = trait_predicate.trait_ref.def_id;
|
let def_id = trait_predicate.trait_ref.def_id;
|
||||||
if cx.tcx.lang_items().drop_trait() == Some(def_id) {
|
if cx.tcx.lang_items().drop_trait() == Some(def_id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user