@@ -8,11 +8,11 @@ use crate::hir::def_id::DefId;
8
8
use crate :: hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
9
9
use crate :: hir:: DUMMY_HIR_ID ;
10
10
use crate :: hir:: { self , Attribute , HirId , Item , ItemKind , TraitItem , TraitItemKind } ;
11
- use crate :: lint:: builtin:: { CONFLICTING_REPR_HINTS , UNUSED_ATTRIBUTES } ;
11
+ use crate :: lint:: builtin:: UNUSED_ATTRIBUTES ;
12
12
use crate :: ty:: query:: Providers ;
13
13
use crate :: ty:: TyCtxt ;
14
14
15
- use errors:: { error_code , struct_span_err} ;
15
+ use errors:: struct_span_err;
16
16
use rustc_span:: Span ;
17
17
18
18
use std:: fmt:: { self , Display } ;
@@ -194,7 +194,7 @@ impl CheckAttrVisitor<'tcx> {
194
194
self . tcx . codegen_fn_attrs ( self . tcx . hir ( ) . local_def_id ( hir_id) ) ;
195
195
}
196
196
197
- self . check_repr ( attrs, span, target, item, hir_id ) ;
197
+ self . check_repr ( attrs, span, target, item) ;
198
198
self . check_used ( attrs, target) ;
199
199
}
200
200
@@ -355,7 +355,6 @@ impl CheckAttrVisitor<'tcx> {
355
355
span : & Span ,
356
356
target : Target ,
357
357
item : Option < & Item < ' _ > > ,
358
- hir_id : HirId ,
359
358
) {
360
359
// Extract the names of all repr hints, e.g., [foo, bar, align] for:
361
360
// ```
@@ -445,15 +444,13 @@ impl CheckAttrVisitor<'tcx> {
445
444
|| ( is_simd && is_c)
446
445
|| ( int_reprs == 1 && is_c && item. map_or ( false , |item| is_c_like_enum ( item) ) )
447
446
{
448
- self . tcx
449
- . struct_span_lint_hir (
450
- CONFLICTING_REPR_HINTS ,
451
- hir_id,
452
- hint_spans. collect :: < Vec < Span > > ( ) ,
453
- "conflicting representation hints" ,
454
- )
455
- . code ( error_code ! ( E0566 ) )
456
- . emit ( ) ;
447
+ struct_span_err ! (
448
+ self . tcx. sess,
449
+ hint_spans. collect:: <Vec <Span >>( ) ,
450
+ E0566 ,
451
+ "conflicting representation hints" ,
452
+ )
453
+ . emit ( ) ;
457
454
}
458
455
}
459
456
0 commit comments