From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/syn/tests/test_precedence.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'vendor/syn/tests/test_precedence.rs') 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) -> Option> { }; 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) -> Option> { } fn noop_visit_expr(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) -> Option> { } 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) -> Option> { // 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) { - let _ = pat; + _ = pat; } fn visit_ty(&mut self, ty: &mut P) { - 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 { use syn::fold::Fold; use syn::punctuated::Punctuated; - use syn::{token, Expr, ExprTuple, Path}; + use syn::{token, ConstParam, Expr, ExprTuple, Path}; struct CollectExprs(Vec); impl Fold for CollectExprs { @@ -447,6 +448,10 @@ fn collect_exprs(file: syn::File) -> Vec { // 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![]); -- cgit v1.2.3