File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -233,12 +233,19 @@ impl AnnotateMoves {
233233 original_source_info. span ,
234234 ) ;
235235
236+ // Get the span of the intrinsic function definition - this represents
237+ // "where we are inside the inlined function"
238+ let intrinsic_span = tcx. def_span ( intrinsic_def_id) ;
239+
236240 // Create new inlined scope that makes the operation appear to come from the intrinsic
237241 let inlined_scope_data = SourceScopeData {
238- span : original_source_info. span ,
242+ // Use the intrinsic's definition span to show where we are "inside" the inlined function
243+ span : intrinsic_span,
239244 parent_scope : Some ( original_source_info. scope ) ,
240245
241- // Pretend this op is inlined from the intrinsic
246+ // The inlined field shows: (what was inlined, where it was called from)
247+ // - intrinsic_instance: the compiler_move/copy function that was "inlined"
248+ // - original_source_info.span: the call site (where the actual move/copy is)
242249 inlined : Some ( ( intrinsic_instance, original_source_info. span ) ) ,
243250
244251 // Proper inlined scope chaining to maintain debug info hierarchy
You can’t perform that action at this time.
0 commit comments