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