File tree 3 files changed +6
-7
lines changed
3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -4268,6 +4268,7 @@ name = "rustc_passes"
4268
4268
version = " 0.0.0"
4269
4269
dependencies = [
4270
4270
" rustc_ast" ,
4271
+ " rustc_ast_pretty" ,
4271
4272
" rustc_attr" ,
4272
4273
" rustc_data_structures" ,
4273
4274
" rustc_errors" ,
Original file line number Diff line number Diff line change @@ -19,3 +19,4 @@ rustc_serialize = { path = "../rustc_serialize" }
19
19
rustc_span = { path = " ../rustc_span" }
20
20
rustc_trait_selection = { path = " ../rustc_trait_selection" }
21
21
rustc_lexer = { path = " ../rustc_lexer" }
22
+ rustc_ast_pretty = { path = " ../rustc_ast_pretty" }
Original file line number Diff line number Diff line change @@ -597,13 +597,10 @@ impl CheckAttrVisitor<'tcx> {
597
597
hir_id,
598
598
i_meta. span ,
599
599
|lint| {
600
- let msg = if let Ok ( snippet) =
601
- self . tcx . sess . source_map ( ) . span_to_snippet ( i_meta. path . span )
602
- {
603
- format ! ( "unknown `doc` attribute `{}`" , snippet, )
604
- } else {
605
- String :: from ( "unknown `doc` attribute" )
606
- } ;
600
+ let msg = format ! (
601
+ "unknown `doc` attribute `{}`" ,
602
+ rustc_ast_pretty:: pprust:: path_to_string( & i_meta. path) ,
603
+ ) ;
607
604
lint. build ( & msg) . emit ( ) ;
608
605
} ,
609
606
) ;
You can’t perform that action at this time.
0 commit comments