Skip to content

Commit 0ece171

Browse files
committedOct 4, 2023
Remove E0551.
Because it's the same as E0539. Fixes #51489.
1 parent 81136cb commit 0ece171

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed
 

‎compiler/rustc_attr/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ pub fn find_deprecation(
846846
),
847847
);
848848
} else {
849-
sess.emit_err(session_diagnostics::IncorrectMetaItem2 {
849+
sess.emit_err(session_diagnostics::IncorrectMetaItem {
850850
span: meta.span,
851851
});
852852
}

‎compiler/rustc_attr/src/session_diagnostics.rs

-9
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,6 @@ pub(crate) struct MissingIssue {
165165
pub span: Span,
166166
}
167167

168-
// FIXME: This diagnostic is identical to `IncorrectMetaItem`, barring the error code. Consider
169-
// changing this to `IncorrectMetaItem`. See #51489.
170-
#[derive(Diagnostic)]
171-
#[diag(attr_incorrect_meta_item, code = "E0551")]
172-
pub(crate) struct IncorrectMetaItem2 {
173-
#[primary_span]
174-
pub span: Span,
175-
}
176-
177168
// FIXME: Why is this the same error code as `InvalidReprHintNoParen` and `InvalidReprHintNoValue`?
178169
// It is more similar to `IncorrectReprFormatGeneric`.
179170
#[derive(Diagnostic)]

‎compiler/rustc_error_codes/src/error_codes/E0551.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
#### Note: this error code is no longer emitted by the compiler
2+
13
An invalid meta-item was used inside an attribute.
24

35
Erroneous code example:
46

5-
```compile_fail,E0551
7+
```compile_fail,E0539
68
#[deprecated(note)] // error!
79
fn i_am_deprecated() {}
810
```

‎tests/ui/deprecation/deprecation-sanity.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ error[E0541]: unknown meta item 'reason'
1616
LL | #[deprecated(since = "a", note = "a", reason)]
1717
| ^^^^^^ expected one of `since`, `note`
1818

19-
error[E0551]: incorrect meta item
19+
error[E0539]: incorrect meta item
2020
--> $DIR/deprecation-sanity.rs:7:31
2121
|
2222
LL | #[deprecated(since = "a", note)]
2323
| ^^^^
2424

25-
error[E0551]: incorrect meta item
25+
error[E0539]: incorrect meta item
2626
--> $DIR/deprecation-sanity.rs:10:18
2727
|
2828
LL | #[deprecated(since, note = "a")]
2929
| ^^^^^
3030

31-
error[E0551]: incorrect meta item
31+
error[E0539]: incorrect meta item
3232
--> $DIR/deprecation-sanity.rs:13:31
3333
|
3434
LL | #[deprecated(since = "a", note(b))]
3535
| ^^^^^^^
3636

37-
error[E0551]: incorrect meta item
37+
error[E0539]: incorrect meta item
3838
--> $DIR/deprecation-sanity.rs:16:18
3939
|
4040
LL | #[deprecated(since(b), note = "a")]
@@ -70,5 +70,5 @@ LL | #[deprecated = "hello"]
7070

7171
error: aborting due to 10 previous errors
7272

73-
Some errors have detailed explanations: E0538, E0541, E0551, E0565.
73+
Some errors have detailed explanations: E0538, E0539, E0541, E0565.
7474
For more information about an error, try `rustc --explain E0538`.

0 commit comments

Comments
 (0)