@@ -558,7 +558,7 @@ pub struct LocalDecl<'tcx> {
558558 /// To allow both uses to work, we need to have more than a single scope
559559 /// for a local. We have the `syntactic_source_info.scope` represent the
560560 /// "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"
562562 /// scope (where the "rest" of a block is under all prior let-statements).
563563 ///
564564 /// The end result looks like this:
@@ -577,18 +577,18 @@ pub struct LocalDecl<'tcx> {
577577 /// │ │
578578 /// │ │ │{ let y: u32 }
579579 /// │ │ │
580- /// │ │ │← y.visibility_source_info.scope
580+ /// │ │ │← y.visibility_scope
581581 /// │ │ │← `y + 2`
582582 /// │
583583 /// │ │{ let x: u32 }
584- /// │ │← x.visibility_source_info.scope
584+ /// │ │← x.visibility_scope
585585 /// │ │← `drop(x)` // this accesses `x: u32`
586586 /// ```
587587 pub syntactic_source_info : SourceInfo ,
588588
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 ,
592592}
593593
594594impl < ' tcx > LocalDecl < ' tcx > {
@@ -603,10 +603,7 @@ impl<'tcx> LocalDecl<'tcx> {
603603 span,
604604 scope : OUTERMOST_SOURCE_SCOPE
605605 } ,
606- visibility_source_info : SourceInfo {
607- span,
608- scope : OUTERMOST_SOURCE_SCOPE
609- } ,
606+ visibility_scope : OUTERMOST_SOURCE_SCOPE ,
610607 internal : false ,
611608 is_user_variable : false
612609 }
@@ -623,10 +620,7 @@ impl<'tcx> LocalDecl<'tcx> {
623620 span,
624621 scope : OUTERMOST_SOURCE_SCOPE
625622 } ,
626- visibility_source_info : SourceInfo {
627- span,
628- scope : OUTERMOST_SOURCE_SCOPE
629- } ,
623+ visibility_scope : OUTERMOST_SOURCE_SCOPE ,
630624 internal : true ,
631625 is_user_variable : false
632626 }
@@ -644,10 +638,7 @@ impl<'tcx> LocalDecl<'tcx> {
644638 span,
645639 scope : OUTERMOST_SOURCE_SCOPE
646640 } ,
647- visibility_source_info : SourceInfo {
648- span,
649- scope : OUTERMOST_SOURCE_SCOPE
650- } ,
641+ visibility_scope : OUTERMOST_SOURCE_SCOPE ,
651642 internal : false ,
652643 name : None , // FIXME maybe we do want some name here?
653644 is_user_variable : false
@@ -2201,7 +2192,7 @@ BraceStructTypeFoldableImpl! {
22012192 ty,
22022193 name,
22032194 syntactic_source_info,
2204- visibility_source_info ,
2195+ visibility_scope ,
22052196 }
22062197}
22072198
0 commit comments