Skip to content

Commit f306362

Browse files
committed
Auto merge of #116413 - nnethercote:rm-E0551, r=compiler-errors
Remove E0551 Because it's the same as E0539. Fixes #51489. r? `@Nilstrieb`
2 parents 2ffeb46 + 0ece171 commit f306362

File tree

5 files changed

+14
-21
lines changed

5 files changed

+14
-21
lines changed

compiler/rustc_attr/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ edition = "2021"
66
[lib]
77

88
[dependencies]
9+
rustc_ast = { path = "../rustc_ast" }
910
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
10-
rustc_serialize = { path = "../rustc_serialize" }
11-
rustc_errors = { path = "../rustc_errors" }
12-
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
13-
rustc_span = { path = "../rustc_span" }
1411
rustc_data_structures = { path = "../rustc_data_structures" }
12+
rustc_errors = { path = "../rustc_errors" }
1513
rustc_feature = { path = "../rustc_feature" }
14+
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
1615
rustc_lexer = { path = "../rustc_lexer" }
1716
rustc_macros = { path = "../rustc_macros" }
17+
rustc_serialize = { path = "../rustc_serialize" }
1818
rustc_session = { path = "../rustc_session" }
19-
rustc_ast = { path = "../rustc_ast" }
19+
rustc_span = { path = "../rustc_span" }

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)