Port #[rustc_skip_during_method_dispatch] to the new attribute system
This commit is contained in:
@@ -169,9 +169,15 @@ impl<'a> ArgParser<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Asserts that there are no arguments
|
||||
pub fn no_args(&self) -> bool {
|
||||
matches!(self, Self::NoArgs)
|
||||
/// Assert that there were no args.
|
||||
/// If there were, get a span to the arguments
|
||||
/// (to pass to [`AcceptContext::expected_no_args`](crate::context::AcceptContext::expected_no_args)).
|
||||
pub fn no_args(&self) -> Result<(), Span> {
|
||||
match self {
|
||||
Self::NoArgs => Ok(()),
|
||||
Self::List(args) => Err(args.span),
|
||||
Self::NameValue(args) => Err(args.eq_span.to(args.value_span)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user