diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-08 14:04:28 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-08 14:04:28 +0100 |
commit | 87608904f697a3f58ddb71a7f6828dac80f8b3ce (patch) | |
tree | 11907e37146390bd033a9667995a5e8c9d61a9ed /crates/ra_syntax/src/ast | |
parent | de4523fae07a2bf0c058d021bd4cfdb53946c4bf (diff) | |
parent | 6fa2d8214784b6ecfc3fbcd98778d4e58fa8664e (diff) |
Merge #1661
1661: Parse function parameters attributes r=matklad a=eupn
Fixes #1397. The [RFC-2565](https://github.com/rust-lang/rfcs/blob/master/text/2565-formal-function-parameter-attributes.md) specifies `#[attributes]` to function parameters:
```rust
fn foo(#[attr] a, #[unused] b, #[must_use] ...) {
// ...
}
```
This PR adds those attributes into grammar and to the parser, extending corresponding inline tests.
Co-authored-by: Evgenii P <eupn@protonmail.com>
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index da8cf4ae8..f322e1d84 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -2013,6 +2013,7 @@ impl AstNode for Param { | |||
2013 | 2013 | ||
2014 | 2014 | ||
2015 | impl ast::TypeAscriptionOwner for Param {} | 2015 | impl ast::TypeAscriptionOwner for Param {} |
2016 | impl ast::AttrsOwner for Param {} | ||
2016 | impl Param { | 2017 | impl Param { |
2017 | pub fn pat(&self) -> Option<Pat> { | 2018 | pub fn pat(&self) -> Option<Pat> { |
2018 | super::child_opt(self) | 2019 | super::child_opt(self) |
@@ -2667,6 +2668,7 @@ impl AstNode for SelfParam { | |||
2667 | 2668 | ||
2668 | 2669 | ||
2669 | impl ast::TypeAscriptionOwner for SelfParam {} | 2670 | impl ast::TypeAscriptionOwner for SelfParam {} |
2671 | impl ast::AttrsOwner for SelfParam {} | ||
2670 | impl SelfParam {} | 2672 | impl SelfParam {} |
2671 | 2673 | ||
2672 | // SlicePat | 2674 | // SlicePat |