Skip to content

Commit bfdf234

Browse files
committed
Update error code docs
1 parent e46f8b2 commit bfdf234

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

compiler/rustc_error_codes/src/error_codes/E0539.md

+2-2
Original file line numberDiff line numberDiff 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")]
1111
fn 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")]
3535
fn deprecated() {}
3636

compiler/rustc_error_codes/src/error_codes/E0542.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ fn _stable_fn() {}
1313
const 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
1919
fn _deprecated_fn() {}
2020
```
@@ -32,9 +32,9 @@ fn _stable_fn() {}
3232
const 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!
3939
fn _deprecated_fn() {}
4040
```

compiler/rustc_error_codes/src/error_codes/E0543.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The `reason` value is missing in a stability attribute.
1+
The `note` value is missing in a stability attribute.
22

33
Erroneous 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
1313
fn _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!
2727
fn _deprecated_fn() {}
2828
```

compiler/rustc_error_codes/src/error_codes/E0549.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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

44
Erroneous 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
1414
fn _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!
2929
fn _deprecated_fn() {}
3030
```

compiler/rustc_error_codes/src/error_codes/E0734.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ A stability attribute has been used outside of the standard library.
33
Erroneous 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
98
fn foo(){}

compiler/rustc_lint_defs/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff 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",

0 commit comments

Comments
 (0)