-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
7 changed files
with
121 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#![feature(do_not_recommend)] | ||
|
||
#[do_not_recommend] | ||
//~^ `#[do_not_recommend]` can only be placed | ||
const CONST: () = (); | ||
|
||
#[do_not_recommend] | ||
//~^ `#[do_not_recommend]` can only be placed | ||
static Static: () = (); | ||
|
||
#[do_not_recommend] | ||
//~^ `#[do_not_recommend]` can only be placed | ||
type Type = (); | ||
|
||
#[do_not_recommend] | ||
//~^ `#[do_not_recommend]` can only be placed | ||
enum Enum { | ||
} | ||
|
||
#[do_not_recommend] | ||
//~^ `#[do_not_recommend]` can only be placed | ||
extern { | ||
} | ||
|
||
#[do_not_recommend] | ||
//~^ `#[do_not_recommend]` can only be placed | ||
fn fun() { | ||
} | ||
|
||
#[do_not_recommend] | ||
//~^ `#[do_not_recommend]` can only be placed | ||
struct Struct { | ||
} | ||
|
||
#[do_not_recommend] | ||
//~^ `#[do_not_recommend]` can only be placed | ||
trait Trait { | ||
} | ||
|
||
#[do_not_recommend] | ||
impl Trait for i32 { | ||
} | ||
|
||
fn main() { | ||
} |
50 changes: 50 additions & 0 deletions
50
tests/ui/rfc-2397-do-not-recommend/incorrect-locations.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,50 @@ | ||
error: `#[do_not_recommend]` can only be placed on trait implementations | ||
--> $DIR/incorrect-locations.rs:3:1 | ||
| | ||
LL | #[do_not_recommend] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[do_not_recommend]` can only be placed on trait implementations | ||
--> $DIR/incorrect-locations.rs:7:1 | ||
| | ||
LL | #[do_not_recommend] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[do_not_recommend]` can only be placed on trait implementations | ||
--> $DIR/incorrect-locations.rs:11:1 | ||
| | ||
LL | #[do_not_recommend] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[do_not_recommend]` can only be placed on trait implementations | ||
--> $DIR/incorrect-locations.rs:15:1 | ||
| | ||
LL | #[do_not_recommend] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[do_not_recommend]` can only be placed on trait implementations | ||
--> $DIR/incorrect-locations.rs:20:1 | ||
| | ||
LL | #[do_not_recommend] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[do_not_recommend]` can only be placed on trait implementations | ||
--> $DIR/incorrect-locations.rs:25:1 | ||
| | ||
LL | #[do_not_recommend] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[do_not_recommend]` can only be placed on trait implementations | ||
--> $DIR/incorrect-locations.rs:30:1 | ||
| | ||
LL | #[do_not_recommend] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[do_not_recommend]` can only be placed on trait implementations | ||
--> $DIR/incorrect-locations.rs:35:1 | ||
| | ||
LL | #[do_not_recommend] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 8 previous errors | ||
|
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