File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -4268,6 +4268,7 @@ name = "rustc_passes"
42684268version = " 0.0.0"
42694269dependencies = [
42704270 " rustc_ast" ,
4271+ " rustc_ast_pretty" ,
42714272 " rustc_attr" ,
42724273 " rustc_data_structures" ,
42734274 " rustc_errors" ,
Original file line number Diff line number Diff line change @@ -19,3 +19,4 @@ rustc_serialize = { path = "../rustc_serialize" }
1919rustc_span = { path = " ../rustc_span" }
2020rustc_trait_selection = { path = " ../rustc_trait_selection" }
2121rustc_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> {
597597 hir_id,
598598 i_meta. span ,
599599 |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+ ) ;
607604 lint. build ( & msg) . emit ( ) ;
608605 } ,
609606 ) ;
You can’t perform that action at this time.
0 commit comments