-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #125326 - weiznich:move/do_not_recommend_to_diganostic_…
…namespace, r=compiler-errors Move `#[do_not_recommend]` to the `#[diagnostic]` namespace This commit moves the `#[do_not_recommend]` attribute to the `#[diagnostic]` namespace. It still requires `#![feature(do_not_recommend)]` to work. r? `@compiler-errors`
- Loading branch information
Showing
22 changed files
with
228 additions
and
209 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
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
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
14 changes: 5 additions & 9 deletions
14
...ecommend/feature-gate-do_not_recommend.rs → ...ecommend/feature-gate-do_not_recommend.rs
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
4 changes: 2 additions & 2 deletions
4
...mend/feature-gate-do_not_recommend.stderr → ...mend/feature-gate-do_not_recommend.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
39 changes: 39 additions & 0 deletions
39
tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.rs
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,39 @@ | ||
//@ check-pass | ||
#![feature(do_not_recommend)] | ||
|
||
#[diagnostic::do_not_recommend] | ||
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed | ||
const CONST: () = (); | ||
|
||
#[diagnostic::do_not_recommend] | ||
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed | ||
static STATIC: () = (); | ||
|
||
#[diagnostic::do_not_recommend] | ||
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed | ||
type Type = (); | ||
|
||
#[diagnostic::do_not_recommend] | ||
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed | ||
enum Enum {} | ||
|
||
#[diagnostic::do_not_recommend] | ||
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed | ||
extern "C" {} | ||
|
||
#[diagnostic::do_not_recommend] | ||
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed | ||
fn fun() {} | ||
|
||
#[diagnostic::do_not_recommend] | ||
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed | ||
struct Struct {} | ||
|
||
#[diagnostic::do_not_recommend] | ||
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed | ||
trait Trait {} | ||
|
||
#[diagnostic::do_not_recommend] | ||
impl Trait for i32 {} | ||
|
||
fn main() {} |
Oops, something went wrong.