-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This checks that incorrect params on function parameters are caught | ||
|
||
fn function(#[inline] param: u32) { | ||
//~^ ERROR attribute should be applied to function or closure | ||
//~| ERROR allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes | ||
} | ||
|
||
fn main() {} |
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,17 @@ | ||
error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters | ||
--> $DIR/attrs-on-params.rs:3:13 | ||
| | ||
LL | fn function(#[inline] param: u32) { | ||
| ^^^^^^^^^ | ||
|
||
error[E0518]: attribute should be applied to function or closure | ||
--> $DIR/attrs-on-params.rs:3:13 | ||
| | ||
LL | fn function(#[inline] param: u32) { | ||
| ^^^^^^^^^----------- | ||
| | | ||
| not a function or closure | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0518`. |