diff options
| author | Ben Gamari <bgamari.foss@gmail.com> | 2014-10-06 10:53:05 -0400 |
|---|---|---|
| committer | Ben Gamari <bgamari.foss@gmail.com> | 2014-10-06 10:53:05 -0400 |
| commit | a5a11a8ef0ac9d66660d93b0db951eae9497705f (patch) | |
| tree | 5f9ff30adb443e6fd9caaa8a2b339d246b9ab43b /src/libsyntax/parse | |
| parent | c586490715a35d3c9dae17de7f8907c2f73168d3 (diff) | |
| download | rust-a5a11a8ef0ac9d66660d93b0db951eae9497705f.tar.gz rust-a5a11a8ef0ac9d66660d93b0db951eae9497705f.zip | |
syntax: Parse outer attributes in quote_method!
Fixes #17782.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 4c877c0b101..e728a0893b3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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>, |
