Skip to content

Commit

Permalink
Skip traversing into const params for precedence test
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 18, 2022
1 parent e3d6e7b commit 15c0075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions tests/repo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ const REVISION: &str = "98ad6a5519651af36e246c0335c964dd52c554ba";

#[rustfmt::skip]
static EXCLUDE_FILES: &[&str] = &[
// TODO: negative literal for const generic parameter default value
"src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0200_const_param_default_literal.rs",

// TODO: associated type of a path with parenthesized generic arguments
"src/tools/rust-analyzer/crates/parser/test_data/parser/inline/ok/0202_typepathfn_with_coloncolon.rs",

Expand Down
6 changes: 5 additions & 1 deletion tests/test_precedence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,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, Path};
use syn::{token, ConstParam, Expr, ExprTuple, Path};

struct CollectExprs(Vec<Expr>);
impl Fold for CollectExprs {
Expand All @@ -448,6 +448,10 @@ fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
// Skip traversing into const generic path arguments
path
}

fn fold_const_param(&mut self, const_param: ConstParam) -> ConstParam {
const_param
}
}

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

0 comments on commit 15c0075

Please sign in to comment.