mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2024-11-23 16:00:10 +00:00
Remove FnArg::Ignored variant
This commit is contained in:
parent
375a3bf324
commit
9b98fcec15
@ -1584,7 +1584,6 @@ pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
|
||||
FnArg::SelfValue(_binding_0) => FnArg::SelfValue(_visitor.fold_arg_self(_binding_0)),
|
||||
FnArg::Captured(_binding_0) => FnArg::Captured(_visitor.fold_arg_captured(_binding_0)),
|
||||
FnArg::Inferred(_binding_0) => FnArg::Inferred(_visitor.fold_pat(_binding_0)),
|
||||
FnArg::Ignored(_binding_0) => FnArg::Ignored(_visitor.fold_type(_binding_0)),
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "full")]
|
||||
|
@ -1767,9 +1767,6 @@ pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast F
|
||||
FnArg::Inferred(ref _binding_0) => {
|
||||
_visitor.visit_pat(_binding_0);
|
||||
}
|
||||
FnArg::Ignored(ref _binding_0) => {
|
||||
_visitor.visit_type(_binding_0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "full")]
|
||||
|
@ -1743,9 +1743,6 @@ pub fn visit_fn_arg_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut FnArg)
|
||||
FnArg::Inferred(ref mut _binding_0) => {
|
||||
_visitor.visit_pat_mut(_binding_0);
|
||||
}
|
||||
FnArg::Ignored(ref mut _binding_0) => {
|
||||
_visitor.visit_type_mut(_binding_0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "full")]
|
||||
|
15
src/item.rs
15
src/item.rs
@ -769,8 +769,6 @@ ast_enum_of_structs! {
|
||||
|
||||
/// A pattern whose type is inferred captured by a function signature.
|
||||
pub Inferred(Pat),
|
||||
/// A type not bound to any pattern in a function signature.
|
||||
pub Ignored(Type),
|
||||
}
|
||||
}
|
||||
|
||||
@ -1200,18 +1198,7 @@ pub mod parsing {
|
||||
}
|
||||
}
|
||||
|
||||
let ahead = input.fork();
|
||||
let err = match ahead.call(arg_captured) {
|
||||
Ok(_) => return input.call(arg_captured).map(FnArg::Captured),
|
||||
Err(err) => err,
|
||||
};
|
||||
|
||||
let ahead = input.fork();
|
||||
if ahead.parse::<Type>().is_ok() {
|
||||
return input.parse().map(FnArg::Ignored);
|
||||
}
|
||||
|
||||
Err(err)
|
||||
input.call(arg_captured).map(FnArg::Captured)
|
||||
}
|
||||
}
|
||||
|
||||
|
5
syn.json
5
syn.json
@ -2189,11 +2189,6 @@
|
||||
{
|
||||
"syn": "Pat"
|
||||
}
|
||||
],
|
||||
"Ignored": [
|
||||
{
|
||||
"syn": "Type"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -2164,13 +2164,6 @@ impl Debug for Lite<syn::FnArg> {
|
||||
formatter.write_str(")")?;
|
||||
Ok(())
|
||||
}
|
||||
syn::FnArg::Ignored(_val) => {
|
||||
formatter.write_str("Ignored")?;
|
||||
formatter.write_str("(")?;
|
||||
Debug::fmt(Lite(_val), formatter)?;
|
||||
formatter.write_str(")")?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,11 @@ pub fn base_dir_filter(entry: &DirEntry) -> bool {
|
||||
"tests/rust/src/librustc_codegen_llvm/lib.rs" |
|
||||
// Deprecated placement syntax
|
||||
"tests/rust/src/test/ui/obsolete-in-place/bad.rs" |
|
||||
// Deprecated anonymous parameter syntax in traits
|
||||
"tests/rust/src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs" |
|
||||
"tests/rust/src/test/ui/issues/issue-13105.rs" |
|
||||
"tests/rust/src/test/ui/issues/issue-13775.rs" |
|
||||
"tests/rust/src/test/ui/issues/issue-34074.rs" |
|
||||
// 2015-style dyn that libsyntax rejects
|
||||
"tests/rust/src/test/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs" |
|
||||
// not actually test cases
|
||||
|
Loading…
Reference in New Issue
Block a user