@@ -1860,19 +1860,18 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
1860
1860
1861
1861
// Just point at all repr hints if there are any incompatibilities.
1862
1862
// This is not ideal, but tracking precisely which ones are at fault is a huge hassle.
1863
- let hint_spans = hints. iter ( ) . map ( |hint| hint. span ( ) ) ;
1863
+ let hint_spans: Vec < _ > = hints. iter ( ) . map ( |hint| hint. span ( ) ) . collect ( ) ;
1864
1864
1865
1865
// Error on repr(transparent, <anything else>).
1866
1866
if is_transparent && hints. len ( ) > 1 {
1867
- let hint_spans = hint_spans. clone ( ) . collect ( ) ;
1868
1867
self . dcx ( ) . emit_err ( errors:: TransparentIncompatible {
1869
- hint_spans,
1868
+ hint_spans : hint_spans . clone ( ) ,
1870
1869
target : target. to_string ( ) ,
1871
1870
} ) ;
1872
1871
}
1873
1872
if is_explicit_rust && ( int_reprs > 0 || is_c || is_simd) {
1874
- let hint_spans = hint_spans . clone ( ) . collect ( ) ;
1875
- self . dcx ( ) . emit_err ( errors:: ReprConflicting { hint_spans } ) ;
1873
+ # [ allow ( rustc :: diagnostic_outside_of_impl ) ]
1874
+ self . dcx ( ) . create_err ( errors:: ReprConflicting ) . with_span ( hint_spans. clone ( ) ) . emit ( ) ;
1876
1875
}
1877
1876
// Warn on repr(u8, u16), repr(C, simd), and c-like-enum-repr(C, u8)
1878
1877
if ( int_reprs > 1 )
@@ -1886,8 +1885,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
1886
1885
self . tcx . emit_node_span_lint (
1887
1886
CONFLICTING_REPR_HINTS ,
1888
1887
hir_id,
1889
- hint_spans. collect :: < Vec < Span > > ( ) ,
1890
- errors:: ReprConflictingLint ,
1888
+ hint_spans,
1889
+ errors:: ReprConflicting ,
1891
1890
) ;
1892
1891
}
1893
1892
}
0 commit comments