Auto merge of #132894 - frank-king:feature/where-refactor, r=cjgillot
Refactor `where` predicates, and reserve for attributes support Refactor `WherePredicate` to `WherePredicateKind`, and reserve for attributes support in `where` predicates. This is a part of #115590 and is split from #132388. r? petrochenkov
This commit is contained in:
@@ -1100,7 +1100,7 @@ fn check_region_bounds_on_impl_item<'tcx>(
|
||||
// FIXME: we could potentially look at the impl's bounds to not point at bounds that
|
||||
// *are* present in the impl.
|
||||
for p in trait_generics.predicates {
|
||||
if let hir::WherePredicate::BoundPredicate(pred) = p {
|
||||
if let hir::WherePredicateKind::BoundPredicate(pred) = p.kind {
|
||||
for b in pred.bounds {
|
||||
if let hir::GenericBound::Outlives(lt) = b {
|
||||
bounds_span.push(lt.ident.span);
|
||||
@@ -1113,7 +1113,7 @@ fn check_region_bounds_on_impl_item<'tcx>(
|
||||
{
|
||||
let mut impl_bounds = 0;
|
||||
for p in impl_generics.predicates {
|
||||
if let hir::WherePredicate::BoundPredicate(pred) = p {
|
||||
if let hir::WherePredicateKind::BoundPredicate(pred) = p.kind {
|
||||
for b in pred.bounds {
|
||||
if let hir::GenericBound::Outlives(_) = b {
|
||||
impl_bounds += 1;
|
||||
|
||||
@@ -1921,8 +1921,8 @@ fn check_variances_for_type_defn<'tcx>(
|
||||
hir_generics
|
||||
.predicates
|
||||
.iter()
|
||||
.filter_map(|predicate| match predicate {
|
||||
hir::WherePredicate::BoundPredicate(predicate) => {
|
||||
.filter_map(|predicate| match predicate.kind {
|
||||
hir::WherePredicateKind::BoundPredicate(predicate) => {
|
||||
match icx.lower_ty(predicate.bounded_ty).kind() {
|
||||
ty::Param(data) => Some(Parameter(data.index)),
|
||||
_ => None,
|
||||
@@ -2202,8 +2202,8 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
|
||||
span = predicates
|
||||
.iter()
|
||||
// There seems to be no better way to find out which predicate we are in
|
||||
.find(|pred| pred.span().contains(obligation_span))
|
||||
.map(|pred| pred.span())
|
||||
.find(|pred| pred.span.contains(obligation_span))
|
||||
.map(|pred| pred.span)
|
||||
.unwrap_or(obligation_span);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user