This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +18
-19
lines changed
rustc_error_codes/src/error_codes Expand file tree Collapse file tree 6 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Erroneous code example:
66#![feature(staged_api)]
77#![stable(since = "1.0.0", feature = "test")]
88
9- #[rustc_deprecated(reason )] // error!
9+ #[deprecated(note )] // error!
1010#[unstable(feature = "deprecated_fn", issue = "123")]
1111fn deprecated() {}
1212
@@ -30,7 +30,7 @@ To fix these issues you need to give required key-value pairs.
3030#![feature(staged_api)]
3131#![stable(since = "1.0.0", feature = "test")]
3232
33- #[rustc_deprecated (since = "1.39.0", reason = "reason")] // ok!
33+ #[deprecated (since = "1.39.0", note = "reason")] // ok!
3434#[unstable(feature = "deprecated_fn", issue = "123")]
3535fn deprecated() {}
3636
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ fn _stable_fn() {}
1313const fn _stable_const_fn() {}
1414
1515#[stable(feature = "_deprecated_fn", since = "0.1.0")]
16- #[rustc_deprecated (
17- reason = "explanation for deprecation"
16+ #[deprecated (
17+ note = "explanation for deprecation"
1818)] // invalid
1919fn _deprecated_fn() {}
2020```
@@ -32,9 +32,9 @@ fn _stable_fn() {}
3232const fn _stable_const_fn() {}
3333
3434#[stable(feature = "_deprecated_fn", since = "0.1.0")]
35- #[rustc_deprecated (
35+ #[deprecated (
3636 since = "1.0.0",
37- reason = "explanation for deprecation"
37+ note = "explanation for deprecation"
3838)] // ok!
3939fn _deprecated_fn() {}
4040```
Original file line number Diff line number Diff line change 1- The ` reason ` value is missing in a stability attribute.
1+ The ` note ` value is missing in a stability attribute.
22
33Erroneous code example:
44
@@ -7,22 +7,22 @@ Erroneous code example:
77#![stable(since = "1.0.0", feature = "test")]
88
99#[stable(since = "0.1.0", feature = "_deprecated_fn")]
10- #[rustc_deprecated (
10+ #[deprecated (
1111 since = "1.0.0"
1212)] // invalid
1313fn _deprecated_fn() {}
1414```
1515
16- To fix this issue, you need to provide the ` reason ` field. Example:
16+ To fix this issue, you need to provide the ` note ` field. Example:
1717
1818```
1919#![feature(staged_api)]
2020#![stable(since = "1.0.0", feature = "test")]
2121
2222#[stable(since = "0.1.0", feature = "_deprecated_fn")]
23- #[rustc_deprecated (
23+ #[deprecated (
2424 since = "1.0.0",
25- reason = "explanation for deprecation"
25+ note = "explanation for deprecation"
2626)] // ok!
2727fn _deprecated_fn() {}
2828```
Original file line number Diff line number Diff line change 1- A ` rustc_deprecated ` attribute wasn't paired with a ` stable ` /` unstable `
2- attribute .
1+ A ` deprecated ` attribute wasn't paired with a ` stable ` /` unstable ` attribute with
2+ ` #![feature(staged_api)] ` enabled .
33
44Erroneous code example:
55
66``` compile_fail,E0549
77#![feature(staged_api)]
88#![stable(since = "1.0.0", feature = "test")]
99
10- #[rustc_deprecated (
10+ #[deprecated (
1111 since = "1.0.1",
12- reason = "explanation for deprecation"
12+ note = "explanation for deprecation"
1313)] // invalid
1414fn _deprecated_fn() {}
1515```
@@ -22,9 +22,9 @@ Example:
2222#![stable(since = "1.0.0", feature = "test")]
2323
2424#[stable(since = "1.0.0", feature = "test")]
25- #[rustc_deprecated (
25+ #[deprecated (
2626 since = "1.0.1",
27- reason = "explanation for deprecation"
27+ note = "explanation for deprecation"
2828)] // ok!
2929fn _deprecated_fn() {}
3030```
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ A stability attribute has been used outside of the standard library.
33Erroneous code example:
44
55``` compile_fail,E0734
6- #[rustc_deprecated(since = "b", reason = "text")] // invalid
76#[stable(feature = "a", since = "b")] // invalid
87#[unstable(feature = "b", issue = "none")] // invalid
98fn foo(){}
Original file line number Diff line number Diff line change @@ -2206,7 +2206,7 @@ declare_lint! {
22062206 /// and then this lint will ensure that the item is no longer used in the
22072207 /// standard library. See the [stability documentation] for more details.
22082208 ///
2209- /// [stability documentation]: https://rustc-dev-guide.rust-lang.org/stability.html#rustc_deprecated
2209+ /// [stability documentation]: https://rustc-dev-guide.rust-lang.org/stability.html#deprecated
22102210 pub DEPRECATED_IN_FUTURE ,
22112211 Allow ,
22122212 "detects use of items that will be deprecated in a future version" ,
You can’t perform that action at this time.
0 commit comments