syntax: Parse outer attributes in quote_method!

Fixes #17782.
This commit is contained in:
Ben Gamari 2014-10-06 10:53:05 -04:00
parent c586490715
commit a5a11a8ef0
3 changed files with 10 additions and 7 deletions

View file

@ -4371,6 +4371,13 @@ impl<'a> Parser<'a> {
(ident, ItemFn(decl, fn_style, abi, generics, body), Some(inner_attrs))
}
/// Parse a method in a trait impl
pub fn parse_method_with_outer_attributes(&mut self) -> P<Method> {
let attrs = self.parse_outer_attributes();
let visa = self.parse_visibility();
self.parse_method(attrs, visa)
}
/// Parse a method in a trait impl, starting with `attrs` attributes.
pub fn parse_method(&mut self,
attrs: Vec<Attribute>,