11error: `#[derive(SessionDiagnostic)]` can only be used on structs
22 --> $DIR/session-derive-errors.rs:28:1
33 |
4- LL | #[error = "E0123"]
5- | ^
4+ LL | / #[error = "E0123"]
5+ LL | |
6+ LL | | enum SessionDiagnosticOnEnum {
7+ LL | | Foo,
8+ LL | | Bar,
9+ LL | | }
10+ | |_^
611
712error: `#[label = ...]` is not a valid SessionDiagnostic struct attribute
813 --> $DIR/session-derive-errors.rs:37:1
914 |
1015LL | #[label = "This is in the wrong place"]
11- | ^
16+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1217
1318error: `#[suggestion = ...]` is not a valid SessionDiagnostic field attribute
1419 --> $DIR/session-derive-errors.rs:44:5
1520 |
1621LL | #[suggestion = "this is the wrong kind of attribute"]
17- | ^
22+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1823
1924error: `error` specified multiple times
2025 --> $DIR/session-derive-errors.rs:52:11
@@ -32,21 +37,21 @@ error: `code` not specified
3237 --> $DIR/session-derive-errors.rs:67:1
3338 |
3439LL | struct ErrorCodeNotProvided {}
35- | ^^^^^^
40+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3641 |
3742 = help: use the [code = "..."] attribute to set this diagnostic's error code
3843
3944error: the `#[message = "..."]` attribute can only be applied to fields of type Span
4045 --> $DIR/session-derive-errors.rs:95:5
4146 |
4247LL | #[message = "this message is applied to a String field"]
43- | ^
48+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4449
4550error: `name` doesn't refer to a field on this type
4651 --> $DIR/session-derive-errors.rs:102:1
4752 |
4853LL | #[message = "This error has a field, and references {name}"]
49- | ^
54+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5055
5156error: invalid format string: expected `'}'` but string was terminated
5257 --> $DIR/session-derive-errors.rs:110:1
@@ -72,53 +77,59 @@ error: The `#[label = ...]` attribute can only be applied to fields of type Span
7277 --> $DIR/session-derive-errors.rs:138:5
7378 |
7479LL | #[label = "See here"]
75- | ^
80+ | ^^^^^^^^^^^^^^^^^^^^^
7681
7782error: `nonsense` is not a valid key for `#[suggestion(...)]`
7883 --> $DIR/session-derive-errors.rs:163:18
7984 |
8085LL | #[suggestion(nonsense = "This is nonsense")]
81- | ^^^^^^^^
86+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8287
8388error: `msg` is not a valid key for `#[suggestion(...)]`
8489 --> $DIR/session-derive-errors.rs:171:18
8590 |
8691LL | #[suggestion(msg = "This is a suggestion")]
87- | ^^^
92+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8893
8994error: missing suggestion message
9095 --> $DIR/session-derive-errors.rs:179:7
9196 |
9297LL | #[suggestion(code = "This is suggested code")]
93- | ^^^^^^^^^^
98+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9499 |
95100 = help: provide a suggestion message using #[suggestion(message = "...")]
96101
97102error: wrong field type for suggestion
98103 --> $DIR/session-derive-errors.rs:194:5
99104 |
100- LL | #[suggestion(message = "This is a message", code = "This is suggested code")]
101- | ^
105+ LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
106+ LL | |
107+ LL | | suggestion: Applicability,
108+ | |_____________________________^
102109 |
103110 = help: #[suggestion(...)] should be applied to fields of type Span or (Span, Applicability)
104111
105112error: type of field annotated with `#[suggestion(...)]` contains more than one Span
106113 --> $DIR/session-derive-errors.rs:209:5
107114 |
108- LL | #[suggestion(message = "This is a message", code = "This is suggested code")]
109- | ^
115+ LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
116+ LL | |
117+ LL | | suggestion: (Span, Span, Applicability),
118+ | |___________________________________________^
110119
111120error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
112121 --> $DIR/session-derive-errors.rs:217:5
113122 |
114- LL | #[suggestion(message = "This is a message", code = "This is suggested code")]
115- | ^
123+ LL | / #[suggestion(message = "This is a message", code = "This is suggested code")]
124+ LL | |
125+ LL | | suggestion: (Applicability, Applicability, Span),
126+ | |____________________________________________________^
116127
117128error: invalid annotation list `#[label(...)]`
118129 --> $DIR/session-derive-errors.rs:225:7
119130 |
120131LL | #[label("wrong kind of annotation for label")]
121- | ^^^^^
132+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122133
123134error: aborting due to 18 previous errors
124135
0 commit comments