File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed
test/run-make/rustdoc-scrape-examples-whitespace Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,8 @@ where
196196 return ;
197197 }
198198
199- let file = tcx. sess . source_map ( ) . lookup_char_pos ( span. lo ( ) ) . file ;
199+ let source_map = tcx. sess . source_map ( ) ;
200+ let file = source_map. lookup_char_pos ( span. lo ( ) ) . file ;
200201 let file_path = match file. name . clone ( ) {
201202 FileName :: Real ( real_filename) => real_filename. into_local_path ( ) ,
202203 _ => None ,
@@ -217,6 +218,8 @@ where
217218 let fn_entries = self . calls . entry ( fn_key) . or_default ( ) ;
218219
219220 trace ! ( "Including expr: {:?}" , span) ;
221+ let enclosing_item_span =
222+ source_map. span_extend_to_prev_char ( enclosing_item_span, '\n' , false ) ;
220223 let location = CallLocation :: new ( span, enclosing_item_span, & file) ;
221224 fn_entries. entry ( abs_path) . or_insert_with ( mk_call_data) . locations . push ( location) ;
222225 }
Original file line number Diff line number Diff line change 1+ deps := ex
2+
3+ -include ../rustdoc-scrape-examples-multiple/scrape.mk
4+
5+ all : scrape
Original file line number Diff line number Diff line change 1+ struct Foo ;
2+ impl Foo {
3+ fn bar ( ) { foobar:: ok ( ) ; }
4+ }
5+
6+ fn main ( ) {
7+ Foo :: bar ( ) ;
8+ }
Original file line number Diff line number Diff line change 1+ // @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//code' ' '
2+
3+ pub fn ok ( ) { }
You can’t perform that action at this time.
0 commit comments