Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning for a parameter list with an attribute but no parameters
- Loading branch information
Showing
3 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// run-pass | ||
|
||
fn foo<#[attr]>() {} // ok | ||
fn foo<#[attr]>() {} //~ ERROR attribute without generic parameters | ||
|
||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/attribute-with-no-generics-in-parameter-list.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: attribute without generic parameters | ||
--> $DIR/attribute-with-no-generics-in-parameter-list.rs:1:8 | ||
| | ||
LL | fn foo<#[attr]>() {} //~ ERROR attribute without generic parameters | ||
| ^^^^^^^ attributes are only permitted when preceding parameters | ||
|
||
error: aborting due to previous error | ||
|