@@ -558,7 +558,7 @@ pub struct LocalDecl<'tcx> {
558
558
/// To allow both uses to work, we need to have more than a single scope
559
559
/// for a local. We have the `syntactic_source_info.scope` represent the
560
560
/// "syntactic" lint scope (with a variable being under its let
561
- /// block) while the `visibility_source_info.scope ` represents the "local variable"
561
+ /// block) while the `visibility_scope ` represents the "local variable"
562
562
/// scope (where the "rest" of a block is under all prior let-statements).
563
563
///
564
564
/// The end result looks like this:
@@ -577,18 +577,18 @@ pub struct LocalDecl<'tcx> {
577
577
/// │ │
578
578
/// │ │ │{ let y: u32 }
579
579
/// │ │ │
580
- /// │ │ │← y.visibility_source_info.scope
580
+ /// │ │ │← y.visibility_scope
581
581
/// │ │ │← `y + 2`
582
582
/// │
583
583
/// │ │{ let x: u32 }
584
- /// │ │← x.visibility_source_info.scope
584
+ /// │ │← x.visibility_scope
585
585
/// │ │← `drop(x)` // this accesses `x: u32`
586
586
/// ```
587
587
pub syntactic_source_info : SourceInfo ,
588
588
589
- /// Source info of the local. The `SourceScope` is the *visibility* one,
590
- /// not the the *syntactic* one (see `syntactic_source_info` for more details).
591
- pub visibility_source_info : SourceInfo ,
589
+ /// Source scope within which the local is visible (for debuginfo)
590
+ /// (see `syntactic_source_info` for more details).
591
+ pub visibility_scope : SourceScope ,
592
592
}
593
593
594
594
impl < ' tcx > LocalDecl < ' tcx > {
@@ -603,10 +603,7 @@ impl<'tcx> LocalDecl<'tcx> {
603
603
span,
604
604
scope : OUTERMOST_SOURCE_SCOPE
605
605
} ,
606
- visibility_source_info : SourceInfo {
607
- span,
608
- scope : OUTERMOST_SOURCE_SCOPE
609
- } ,
606
+ visibility_scope : OUTERMOST_SOURCE_SCOPE ,
610
607
internal : false ,
611
608
is_user_variable : false
612
609
}
@@ -623,10 +620,7 @@ impl<'tcx> LocalDecl<'tcx> {
623
620
span,
624
621
scope : OUTERMOST_SOURCE_SCOPE
625
622
} ,
626
- visibility_source_info : SourceInfo {
627
- span,
628
- scope : OUTERMOST_SOURCE_SCOPE
629
- } ,
623
+ visibility_scope : OUTERMOST_SOURCE_SCOPE ,
630
624
internal : true ,
631
625
is_user_variable : false
632
626
}
@@ -644,10 +638,7 @@ impl<'tcx> LocalDecl<'tcx> {
644
638
span,
645
639
scope : OUTERMOST_SOURCE_SCOPE
646
640
} ,
647
- visibility_source_info : SourceInfo {
648
- span,
649
- scope : OUTERMOST_SOURCE_SCOPE
650
- } ,
641
+ visibility_scope : OUTERMOST_SOURCE_SCOPE ,
651
642
internal : false ,
652
643
name : None , // FIXME maybe we do want some name here?
653
644
is_user_variable : false
@@ -2201,7 +2192,7 @@ BraceStructTypeFoldableImpl! {
2201
2192
ty,
2202
2193
name,
2203
2194
syntactic_source_info,
2204
- visibility_source_info ,
2195
+ visibility_scope ,
2205
2196
}
2206
2197
}
2207
2198
0 commit comments