File tree 6 files changed +18
-19
lines changed
rustc_error_codes/src/error_codes
6 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Erroneous code example:
6
6
#![feature(staged_api)]
7
7
#![stable(since = "1.0.0", feature = "test")]
8
8
9
- #[rustc_deprecated(reason )] // error!
9
+ #[deprecated(note )] // error!
10
10
#[unstable(feature = "deprecated_fn", issue = "123")]
11
11
fn deprecated() {}
12
12
@@ -30,7 +30,7 @@ To fix these issues you need to give required key-value pairs.
30
30
#![feature(staged_api)]
31
31
#![stable(since = "1.0.0", feature = "test")]
32
32
33
- #[rustc_deprecated (since = "1.39.0", reason = "reason")] // ok!
33
+ #[deprecated (since = "1.39.0", note = "reason")] // ok!
34
34
#[unstable(feature = "deprecated_fn", issue = "123")]
35
35
fn deprecated() {}
36
36
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ fn _stable_fn() {}
13
13
const fn _stable_const_fn() {}
14
14
15
15
#[stable(feature = "_deprecated_fn", since = "0.1.0")]
16
- #[rustc_deprecated (
17
- reason = "explanation for deprecation"
16
+ #[deprecated (
17
+ note = "explanation for deprecation"
18
18
)] // invalid
19
19
fn _deprecated_fn() {}
20
20
```
@@ -32,9 +32,9 @@ fn _stable_fn() {}
32
32
const fn _stable_const_fn() {}
33
33
34
34
#[stable(feature = "_deprecated_fn", since = "0.1.0")]
35
- #[rustc_deprecated (
35
+ #[deprecated (
36
36
since = "1.0.0",
37
- reason = "explanation for deprecation"
37
+ note = "explanation for deprecation"
38
38
)] // ok!
39
39
fn _deprecated_fn() {}
40
40
```
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.
2
2
3
3
Erroneous code example:
4
4
@@ -7,22 +7,22 @@ Erroneous code example:
7
7
#![stable(since = "1.0.0", feature = "test")]
8
8
9
9
#[stable(since = "0.1.0", feature = "_deprecated_fn")]
10
- #[rustc_deprecated (
10
+ #[deprecated (
11
11
since = "1.0.0"
12
12
)] // invalid
13
13
fn _deprecated_fn() {}
14
14
```
15
15
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:
17
17
18
18
```
19
19
#![feature(staged_api)]
20
20
#![stable(since = "1.0.0", feature = "test")]
21
21
22
22
#[stable(since = "0.1.0", feature = "_deprecated_fn")]
23
- #[rustc_deprecated (
23
+ #[deprecated (
24
24
since = "1.0.0",
25
- reason = "explanation for deprecation"
25
+ note = "explanation for deprecation"
26
26
)] // ok!
27
27
fn _deprecated_fn() {}
28
28
```
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 .
3
3
4
4
Erroneous code example:
5
5
6
6
``` compile_fail,E0549
7
7
#![feature(staged_api)]
8
8
#![stable(since = "1.0.0", feature = "test")]
9
9
10
- #[rustc_deprecated (
10
+ #[deprecated (
11
11
since = "1.0.1",
12
- reason = "explanation for deprecation"
12
+ note = "explanation for deprecation"
13
13
)] // invalid
14
14
fn _deprecated_fn() {}
15
15
```
@@ -22,9 +22,9 @@ Example:
22
22
#![stable(since = "1.0.0", feature = "test")]
23
23
24
24
#[stable(since = "1.0.0", feature = "test")]
25
- #[rustc_deprecated (
25
+ #[deprecated (
26
26
since = "1.0.1",
27
- reason = "explanation for deprecation"
27
+ note = "explanation for deprecation"
28
28
)] // ok!
29
29
fn _deprecated_fn() {}
30
30
```
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.
3
3
Erroneous code example:
4
4
5
5
``` compile_fail,E0734
6
- #[rustc_deprecated(since = "b", reason = "text")] // invalid
7
6
#[stable(feature = "a", since = "b")] // invalid
8
7
#[unstable(feature = "b", issue = "none")] // invalid
9
8
fn foo(){}
Original file line number Diff line number Diff line change @@ -2206,7 +2206,7 @@ declare_lint! {
2206
2206
/// and then this lint will ensure that the item is no longer used in the
2207
2207
/// standard library. See the [stability documentation] for more details.
2208
2208
///
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
2210
2210
pub DEPRECATED_IN_FUTURE ,
2211
2211
Allow ,
2212
2212
"detects use of items that will be deprecated in a future version" ,
You can’t perform that action at this time.
0 commit comments