@@ -1860,19 +1860,18 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
18601860
18611861 // Just point at all repr hints if there are any incompatibilities.
18621862 // 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 ( ) ;
18641864
18651865 // Error on repr(transparent, <anything else>).
18661866 if is_transparent && hints. len ( ) > 1 {
1867- let hint_spans = hint_spans. clone ( ) . collect ( ) ;
18681867 self . dcx ( ) . emit_err ( errors:: TransparentIncompatible {
1869- hint_spans,
1868+ hint_spans : hint_spans . clone ( ) ,
18701869 target : target. to_string ( ) ,
18711870 } ) ;
18721871 }
18731872 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 ( ) ;
18761875 }
18771876 // Warn on repr(u8, u16), repr(C, simd), and c-like-enum-repr(C, u8)
18781877 if ( int_reprs > 1 )
@@ -1886,8 +1885,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
18861885 self . tcx . emit_node_span_lint (
18871886 CONFLICTING_REPR_HINTS ,
18881887 hir_id,
1889- hint_spans. collect :: < Vec < Span > > ( ) ,
1890- errors:: ReprConflictingLint ,
1888+ hint_spans,
1889+ errors:: ReprConflicting ,
18911890 ) ;
18921891 }
18931892 }
0 commit comments