File tree 4 files changed +20
-1
lines changed
test/run-make/rustdoc-scrape-examples-whitespace
4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,8 @@ where
196
196
return ;
197
197
}
198
198
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 ;
200
201
let file_path = match file. name . clone ( ) {
201
202
FileName :: Real ( real_filename) => real_filename. into_local_path ( ) ,
202
203
_ => None ,
@@ -217,6 +218,8 @@ where
217
218
let fn_entries = self . calls . entry ( fn_key) . or_default ( ) ;
218
219
219
220
trace ! ( "Including expr: {:?}" , span) ;
221
+ let enclosing_item_span =
222
+ source_map. span_extend_to_prev_char ( enclosing_item_span, '\n' , false ) ;
220
223
let location = CallLocation :: new ( span, enclosing_item_span, & file) ;
221
224
fn_entries. entry ( abs_path) . or_insert_with ( mk_call_data) . locations . push ( location) ;
222
225
}
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