@@ -5,7 +5,7 @@ use rustc_span::{symbol::Ident, Span, Symbol};
55#[ derive( SessionDiagnostic ) ]
66#[ error( code = "E0062" , slug = "typeck-field-multiply-specified-in-initializer" ) ]
77pub struct FieldMultiplySpecifiedInInitializer {
8- #[ message ]
8+ #[ primary_span ]
99 #[ label = "used more than once" ]
1010 pub span : Span ,
1111 #[ label = "first use of `{ident}`" ]
@@ -16,7 +16,7 @@ pub struct FieldMultiplySpecifiedInInitializer {
1616#[ derive( SessionDiagnostic ) ]
1717#[ error( code = "E0092" , slug = "typeck-unrecognized-atomic-operation" ) ]
1818pub struct UnrecognizedAtomicOperation < ' a > {
19- #[ message ]
19+ #[ primary_span ]
2020 #[ label = "unrecognized atomic operation" ]
2121 pub span : Span ,
2222 pub op : & ' a str ,
@@ -25,7 +25,7 @@ pub struct UnrecognizedAtomicOperation<'a> {
2525#[ derive( SessionDiagnostic ) ]
2626#[ error( code = "E0094" , slug = "typeck-wrong-number-of-generic-arguments-to-intrinsic" ) ]
2727pub struct WrongNumberOfGenericArgumentsToIntrinsic < ' a > {
28- #[ message ]
28+ #[ primary_span ]
2929 #[ label = "expected {expected} {descr} parameter{expected_pluralize}" ]
3030 pub span : Span ,
3131 pub found : usize ,
@@ -37,7 +37,7 @@ pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
3737#[ derive( SessionDiagnostic ) ]
3838#[ error( code = "E0093" , slug = "typeck-unrecognized-intrinsic-function" ) ]
3939pub struct UnrecognizedIntrinsicFunction {
40- #[ message ]
40+ #[ primary_span ]
4141 #[ label = "unrecognized intrinsic" ]
4242 pub span : Span ,
4343 pub name : Symbol ,
@@ -46,7 +46,7 @@ pub struct UnrecognizedIntrinsicFunction {
4646#[ derive( SessionDiagnostic ) ]
4747#[ error( code = "E0195" , slug = "typeck-lifetimes-or-bounds-mismatch-on-trait" ) ]
4848pub struct LifetimesOrBoundsMismatchOnTrait {
49- #[ message ]
49+ #[ primary_span ]
5050 #[ label = "lifetimes do not match {item_kind} in trait" ]
5151 pub span : Span ,
5252 #[ label = "lifetimes in impl do not match this {item_kind} in trait" ]
@@ -58,7 +58,7 @@ pub struct LifetimesOrBoundsMismatchOnTrait {
5858#[ derive( SessionDiagnostic ) ]
5959#[ error( code = "E0120" , slug = "typeck-drop-impl-on-wrong-item" ) ]
6060pub struct DropImplOnWrongItem {
61- #[ message ]
61+ #[ primary_span ]
6262 #[ label = "must be a struct, enum, or union" ]
6363 pub span : Span ,
6464}
@@ -67,7 +67,7 @@ pub struct DropImplOnWrongItem {
6767#[ error( code = "E0124" , slug = "typeck-field-already-declared" ) ]
6868pub struct FieldAlreadyDeclared {
6969 pub field_name : Ident ,
70- #[ message ]
70+ #[ primary_span ]
7171 #[ label = "field already declared" ]
7272 pub span : Span ,
7373 #[ label = "`{field_name}` first declared here" ]
@@ -77,67 +77,67 @@ pub struct FieldAlreadyDeclared {
7777#[ derive( SessionDiagnostic ) ]
7878#[ error( code = "E0184" , slug = "typeck-copy-impl-on-type-with-dtor" ) ]
7979pub struct CopyImplOnTypeWithDtor {
80- #[ message ]
80+ #[ primary_span ]
8181 #[ label = "Copy not allowed on types with destructors" ]
8282 pub span : Span ,
8383}
8484
8585#[ derive( SessionDiagnostic ) ]
8686#[ error( code = "E0203" , slug = "typeck-multiple-relaxed-default-bounds" ) ]
8787pub struct MultipleRelaxedDefaultBounds {
88- #[ message ]
88+ #[ primary_span ]
8989 pub span : Span ,
9090}
9191
9292#[ derive( SessionDiagnostic ) ]
9393#[ error( code = "E0206" , slug = "typeck-copy-impl-on-non-adt" ) ]
9494pub struct CopyImplOnNonAdt {
95- #[ message ]
95+ #[ primary_span ]
9696 #[ label = "type is not a structure or enumeration" ]
9797 pub span : Span ,
9898}
9999
100100#[ derive( SessionDiagnostic ) ]
101101#[ error( code = "E0224" , slug = "typeck-trait-object-declared-with-no-traits" ) ]
102102pub struct TraitObjectDeclaredWithNoTraits {
103- #[ message ]
103+ #[ primary_span ]
104104 pub span : Span ,
105105}
106106
107107#[ derive( SessionDiagnostic ) ]
108108#[ error( code = "E0227" , slug = "typeck-ambiguous-lifetime-bound" ) ]
109109pub struct AmbiguousLifetimeBound {
110- #[ message ]
110+ #[ primary_span ]
111111 pub span : Span ,
112112}
113113
114114#[ derive( SessionDiagnostic ) ]
115115#[ error( code = "E0229" , slug = "typeck-assoc-type-binding-not-allowed" ) ]
116116pub struct AssocTypeBindingNotAllowed {
117- #[ message ]
117+ #[ primary_span ]
118118 #[ label = "associated type not allowed here" ]
119119 pub span : Span ,
120120}
121121
122122#[ derive( SessionDiagnostic ) ]
123123#[ error( code = "E0436" , slug = "typeck-functional-record-update-on-non-struct" ) ]
124124pub struct FunctionalRecordUpdateOnNonStruct {
125- #[ message ]
125+ #[ primary_span ]
126126 pub span : Span ,
127127}
128128
129129#[ derive( SessionDiagnostic ) ]
130130#[ error( code = "E0516" , slug = "typeck-typeof-reserved-keyword-used" ) ]
131131pub struct TypeofReservedKeywordUsed {
132- #[ message ]
132+ #[ primary_span ]
133133 #[ label = "reserved keyword" ]
134134 pub span : Span ,
135135}
136136
137137#[ derive( SessionDiagnostic ) ]
138138#[ error( code = "E0572" , slug = "typeck-return-stmt-outside-of-fn-body" ) ]
139139pub struct ReturnStmtOutsideOfFnBody {
140- #[ message ]
140+ #[ primary_span ]
141141 pub span : Span ,
142142 #[ label = "the return is part of this body..." ]
143143 pub encl_body_span : Option < Span > ,
@@ -148,29 +148,29 @@ pub struct ReturnStmtOutsideOfFnBody {
148148#[ derive( SessionDiagnostic ) ]
149149#[ error( code = "E0627" , slug = "typeck-yield-expr-outside-of-generator" ) ]
150150pub struct YieldExprOutsideOfGenerator {
151- #[ message ]
151+ #[ primary_span ]
152152 pub span : Span ,
153153}
154154
155155#[ derive( SessionDiagnostic ) ]
156156#[ error( code = "E0639" , slug = "typeck-struct-expr-non-exhaustive" ) ]
157157pub struct StructExprNonExhaustive {
158- #[ message ]
158+ #[ primary_span ]
159159 pub span : Span ,
160160 pub what : & ' static str ,
161161}
162162
163163#[ derive( SessionDiagnostic ) ]
164164#[ error( code = "E0699" , slug = "typeck-method-call-on-unknown-type" ) ]
165165pub struct MethodCallOnUnknownType {
166- #[ message ]
166+ #[ primary_span ]
167167 pub span : Span ,
168168}
169169
170170#[ derive( SessionDiagnostic ) ]
171171#[ error( code = "E0719" , slug = "typeck-value-of-associated-struct-already-specified" ) ]
172172pub struct ValueOfAssociatedStructAlreadySpecified {
173- #[ message ]
173+ #[ primary_span ]
174174 #[ label = "re-bound here" ]
175175 pub span : Span ,
176176 #[ label = "`{item_name}` bound here first" ]
@@ -182,7 +182,7 @@ pub struct ValueOfAssociatedStructAlreadySpecified {
182182#[ derive( SessionDiagnostic ) ]
183183#[ error( code = "E0745" , slug = "typeck-address-of-temporary-taken" ) ]
184184pub struct AddressOfTemporaryTaken {
185- #[ message ]
185+ #[ primary_span ]
186186 #[ label = "temporary value" ]
187187 pub span : Span ,
188188}
0 commit comments