@@ -506,7 +506,7 @@ pub struct LocalDecl<'tcx> {
506506 pub name : Option < Name > ,
507507
508508 /// Source info of the local. The `SourceScope` is the *visibility* one,
509- /// not the the *syntactic* one (see `syntactic_scope ` for more details).
509+ /// not the the *syntactic* one (see `syntactic_source_info ` for more details).
510510 pub source_info : SourceInfo ,
511511
512512 /// The *syntactic* (i.e. not visibility) source scope the local is defined
@@ -560,9 +560,9 @@ pub struct LocalDecl<'tcx> {
560560 /// `drop(x)`, we want it to refer to `x: u32`.
561561 ///
562562 /// To allow both uses to work, we need to have more than a single scope
563- /// for a local. We have the `syntactic_scope ` represent the
563+ /// for a local. We have the `syntactic_source_info.scope ` represent the
564564 /// "syntactic" lint scope (with a variable being under its let
565- /// block) while the source-info scope represents the "local variable"
565+ /// block) while the `source_info. scope` represents the "local variable"
566566 /// scope (where the "rest" of a block is under all prior let-statements).
567567 ///
568568 /// The end result looks like this:
@@ -574,10 +574,10 @@ pub struct LocalDecl<'tcx> {
574574 /// │ │{ #[allow(unused_mut] } // this is actually split into 2 scopes
575575 /// │ │ // in practice because I'm lazy.
576576 /// │ │
577- /// │ │← x.syntactic_scope
577+ /// │ │← x.syntactic_source_info.scope
578578 /// │ │← `x.parse().unwrap()`
579579 /// │ │
580- /// │ │ │← y.syntactic_scope
580+ /// │ │ │← y.syntactic_source_info.scope
581581 /// │ │
582582 /// │ │ │{ let y: u32 }
583583 /// │ │ │
@@ -588,7 +588,7 @@ pub struct LocalDecl<'tcx> {
588588 /// │ │← x.source_info.scope
589589 /// │ │← `drop(x)` // this accesses `x: u32`
590590 /// ```
591- pub syntactic_scope : SourceScope ,
591+ pub syntactic_source_info : SourceInfo ,
592592}
593593
594594impl < ' tcx > LocalDecl < ' tcx > {
@@ -603,7 +603,10 @@ impl<'tcx> LocalDecl<'tcx> {
603603 span,
604604 scope : OUTERMOST_SOURCE_SCOPE
605605 } ,
606- syntactic_scope : OUTERMOST_SOURCE_SCOPE ,
606+ syntactic_source_info : SourceInfo {
607+ span,
608+ scope : OUTERMOST_SOURCE_SCOPE
609+ } ,
607610 internal : false ,
608611 is_user_variable : false
609612 }
@@ -620,7 +623,10 @@ impl<'tcx> LocalDecl<'tcx> {
620623 span,
621624 scope : OUTERMOST_SOURCE_SCOPE
622625 } ,
623- syntactic_scope : OUTERMOST_SOURCE_SCOPE ,
626+ syntactic_source_info : SourceInfo {
627+ span,
628+ scope : OUTERMOST_SOURCE_SCOPE
629+ } ,
624630 internal : true ,
625631 is_user_variable : false
626632 }
@@ -638,7 +644,10 @@ impl<'tcx> LocalDecl<'tcx> {
638644 span,
639645 scope : OUTERMOST_SOURCE_SCOPE
640646 } ,
641- syntactic_scope : OUTERMOST_SOURCE_SCOPE ,
647+ syntactic_source_info : SourceInfo {
648+ span,
649+ scope : OUTERMOST_SOURCE_SCOPE
650+ } ,
642651 internal : false ,
643652 name : None , // FIXME maybe we do want some name here?
644653 is_user_variable : false
@@ -2192,7 +2201,7 @@ BraceStructTypeFoldableImpl! {
21922201 ty,
21932202 name,
21942203 source_info,
2195- syntactic_scope ,
2204+ syntactic_source_info ,
21962205 }
21972206}
21982207
0 commit comments