1
1
error: `#[derive(SessionDiagnostic)]` can only be used on structs
2
2
--> $DIR/session-derive-errors.rs:28:1
3
3
|
4
- LL | #[error = "E0123"]
5
- | ^
4
+ LL | / #[error = "E0123"]
5
+ LL | |
6
+ LL | | enum SessionDiagnosticOnEnum {
7
+ LL | | Foo,
8
+ LL | | Bar,
9
+ LL | | }
10
+ | |_^
6
11
7
12
error: `#[label = ...]` is not a valid SessionDiagnostic struct attribute
8
13
--> $DIR/session-derive-errors.rs:37:1
9
14
|
10
15
LL | #[label = "This is in the wrong place"]
11
- | ^
16
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
17
13
18
error: `#[suggestion = ...]` is not a valid SessionDiagnostic field attribute
14
19
--> $DIR/session-derive-errors.rs:44:5
15
20
|
16
21
LL | #[suggestion = "this is the wrong kind of attribute"]
17
- | ^
22
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
23
19
24
error: `error` specified multiple times
20
25
--> $DIR/session-derive-errors.rs:52:11
@@ -32,21 +37,21 @@ error: `code` not specified
32
37
--> $DIR/session-derive-errors.rs:67:1
33
38
|
34
39
LL | struct ErrorCodeNotProvided {}
35
- | ^^^^^^
40
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36
41
|
37
42
= help: use the [code = "..."] attribute to set this diagnostic's error code
38
43
39
44
error: the `#[message = "..."]` attribute can only be applied to fields of type Span
40
45
--> $DIR/session-derive-errors.rs:95:5
41
46
|
42
47
LL | #[message = "this message is applied to a String field"]
43
- | ^
48
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
49
45
50
error: `name` doesn't refer to a field on this type
46
51
--> $DIR/session-derive-errors.rs:102:1
47
52
|
48
53
LL | #[message = "This error has a field, and references {name}"]
49
- | ^
54
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
55
51
56
error: invalid format string: expected `'}'` but string was terminated
52
57
--> $DIR/session-derive-errors.rs:110:1
@@ -72,53 +77,59 @@ error: The `#[label = ...]` attribute can only be applied to fields of type Span
72
77
--> $DIR/session-derive-errors.rs:138:5
73
78
|
74
79
LL | #[label = "See here"]
75
- | ^
80
+ | ^^^^^^^^^^^^^^^^^^^^^
76
81
77
82
error: `nonsense` is not a valid key for `#[suggestion(...)]`
78
83
--> $DIR/session-derive-errors.rs:163:18
79
84
|
80
85
LL | #[suggestion(nonsense = "This is nonsense")]
81
- | ^^^^^^^^
86
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82
87
83
88
error: `msg` is not a valid key for `#[suggestion(...)]`
84
89
--> $DIR/session-derive-errors.rs:171:18
85
90
|
86
91
LL | #[suggestion(msg = "This is a suggestion")]
87
- | ^^^
92
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88
93
89
94
error: missing suggestion message
90
95
--> $DIR/session-derive-errors.rs:179:7
91
96
|
92
97
LL | #[suggestion(code = "This is suggested code")]
93
- | ^^^^^^^^^^
98
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
94
99
|
95
100
= help: provide a suggestion message using #[suggestion(message = "...")]
96
101
97
102
error: wrong field type for suggestion
98
103
--> $DIR/session-derive-errors.rs:194:5
99
104
|
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
+ | |_____________________________^
102
109
|
103
110
= help: #[suggestion(...)] should be applied to fields of type Span or (Span, Applicability)
104
111
105
112
error: type of field annotated with `#[suggestion(...)]` contains more than one Span
106
113
--> $DIR/session-derive-errors.rs:209:5
107
114
|
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
+ | |___________________________________________^
110
119
111
120
error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
112
121
--> $DIR/session-derive-errors.rs:217:5
113
122
|
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
+ | |____________________________________________________^
116
127
117
128
error: invalid annotation list `#[label(...)]`
118
129
--> $DIR/session-derive-errors.rs:225:7
119
130
|
120
131
LL | #[label("wrong kind of annotation for label")]
121
- | ^^^^^
132
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122
133
123
134
error: aborting due to 18 previous errors
124
135
0 commit comments