diff options
| author | bors <bors@rust-lang.org> | 2022-05-09 04:47:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-09 04:47:30 +0000 |
| commit | 8a2fe75d0e6e024aa434e5b9c40adb2567f362b8 (patch) | |
| tree | efdc8580272e7994c4de5ab04f16cc3087e73c64 /compiler/rustc_error_codes/src | |
| parent | db5b365fb0e7aa5f59d80236f520f5afc6e39ff4 (diff) | |
| parent | dac487ae2bf9f0d51b7462e9d311d67f46048643 (diff) | |
| download | rust-8a2fe75d0e6e024aa434e5b9c40adb2567f362b8.tar.gz rust-8a2fe75d0e6e024aa434e5b9c40adb2567f362b8.zip | |
Auto merge of #95960 - jhpratt:remove-rustc_deprecated, r=compiler-errors
Remove `#[rustc_deprecated]` This removes `#[rustc_deprecated]` and introduces diagnostics to help users to the right direction (that being `#[deprecated]`). All uses of `#[rustc_deprecated]` have been converted. CI is expected to fail initially; this requires #95958, which includes converting `stdarch`. I plan on following up in a short while (maybe a bootstrap cycle?) removing the diagnostics, as they're only intended to be short-term.
Diffstat (limited to 'compiler/rustc_error_codes/src')
6 files changed, 20 insertions, 19 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0539.md b/compiler/rustc_error_codes/src/error_codes/E0539.md index df2d7d910bb..c53d60a5f47 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0539.md +++ b/compiler/rustc_error_codes/src/error_codes/E0539.md @@ -6,7 +6,7 @@ Erroneous code example: #![feature(staged_api)] #![stable(since = "1.0.0", feature = "test")] -#[rustc_deprecated(reason)] // error! +#[deprecated(note)] // error! #[unstable(feature = "deprecated_fn", issue = "123")] fn deprecated() {} @@ -30,7 +30,7 @@ To fix these issues you need to give required key-value pairs. #![feature(staged_api)] #![stable(since = "1.0.0", feature = "test")] -#[rustc_deprecated(since = "1.39.0", reason = "reason")] // ok! +#[deprecated(since = "1.39.0", note = "reason")] // ok! #[unstable(feature = "deprecated_fn", issue = "123")] fn deprecated() {} diff --git a/compiler/rustc_error_codes/src/error_codes/E0542.md b/compiler/rustc_error_codes/src/error_codes/E0542.md index 7fecfeaa57c..c69e574179b 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0542.md +++ b/compiler/rustc_error_codes/src/error_codes/E0542.md @@ -13,8 +13,8 @@ fn _stable_fn() {} const fn _stable_const_fn() {} #[stable(feature = "_deprecated_fn", since = "0.1.0")] -#[rustc_deprecated( - reason = "explanation for deprecation" +#[deprecated( + note = "explanation for deprecation" )] // invalid fn _deprecated_fn() {} ``` @@ -32,9 +32,9 @@ fn _stable_fn() {} const fn _stable_const_fn() {} #[stable(feature = "_deprecated_fn", since = "0.1.0")] -#[rustc_deprecated( +#[deprecated( since = "1.0.0", - reason = "explanation for deprecation" + note = "explanation for deprecation" )] // ok! fn _deprecated_fn() {} ``` diff --git a/compiler/rustc_error_codes/src/error_codes/E0543.md b/compiler/rustc_error_codes/src/error_codes/E0543.md index ba26f92e89f..d0b2e2f7a7d 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0543.md +++ b/compiler/rustc_error_codes/src/error_codes/E0543.md @@ -1,4 +1,4 @@ -The `reason` value is missing in a stability attribute. +The `note` value is missing in a stability attribute. Erroneous code example: @@ -7,22 +7,22 @@ Erroneous code example: #![stable(since = "1.0.0", feature = "test")] #[stable(since = "0.1.0", feature = "_deprecated_fn")] -#[rustc_deprecated( +#[deprecated( since = "1.0.0" )] // invalid fn _deprecated_fn() {} ``` -To fix this issue, you need to provide the `reason` field. Example: +To fix this issue, you need to provide the `note` field. Example: ``` #![feature(staged_api)] #![stable(since = "1.0.0", feature = "test")] #[stable(since = "0.1.0", feature = "_deprecated_fn")] -#[rustc_deprecated( +#[deprecated( since = "1.0.0", - reason = "explanation for deprecation" + note = "explanation for deprecation" )] // ok! fn _deprecated_fn() {} ``` diff --git a/compiler/rustc_error_codes/src/error_codes/E0549.md b/compiler/rustc_error_codes/src/error_codes/E0549.md index d4b78e7e0d6..70e458a9867 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0549.md +++ b/compiler/rustc_error_codes/src/error_codes/E0549.md @@ -1,5 +1,5 @@ -A `rustc_deprecated` attribute wasn't paired with a `stable`/`unstable` -attribute. +A `deprecated` attribute wasn't paired with a `stable`/`unstable` attribute with +`#![feature(staged_api)]` enabled. Erroneous code example: @@ -7,9 +7,9 @@ Erroneous code example: #![feature(staged_api)] #![stable(since = "1.0.0", feature = "test")] -#[rustc_deprecated( +#[deprecated( since = "1.0.1", - reason = "explanation for deprecation" + note = "explanation for deprecation" )] // invalid fn _deprecated_fn() {} ``` @@ -22,9 +22,9 @@ Example: #![stable(since = "1.0.0", feature = "test")] #[stable(since = "1.0.0", feature = "test")] -#[rustc_deprecated( +#[deprecated( since = "1.0.1", - reason = "explanation for deprecation" + note = "explanation for deprecation" )] // ok! fn _deprecated_fn() {} ``` diff --git a/compiler/rustc_error_codes/src/error_codes/E0550.md b/compiler/rustc_error_codes/src/error_codes/E0550.md index 1487d701847..6aac5c969d2 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0550.md +++ b/compiler/rustc_error_codes/src/error_codes/E0550.md @@ -1,8 +1,10 @@ +#### Note: this error code is no longer emitted by the compiler + More than one `deprecated` attribute has been put on an item. Erroneous code example: -```compile_fail,E0550 +```compile_fail #[deprecated(note = "because why not?")] #[deprecated(note = "right?")] // error! fn the_banished() {} diff --git a/compiler/rustc_error_codes/src/error_codes/E0734.md b/compiler/rustc_error_codes/src/error_codes/E0734.md index 4b8e89a7060..b912061ec42 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0734.md +++ b/compiler/rustc_error_codes/src/error_codes/E0734.md @@ -3,7 +3,6 @@ A stability attribute has been used outside of the standard library. Erroneous code example: ```compile_fail,E0734 -#[rustc_deprecated(since = "b", reason = "text")] // invalid #[stable(feature = "a", since = "b")] // invalid #[unstable(feature = "b", issue = "none")] // invalid fn foo(){} |
