Skip to content

Commit

Permalink
Skip traversing into const generic path arg in precedence test
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 14, 2022
1 parent aaf9155 commit f73d579
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions tests/repo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ static EXCLUDE: &[&str] = &[
"src/test/ui/generic-associated-types/iterable.rs",
"src/test/ui/generic-associated-types/streaming_iterator.rs",

// TODO: negative literal const generic:
// impl Signed<-152> {…}
"src/test/ui/symbol-names/const-generics-demangling.rs",

// TODO: impl ~const T {}
// https://github.com/dtolnay/syn/issues/1051
"src/test/ui/rfc-2632-const-trait-impl/syntax.rs",
Expand Down
7 changes: 6 additions & 1 deletion tests/test_precedence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr {
fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
use syn::fold::Fold;
use syn::punctuated::Punctuated;
use syn::{token, Expr, ExprTuple};
use syn::{token, Expr, ExprTuple, Path};

struct CollectExprs(Vec<Expr>);
impl Fold for CollectExprs {
Expand All @@ -442,6 +442,11 @@ fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
paren_token: token::Paren::default(),
})
}

fn fold_path(&mut self, path: Path) -> Path {
// Skip traversing into const generic path arguments
path
}
}

let mut folder = CollectExprs(vec![]);
Expand Down

0 comments on commit f73d579

Please sign in to comment.