File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,18 @@ fn ty_to_fndef(ty: Ty) -> Option<FnDef> {
105
105
106
106
/// Source code for a span.
107
107
fn source_code ( span : Span , src_map : & SourceMap ) -> String {
108
+ // println!("{span:?}\n{:?}\n\n", span.find_oldest_ancestor_in_same_ctxt());
109
+ _ = src_map. span_to_source ( span, |text, x, y| {
110
+ println ! ( "(stable_mir span to internal span) [{span:?}]\n {}" , & text[ x..y] ) ;
111
+ Ok ( ( ) )
112
+ } ) ;
113
+ let ancestor_span = span. find_oldest_ancestor_in_same_ctxt ( ) ;
114
+ dbg ! ( span. from_expansion( ) , ancestor_span. from_expansion( ) ) ;
115
+ _ = src_map. span_to_source ( ancestor_span, |text, x, y| {
116
+ println ! ( "(find_oldest_ancestor_in_same_ctxt) [{ancestor_span:?}]\n {}\n \n " , & text[ x..y] ) ;
117
+ Ok ( ( ) )
118
+ } ) ;
119
+
108
120
src_map
109
121
. span_to_source ( span, |text, x, y| {
110
122
let src = & text[ x..y] ;
You can’t perform that action at this time.
0 commit comments