Skip to content

Commit 4116552

Browse files
authored
Rollup merge of rust-lang#127045 - compiler-errors:explicit, r=oli-obk
Rename `super_predicates_of` and similar queries to `explicit_*` to note that they're not elaborated Rename: * `super_predicates_of` -> `explicit_super_predicates_of` * `implied_predicates_of` -> `explicit_implied_predicates_of` * `supertraits_containing_assoc_item` -> `explicit_supertraits_containing_assoc_item` This makes it clearer that, unlike (for example) [`TyCtxt::super_traits_of`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.super_traits_of), we don't automatically elaborate this set of predicates. r? ``@lcnr`` or ``@oli-obk`` or someone from t-types idc
2 parents fb95df7 + b60a6ad commit 4116552

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clippy_lints/src/implied_bounds_in_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn collect_supertrait_bounds<'tcx>(cx: &LateContext<'tcx>, bounds: GenericBounds
246246
&& let [.., path] = poly_trait.trait_ref.path.segments
247247
&& poly_trait.bound_generic_params.is_empty()
248248
&& let Some(trait_def_id) = path.res.opt_def_id()
249-
&& let predicates = cx.tcx.super_predicates_of(trait_def_id).predicates
249+
&& let predicates = cx.tcx.explicit_super_predicates_of(trait_def_id).predicates
250250
// If the trait has no supertrait, there is no need to collect anything from that bound
251251
&& !predicates.is_empty()
252252
{

clippy_lints/src/methods/type_id_on_box.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn is_subtrait_of_any(cx: &LateContext<'_>, ty: Ty<'_>) -> bool {
2424
cx.tcx.is_diagnostic_item(sym::Any, tr.def_id)
2525
|| cx
2626
.tcx
27-
.super_predicates_of(tr.def_id)
27+
.explicit_super_predicates_of(tr.def_id)
2828
.predicates
2929
.iter()
3030
.any(|(clause, _)| {

clippy_lints/src/needless_maybe_sized.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn path_to_sized_bound(cx: &LateContext<'_>, trait_bound: &PolyTraitRef<'_>) ->
9191
return true;
9292
}
9393

94-
for &(predicate, _) in cx.tcx.super_predicates_of(trait_def_id).predicates {
94+
for &(predicate, _) in cx.tcx.explicit_super_predicates_of(trait_def_id).predicates {
9595
if let ClauseKind::Trait(trait_predicate) = predicate.kind().skip_binder()
9696
&& trait_predicate.polarity == PredicatePolarity::Positive
9797
&& !path.contains(&trait_predicate.def_id())

0 commit comments

Comments
 (0)