Change:
https://crater-
searched nightlies: from nightly-2024-02-01 to nightly-2024-03-20 regressed nightly: nightly-2024-02-10 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.8</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </detailsprobably
WG-prioritization assigning priority (). label -I-prioritize +P-high
MCVE

Discussion:
fn visit(&mut self, span: Span, value: impl TypeVisitable<TyCtxt<'tcx>>) -> Self::Result; } <ins> #[instrument(level = "trace", skip(tcx, visitor))] </ins> pub fn walk_types<'tcx, V: SpannedTypeVisitor<'tcx>>( tcx: TyCtxt<'tcx>, item: LocalDefId,

for (hir, ty) in hir_sig.inputs.iter().zip(ty_sig.inputs().iter()) { try_visit!(visitor.visit(hir.span, ty.map_bound(|x| *x))); } <del> for (pred, span) in tcx.predicates_of(item).instantiate_identity(tcx) { </del> <ins> for (pred, span) in tcx.explicit_predicates_of(item).instantiate_identity(tcx) { </ins> try_visit!(visitor.visit(span, pred)); } }

// Associated types in traits don't necessarily have a type that we can visit try_visit!(visitor.visit(ty.span, tcx.type_of(item).instantiate_identity())); } <del> for (pred, span) in tcx.predicates_of(item).instantiate_identity(tcx) { </del> <ins> for (pred, span) in tcx.explicit_predicates_of(item).instantiate_identity(tcx) { </ins> try_visit!(visitor.visit(span, pred)); } }

let ty = field.ty(tcx, args); try_visit!(visitor.visit(span, ty)); } <del> for (pred, span) in tcx.predicates_of(item).instantiate_identity(tcx) { </del> <ins> for (pred, span) in tcx.explicit_predicates_of(item).instantiate_identity(tcx) { </ins> try_visit!(visitor.visit(span, pred)); } }

_ => tcx.def_span(item), }; try_visit!(visitor.visit(span, tcx.type_of(item).instantiate_identity())); <del> for (pred, span) in tcx.predicates_of(item).instantiate_identity(tcx) { </del> <ins> for (pred, span) in tcx.explicit_predicates_of(item).instantiate_identity(tcx) { </ins> try_visit!(visitor.visit(span, pred)); } } DefKind::TraitAlias | DefKind::Trait => { <del> for (pred, span) in tcx.predicates_of(item).instantiate_identity(tcx) { </del> <ins> for (pred, span) in tcx.explicit_predicates_of(item).instantiate_identity(tcx) { </ins> try_visit!(visitor.visit(span, pred)); } }

<ins> //! To determine all the types that need to be private when looking at `Struct`, we //! used to invoke `predicates_of` to also look at types in `where` bounds. //! Unfortunately this also computes the inferred outlives bounds, which means for //! every field we check that if it is of type `&'a T` then `T: 'a` and if it is of //! struct type, we check that the struct satisfies its lifetime parameters by looking //! at its inferred outlives bounds. This means we end up with a `<Foo as Trait>::Assoc: 'a` //! in the outlives bounds of `Struct`. While this is trivially provable, privacy //! only sees `Foo` and `Trait` and determines that `Foo` is private and then errors. //! So now we invoke `explicit_predicates_of` to make sure we only care about user-written //! predicates. //@ check-pass mod baz { struct Foo; pub trait Trait { type Assoc; } impl Trait for Foo { type Assoc = (); } pub struct Bar<'a, T: Trait> { source: &'a T::Assoc, } pub struct Baz<'a> { mode: Bar<'a, Foo>, } } pub struct Struct<'a> { lexer: baz::Baz<'a>, } fn main() {} </ins>