File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/test/ui-fulldeps/auxiliary Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,9 @@ macro_rules! fake_lint_pass {
32
32
$(
33
33
if !cx. sess( ) . contains_name( attrs, $attr) {
34
34
cx. lint( CRATE_NOT_OKAY , |lint| {
35
+ let span = cx. tcx. hir( ) . span( rustc_hir:: CRATE_HIR_ID ) ;
35
36
let msg = format!( "crate is not marked with #![{}]" , $attr) ;
36
- lint. build( & msg) . set_span( krate . item . span) . emit( )
37
+ lint. build( & msg) . set_span( span) . emit( )
37
38
} ) ;
38
39
}
39
40
) *
Original file line number Diff line number Diff line change @@ -30,8 +30,9 @@ impl<'tcx> LateLintPass<'tcx> for Pass {
30
30
let attrs = cx. tcx . hir ( ) . attrs ( rustc_hir:: CRATE_HIR_ID ) ;
31
31
if !cx. sess ( ) . contains_name ( attrs, Symbol :: intern ( "crate_okay" ) ) {
32
32
cx. lint ( CRATE_NOT_OKAY , |lint| {
33
+ let span = cx. tcx . hir ( ) . span ( rustc_hir:: CRATE_HIR_ID ) ;
33
34
lint. build ( "crate is not marked with #![crate_okay]" )
34
- . set_span ( krate . item . span )
35
+ . set_span ( span)
35
36
. emit ( )
36
37
} ) ;
37
38
}
You can’t perform that action at this time.
0 commit comments