Remove FnArg::Ignored variant

This commit is contained in:
David Tolnay 2019-07-28 09:53:03 -07:00
parent 375a3bf324
commit 9b98fcec15
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
7 changed files with 6 additions and 33 deletions

View File

@ -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")]

View File

@ -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")]

View File

@ -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")]

View File

@ -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)
}
}

View File

@ -2189,11 +2189,6 @@
{
"syn": "Pat"
}
],
"Ignored": [
{
"syn": "Type"
}
]
}
},

View File

@ -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(())
}
}
}
}

View File

@ -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