@@ -62,7 +62,7 @@ fn span_to_source(span: Span, src_map: &SourceMap) -> String {
6262 src_map
6363 . span_to_source ( span, |text, x, y| {
6464 let src = & text[ x..y] ;
65- debug ! ( "[{x}:{y}]\n {src}" ) ;
65+ // debug!("[{x}:{y}]\n{src}");
6666 Ok ( src. to_owned ( ) )
6767 } )
6868 . unwrap ( )
@@ -79,6 +79,21 @@ pub fn source_code_with(
7979 let span = internal ( tcx, stable_mir_span) ;
8080 let src = span_to_source ( span, src_map) ;
8181 let before_expansion = span. from_expansion ( ) . then ( || {
82+ {
83+ debug ! (
84+ "[find_oldest_ancestor_in_same_ctxt] {}" ,
85+ span_to_source( span. find_oldest_ancestor_in_same_ctxt( ) , src_map)
86+ ) ;
87+ debug ! ( "[source_callsite] {}" , span_to_source( span. source_callsite( ) , src_map) ) ;
88+ if let Some ( parent_callsite) = span. parent_callsite ( ) {
89+ debug ! ( "[parent_callsite] {}" , span_to_source( parent_callsite, src_map) ) ;
90+ }
91+ for m in span. macro_backtrace ( ) {
92+ debug ! ( "[macro_backtrace - callsite] {}" , span_to_source( m. call_site, src_map) ) ;
93+ debug ! ( "[macro_backtrace - defsite ] {}" , span_to_source( m. def_site, src_map) ) ;
94+ }
95+ debug ! ( "\n " ) ;
96+ }
8297 let ancestor_span = span. find_oldest_ancestor_in_same_ctxt ( ) ;
8398 span_to_source ( ancestor_span, src_map)
8499 } ) ;
0 commit comments