@@ -5,7 +5,7 @@ use rustc_span::{symbol::Ident, Span, Symbol};
5
5
#[ derive( SessionDiagnostic ) ]
6
6
#[ error( code = "E0062" , slug = "typeck-field-multiply-specified-in-initializer" ) ]
7
7
pub struct FieldMultiplySpecifiedInInitializer {
8
- #[ message ]
8
+ #[ primary_span ]
9
9
#[ label = "used more than once" ]
10
10
pub span : Span ,
11
11
#[ label = "first use of `{ident}`" ]
@@ -16,7 +16,7 @@ pub struct FieldMultiplySpecifiedInInitializer {
16
16
#[ derive( SessionDiagnostic ) ]
17
17
#[ error( code = "E0092" , slug = "typeck-unrecognized-atomic-operation" ) ]
18
18
pub struct UnrecognizedAtomicOperation < ' a > {
19
- #[ message ]
19
+ #[ primary_span ]
20
20
#[ label = "unrecognized atomic operation" ]
21
21
pub span : Span ,
22
22
pub op : & ' a str ,
@@ -25,7 +25,7 @@ pub struct UnrecognizedAtomicOperation<'a> {
25
25
#[ derive( SessionDiagnostic ) ]
26
26
#[ error( code = "E0094" , slug = "typeck-wrong-number-of-generic-arguments-to-intrinsic" ) ]
27
27
pub struct WrongNumberOfGenericArgumentsToIntrinsic < ' a > {
28
- #[ message ]
28
+ #[ primary_span ]
29
29
#[ label = "expected {expected} {descr} parameter{expected_pluralize}" ]
30
30
pub span : Span ,
31
31
pub found : usize ,
@@ -37,7 +37,7 @@ pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
37
37
#[ derive( SessionDiagnostic ) ]
38
38
#[ error( code = "E0093" , slug = "typeck-unrecognized-intrinsic-function" ) ]
39
39
pub struct UnrecognizedIntrinsicFunction {
40
- #[ message ]
40
+ #[ primary_span ]
41
41
#[ label = "unrecognized intrinsic" ]
42
42
pub span : Span ,
43
43
pub name : Symbol ,
@@ -46,7 +46,7 @@ pub struct UnrecognizedIntrinsicFunction {
46
46
#[ derive( SessionDiagnostic ) ]
47
47
#[ error( code = "E0195" , slug = "typeck-lifetimes-or-bounds-mismatch-on-trait" ) ]
48
48
pub struct LifetimesOrBoundsMismatchOnTrait {
49
- #[ message ]
49
+ #[ primary_span ]
50
50
#[ label = "lifetimes do not match {item_kind} in trait" ]
51
51
pub span : Span ,
52
52
#[ label = "lifetimes in impl do not match this {item_kind} in trait" ]
@@ -58,7 +58,7 @@ pub struct LifetimesOrBoundsMismatchOnTrait {
58
58
#[ derive( SessionDiagnostic ) ]
59
59
#[ error( code = "E0120" , slug = "typeck-drop-impl-on-wrong-item" ) ]
60
60
pub struct DropImplOnWrongItem {
61
- #[ message ]
61
+ #[ primary_span ]
62
62
#[ label = "must be a struct, enum, or union" ]
63
63
pub span : Span ,
64
64
}
@@ -67,7 +67,7 @@ pub struct DropImplOnWrongItem {
67
67
#[ error( code = "E0124" , slug = "typeck-field-already-declared" ) ]
68
68
pub struct FieldAlreadyDeclared {
69
69
pub field_name : Ident ,
70
- #[ message ]
70
+ #[ primary_span ]
71
71
#[ label = "field already declared" ]
72
72
pub span : Span ,
73
73
#[ label = "`{field_name}` first declared here" ]
@@ -77,67 +77,67 @@ pub struct FieldAlreadyDeclared {
77
77
#[ derive( SessionDiagnostic ) ]
78
78
#[ error( code = "E0184" , slug = "typeck-copy-impl-on-type-with-dtor" ) ]
79
79
pub struct CopyImplOnTypeWithDtor {
80
- #[ message ]
80
+ #[ primary_span ]
81
81
#[ label = "Copy not allowed on types with destructors" ]
82
82
pub span : Span ,
83
83
}
84
84
85
85
#[ derive( SessionDiagnostic ) ]
86
86
#[ error( code = "E0203" , slug = "typeck-multiple-relaxed-default-bounds" ) ]
87
87
pub struct MultipleRelaxedDefaultBounds {
88
- #[ message ]
88
+ #[ primary_span ]
89
89
pub span : Span ,
90
90
}
91
91
92
92
#[ derive( SessionDiagnostic ) ]
93
93
#[ error( code = "E0206" , slug = "typeck-copy-impl-on-non-adt" ) ]
94
94
pub struct CopyImplOnNonAdt {
95
- #[ message ]
95
+ #[ primary_span ]
96
96
#[ label = "type is not a structure or enumeration" ]
97
97
pub span : Span ,
98
98
}
99
99
100
100
#[ derive( SessionDiagnostic ) ]
101
101
#[ error( code = "E0224" , slug = "typeck-trait-object-declared-with-no-traits" ) ]
102
102
pub struct TraitObjectDeclaredWithNoTraits {
103
- #[ message ]
103
+ #[ primary_span ]
104
104
pub span : Span ,
105
105
}
106
106
107
107
#[ derive( SessionDiagnostic ) ]
108
108
#[ error( code = "E0227" , slug = "typeck-ambiguous-lifetime-bound" ) ]
109
109
pub struct AmbiguousLifetimeBound {
110
- #[ message ]
110
+ #[ primary_span ]
111
111
pub span : Span ,
112
112
}
113
113
114
114
#[ derive( SessionDiagnostic ) ]
115
115
#[ error( code = "E0229" , slug = "typeck-assoc-type-binding-not-allowed" ) ]
116
116
pub struct AssocTypeBindingNotAllowed {
117
- #[ message ]
117
+ #[ primary_span ]
118
118
#[ label = "associated type not allowed here" ]
119
119
pub span : Span ,
120
120
}
121
121
122
122
#[ derive( SessionDiagnostic ) ]
123
123
#[ error( code = "E0436" , slug = "typeck-functional-record-update-on-non-struct" ) ]
124
124
pub struct FunctionalRecordUpdateOnNonStruct {
125
- #[ message ]
125
+ #[ primary_span ]
126
126
pub span : Span ,
127
127
}
128
128
129
129
#[ derive( SessionDiagnostic ) ]
130
130
#[ error( code = "E0516" , slug = "typeck-typeof-reserved-keyword-used" ) ]
131
131
pub struct TypeofReservedKeywordUsed {
132
- #[ message ]
132
+ #[ primary_span ]
133
133
#[ label = "reserved keyword" ]
134
134
pub span : Span ,
135
135
}
136
136
137
137
#[ derive( SessionDiagnostic ) ]
138
138
#[ error( code = "E0572" , slug = "typeck-return-stmt-outside-of-fn-body" ) ]
139
139
pub struct ReturnStmtOutsideOfFnBody {
140
- #[ message ]
140
+ #[ primary_span ]
141
141
pub span : Span ,
142
142
#[ label = "the return is part of this body..." ]
143
143
pub encl_body_span : Option < Span > ,
@@ -148,29 +148,29 @@ pub struct ReturnStmtOutsideOfFnBody {
148
148
#[ derive( SessionDiagnostic ) ]
149
149
#[ error( code = "E0627" , slug = "typeck-yield-expr-outside-of-generator" ) ]
150
150
pub struct YieldExprOutsideOfGenerator {
151
- #[ message ]
151
+ #[ primary_span ]
152
152
pub span : Span ,
153
153
}
154
154
155
155
#[ derive( SessionDiagnostic ) ]
156
156
#[ error( code = "E0639" , slug = "typeck-struct-expr-non-exhaustive" ) ]
157
157
pub struct StructExprNonExhaustive {
158
- #[ message ]
158
+ #[ primary_span ]
159
159
pub span : Span ,
160
160
pub what : & ' static str ,
161
161
}
162
162
163
163
#[ derive( SessionDiagnostic ) ]
164
164
#[ error( code = "E0699" , slug = "typeck-method-call-on-unknown-type" ) ]
165
165
pub struct MethodCallOnUnknownType {
166
- #[ message ]
166
+ #[ primary_span ]
167
167
pub span : Span ,
168
168
}
169
169
170
170
#[ derive( SessionDiagnostic ) ]
171
171
#[ error( code = "E0719" , slug = "typeck-value-of-associated-struct-already-specified" ) ]
172
172
pub struct ValueOfAssociatedStructAlreadySpecified {
173
- #[ message ]
173
+ #[ primary_span ]
174
174
#[ label = "re-bound here" ]
175
175
pub span : Span ,
176
176
#[ label = "`{item_name}` bound here first" ]
@@ -182,7 +182,7 @@ pub struct ValueOfAssociatedStructAlreadySpecified {
182
182
#[ derive( SessionDiagnostic ) ]
183
183
#[ error( code = "E0745" , slug = "typeck-address-of-temporary-taken" ) ]
184
184
pub struct AddressOfTemporaryTaken {
185
- #[ message ]
185
+ #[ primary_span ]
186
186
#[ label = "temporary value" ]
187
187
pub span : Span ,
188
188
}
0 commit comments