mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 07:04:18 +00:00
Make queries more explicit
This commit is contained in:
parent
f90d702e66
commit
b60a6ad7f5
3 changed files with 3 additions and 3 deletions
|
@ -246,7 +246,7 @@ fn collect_supertrait_bounds<'tcx>(cx: &LateContext<'tcx>, bounds: GenericBounds
|
|||
&& let [.., path] = poly_trait.trait_ref.path.segments
|
||||
&& poly_trait.bound_generic_params.is_empty()
|
||||
&& let Some(trait_def_id) = path.res.opt_def_id()
|
||||
&& let predicates = cx.tcx.super_predicates_of(trait_def_id).predicates
|
||||
&& let predicates = cx.tcx.explicit_super_predicates_of(trait_def_id).predicates
|
||||
// If the trait has no supertrait, there is no need to collect anything from that bound
|
||||
&& !predicates.is_empty()
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ fn is_subtrait_of_any(cx: &LateContext<'_>, ty: Ty<'_>) -> bool {
|
|||
cx.tcx.is_diagnostic_item(sym::Any, tr.def_id)
|
||||
|| cx
|
||||
.tcx
|
||||
.super_predicates_of(tr.def_id)
|
||||
.explicit_super_predicates_of(tr.def_id)
|
||||
.predicates
|
||||
.iter()
|
||||
.any(|(clause, _)| {
|
||||
|
|
|
@ -91,7 +91,7 @@ fn path_to_sized_bound(cx: &LateContext<'_>, trait_bound: &PolyTraitRef<'_>) ->
|
|||
return true;
|
||||
}
|
||||
|
||||
for &(predicate, _) in cx.tcx.super_predicates_of(trait_def_id).predicates {
|
||||
for &(predicate, _) in cx.tcx.explicit_super_predicates_of(trait_def_id).predicates {
|
||||
if let ClauseKind::Trait(trait_predicate) = predicate.kind().skip_binder()
|
||||
&& trait_predicate.polarity == PredicatePolarity::Positive
|
||||
&& !path.contains(&trait_predicate.def_id())
|
||||
|
|
Loading…
Reference in a new issue