diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:13:23 +0000 |
commit | 20431706a863f92cb37dc512fef6e48d192aaf2c (patch) | |
tree | 2867f13f5fd5437ba628c67d7f87309ccadcd286 /vendor/syn/tests/test_precedence.rs | |
parent | Releasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/syn/tests/test_precedence.rs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/vendor/syn/tests/test_precedence.rs b/vendor/syn/tests/test_precedence.rs index bd273a565..dbcd74f16 100644 --- a/vendor/syn/tests/test_precedence.rs +++ b/vendor/syn/tests/test_precedence.rs @@ -24,6 +24,7 @@ extern crate rustc_ast; extern crate rustc_data_structures; extern crate rustc_span; +extern crate thin_vec; use crate::common::eq::SpanlessEq; use crate::common::parse; @@ -207,10 +208,10 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> { }; use rustc_ast::mut_visit::{noop_visit_generic_arg, noop_visit_local, MutVisitor}; use rustc_data_structures::map_in_place::MapInPlace; - use rustc_data_structures::thin_vec::ThinVec; use rustc_span::DUMMY_SP; use std::mem; use std::ops::DerefMut; + use thin_vec::ThinVec; struct BracketsVisitor { failed: bool, @@ -243,7 +244,7 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> { } fn noop_visit_expr<T: MutVisitor>(e: &mut Expr, vis: &mut T) { - use rustc_ast::mut_visit::{noop_visit_expr, visit_thin_attrs}; + use rustc_ast::mut_visit::{noop_visit_expr, visit_attrs}; match &mut e.kind { ExprKind::AddrOf(BorrowKind::Raw, ..) => {} ExprKind::Struct(expr) => { @@ -261,7 +262,7 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> { } vis.visit_id(&mut e.id); vis.visit_span(&mut e.span); - visit_thin_attrs(&mut e.attrs, vis); + visit_attrs(&mut e.attrs, vis); } _ => noop_visit_expr(e, vis), } @@ -322,15 +323,15 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> { // types yet. We'll look into comparing those in the future. For now // focus on expressions appearing in other places. fn visit_pat(&mut self, pat: &mut P<Pat>) { - let _ = pat; + _ = pat; } fn visit_ty(&mut self, ty: &mut P<Ty>) { - let _ = ty; + _ = ty; } fn visit_attribute(&mut self, attr: &mut Attribute) { - let _ = attr; + _ = attr; } } @@ -426,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 { @@ -447,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![]); |