Skip to content

Conversation

eupn
Copy link
Contributor

@eupn eupn commented Aug 7, 2019

Fixes #1397. The RFC-2565 specifies #[attributes] to function parameters:

fn foo(#[attr] a, #[unused] b, #[must_use] ...) {
    // ...
}

This PR adds those attributes into grammar and to the parser, extending corresponding inline tests.

Copy link
Contributor

@matklad matklad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@matklad
Copy link
Contributor

matklad commented Aug 8, 2019

bros r+

Thanks!

@bors
Copy link
Contributor

bors bot commented Aug 8, 2019

👊

@matklad
Copy link
Contributor

matklad commented Aug 8, 2019

bors r+

bors bot added a commit that referenced this pull request Aug 8, 2019
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 <[email protected]>
@bors
Copy link
Contributor

bors bot commented Aug 8, 2019

Build succeeded

@bors bors bot merged commit 6fa2d82 into rust-lang:master Aug 8, 2019
@eupn eupn deleted the add-fn-param-attrs branch August 8, 2019 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for attributes in function parameters
2 participants