@@ -505,10 +505,6 @@ pub struct LocalDecl<'tcx> {
505505 /// to generate better debuginfo.
506506 pub name : Option < Name > ,
507507
508- /// Source info of the local. The `SourceScope` is the *visibility* one,
509- /// not the the *syntactic* one (see `syntactic_source_info` for more details).
510- pub source_info : SourceInfo ,
511-
512508 /// The *syntactic* (i.e. not visibility) source scope the local is defined
513509 /// in. If the local was defined in a let-statement, this
514510 /// is *within* the let-statement, rather than outside
@@ -562,7 +558,7 @@ pub struct LocalDecl<'tcx> {
562558 /// To allow both uses to work, we need to have more than a single scope
563559 /// for a local. We have the `syntactic_source_info.scope` represent the
564560 /// "syntactic" lint scope (with a variable being under its let
565- /// block) while the `source_info .scope` represents the "local variable"
561+ /// block) while the `visibility_source_info .scope` represents the "local variable"
566562 /// scope (where the "rest" of a block is under all prior let-statements).
567563 ///
568564 /// The end result looks like this:
@@ -581,14 +577,18 @@ pub struct LocalDecl<'tcx> {
581577 /// │ │
582578 /// │ │ │{ let y: u32 }
583579 /// │ │ │
584- /// │ │ │← y.source_info .scope
580+ /// │ │ │← y.visibility_source_info .scope
585581 /// │ │ │← `y + 2`
586582 /// │
587583 /// │ │{ let x: u32 }
588- /// │ │← x.source_info .scope
584+ /// │ │← x.visibility_source_info .scope
589585 /// │ │← `drop(x)` // this accesses `x: u32`
590586 /// ```
591587 pub syntactic_source_info : SourceInfo ,
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 ,
592592}
593593
594594impl < ' tcx > LocalDecl < ' tcx > {
@@ -599,11 +599,11 @@ impl<'tcx> LocalDecl<'tcx> {
599599 mutability : Mutability :: Mut ,
600600 ty,
601601 name : None ,
602- source_info : SourceInfo {
602+ syntactic_source_info : SourceInfo {
603603 span,
604604 scope : OUTERMOST_SOURCE_SCOPE
605605 } ,
606- syntactic_source_info : SourceInfo {
606+ visibility_source_info : SourceInfo {
607607 span,
608608 scope : OUTERMOST_SOURCE_SCOPE
609609 } ,
@@ -619,11 +619,11 @@ impl<'tcx> LocalDecl<'tcx> {
619619 mutability : Mutability :: Mut ,
620620 ty,
621621 name : None ,
622- source_info : SourceInfo {
622+ syntactic_source_info : SourceInfo {
623623 span,
624624 scope : OUTERMOST_SOURCE_SCOPE
625625 } ,
626- syntactic_source_info : SourceInfo {
626+ visibility_source_info : SourceInfo {
627627 span,
628628 scope : OUTERMOST_SOURCE_SCOPE
629629 } ,
@@ -640,11 +640,11 @@ impl<'tcx> LocalDecl<'tcx> {
640640 LocalDecl {
641641 mutability : Mutability :: Mut ,
642642 ty : return_ty,
643- source_info : SourceInfo {
643+ syntactic_source_info : SourceInfo {
644644 span,
645645 scope : OUTERMOST_SOURCE_SCOPE
646646 } ,
647- syntactic_source_info : SourceInfo {
647+ visibility_source_info : SourceInfo {
648648 span,
649649 scope : OUTERMOST_SOURCE_SCOPE
650650 } ,
@@ -2200,8 +2200,8 @@ BraceStructTypeFoldableImpl! {
22002200 internal,
22012201 ty,
22022202 name,
2203- source_info,
22042203 syntactic_source_info,
2204+ visibility_source_info,
22052205 }
22062206}
22072207
0 commit comments