Skip to content

Commit

Permalink
Update test suite to nightly-2024-07-25
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 25, 2024
1 parent a397d0b commit 4f30613
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions tests/test_precedence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
ExprField, ExprKind, GenericArg, GenericBound, Local, LocalKind, Pat, Stmt, StmtKind,
StructExpr, StructRest, TraitBoundModifiers, Ty,
};
use rustc_ast::mut_visit::{noop_flat_map_item, MutVisitor};
use rustc_ast::mut_visit::{walk_flat_map_item, MutVisitor};
use rustc_ast::visit::{AssocCtxt, BoundKind};
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
use rustc_span::DUMMY_SP;
use smallvec::SmallVec;
Expand Down Expand Up @@ -253,7 +254,7 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
vis.visit_expr(rest);
}
}
_ => rustc_ast::mut_visit::noop_visit_expr(e, vis),
_ => rustc_ast::mut_visit::walk_expr(vis, e),
}
}

Expand Down Expand Up @@ -292,7 +293,7 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
}
}

fn visit_param_bound(&mut self, bound: &mut GenericBound) {
fn visit_param_bound(&mut self, bound: &mut GenericBound, _ctxt: BoundKind) {
match bound {
GenericBound::Trait(
_,
Expand Down Expand Up @@ -328,27 +329,19 @@ fn librustc_parenthesize(mut librustc_expr: P<ast::Expr>) -> P<ast::Expr> {
}
}

fn flat_map_trait_item(&mut self, item: P<AssocItem>) -> SmallVec<[P<AssocItem>; 1]> {
fn flat_map_assoc_item(
&mut self,
item: P<AssocItem>,
_ctxt: AssocCtxt,
) -> SmallVec<[P<AssocItem>; 1]> {
match &item.kind {
AssocItemKind::Const(const_item)
if !const_item.generics.params.is_empty()
|| !const_item.generics.where_clause.predicates.is_empty() =>
{
SmallVec::from([item])
}
_ => noop_flat_map_item(item, self),
}
}

fn flat_map_impl_item(&mut self, item: P<AssocItem>) -> SmallVec<[P<AssocItem>; 1]> {
match &item.kind {
AssocItemKind::Const(const_item)
if !const_item.generics.params.is_empty()
|| !const_item.generics.where_clause.predicates.is_empty() =>
{
SmallVec::from([item])
}
_ => noop_flat_map_item(item, self),
_ => walk_flat_map_item(self, item),
}
}

Expand Down

0 comments on commit 4f30613

Please sign in to comment.