Skip to content

Commit 06d88cd

Browse files
committed
rustc: rename mir::LocalDecl's syntactic_source_info to source_info.
1 parent 6c53972 commit 06d88cd

File tree

19 files changed

+47
-47
lines changed

19 files changed

+47
-47
lines changed

src/librustc/ich/impls_mir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl_stable_hash_for!(struct mir::LocalDecl<'tcx> {
2525
mutability,
2626
ty,
2727
name,
28-
syntactic_source_info,
28+
source_info,
2929
visibility_scope,
3030
internal,
3131
is_user_variable

src/librustc/mir/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ pub struct LocalDecl<'tcx> {
556556
/// `drop(x)`, we want it to refer to `x: u32`.
557557
///
558558
/// To allow both uses to work, we need to have more than a single scope
559-
/// for a local. We have the `syntactic_source_info.scope` represent the
559+
/// for a local. We have the `source_info.scope` represent the
560560
/// "syntactic" lint scope (with a variable being under its let
561561
/// block) while the `visibility_scope` represents the "local variable"
562562
/// scope (where the "rest" of a block is under all prior let-statements).
@@ -570,10 +570,10 @@ pub struct LocalDecl<'tcx> {
570570
/// │ │{ #[allow(unused_mut] } // this is actually split into 2 scopes
571571
/// │ │ // in practice because I'm lazy.
572572
/// │ │
573-
/// │ │← x.syntactic_source_info.scope
573+
/// │ │← x.source_info.scope
574574
/// │ │← `x.parse().unwrap()`
575575
/// │ │
576-
/// │ │ │← y.syntactic_source_info.scope
576+
/// │ │ │← y.source_info.scope
577577
/// │ │
578578
/// │ │ │{ let y: u32 }
579579
/// │ │ │
@@ -584,10 +584,10 @@ pub struct LocalDecl<'tcx> {
584584
/// │ │← x.visibility_scope
585585
/// │ │← `drop(x)` // this accesses `x: u32`
586586
/// ```
587-
pub syntactic_source_info: SourceInfo,
587+
pub source_info: SourceInfo,
588588

589589
/// Source scope within which the local is visible (for debuginfo)
590-
/// (see `syntactic_source_info` for more details).
590+
/// (see `source_info` for more details).
591591
pub visibility_scope: SourceScope,
592592
}
593593

@@ -599,7 +599,7 @@ impl<'tcx> LocalDecl<'tcx> {
599599
mutability: Mutability::Mut,
600600
ty,
601601
name: None,
602-
syntactic_source_info: SourceInfo {
602+
source_info: SourceInfo {
603603
span,
604604
scope: OUTERMOST_SOURCE_SCOPE
605605
},
@@ -616,7 +616,7 @@ impl<'tcx> LocalDecl<'tcx> {
616616
mutability: Mutability::Mut,
617617
ty,
618618
name: None,
619-
syntactic_source_info: SourceInfo {
619+
source_info: SourceInfo {
620620
span,
621621
scope: OUTERMOST_SOURCE_SCOPE
622622
},
@@ -634,7 +634,7 @@ impl<'tcx> LocalDecl<'tcx> {
634634
LocalDecl {
635635
mutability: Mutability::Mut,
636636
ty: return_ty,
637-
syntactic_source_info: SourceInfo {
637+
source_info: SourceInfo {
638638
span,
639639
scope: OUTERMOST_SOURCE_SCOPE
640640
},
@@ -2191,7 +2191,7 @@ BraceStructTypeFoldableImpl! {
21912191
internal,
21922192
ty,
21932193
name,
2194-
syntactic_source_info,
2194+
source_info,
21952195
visibility_scope,
21962196
}
21972197
}

src/librustc/mir/visit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,17 +714,17 @@ macro_rules! make_mir_visitor {
714714
mutability: _,
715715
ref $($mutability)* ty,
716716
name: _,
717-
ref $($mutability)* syntactic_source_info,
717+
ref $($mutability)* source_info,
718718
ref $($mutability)* visibility_scope,
719719
internal: _,
720720
is_user_variable: _,
721721
} = *local_decl;
722722

723723
self.visit_ty(ty, TyContext::LocalDecl {
724724
local,
725-
source_info: *syntactic_source_info,
725+
source_info: *source_info,
726726
});
727-
self.visit_source_info(syntactic_source_info);
727+
self.visit_source_info(source_info);
728728
self.visit_source_scope(visibility_scope);
729729
}
730730

src/librustc_codegen_llvm/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub fn codegen_mir<'a, 'tcx: 'a>(
277277
let place = PlaceRef::alloca(&bx, layout, &name.as_str());
278278
if dbg {
279279
let (scope, span) = fx.debug_loc(mir::SourceInfo {
280-
span: decl.syntactic_source_info.span,
280+
span: decl.source_info.span,
281281
scope: decl.visibility_scope,
282282
});
283283
declare_local(&bx, &fx.debug_context, name, layout.ty, scope,

src/librustc_mir/borrow_check/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
398398

399399
let borrow_span = self.mir.source_info(borrow.reserve_location).span;
400400
let proper_span = match *root_place {
401-
Place::Local(local) => self.mir.local_decls[local].syntactic_source_info.span,
401+
Place::Local(local) => self.mir.local_decls[local].source_info.span,
402402
_ => drop_span,
403403
};
404404

src/librustc_mir/borrow_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,12 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(
306306
None => continue,
307307
}
308308

309-
let span = local_decl.syntactic_source_info.span;
309+
let span = local_decl.source_info.span;
310310
let mut_span = tcx.sess.codemap().span_until_non_whitespace(span);
311311

312312
tcx.struct_span_lint_node(
313313
UNUSED_MUT,
314-
vsi[local_decl.syntactic_source_info.scope].lint_root,
314+
vsi[local_decl.source_info.scope].lint_root,
315315
span,
316316
"variable does not need to be mutable"
317317
)

src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
6767
}
6868
None => {
6969
err.span_label(
70-
mir.local_decls[local].syntactic_source_info.span,
70+
mir.local_decls[local].source_info.span,
7171
"borrow may end up in a temporary, created here",
7272
);
7373

src/librustc_mir/borrow_check/nll/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
12011201
LocalKind::Var | LocalKind::Temp => {}
12021202
}
12031203

1204-
let span = local_decl.syntactic_source_info.span;
1204+
let span = local_decl.source_info.span;
12051205
let ty = local_decl.ty;
12061206

12071207
// Erase the regions from `ty` to get a global type. The

src/librustc_mir/build/expr/into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
246246
mutability: Mutability::Mut,
247247
ty: ptr_ty,
248248
name: None,
249-
syntactic_source_info: source_info,
249+
source_info,
250250
visibility_scope: source_info.scope,
251251
internal: true,
252252
is_user_variable: false

src/librustc_mir/build/matches/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -306,26 +306,26 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
306306
-> Option<SourceScope> {
307307
assert!(!(visibility_scope.is_some() && lint_level.is_explicit()),
308308
"can't have both a visibility and a lint scope at the same time");
309-
let mut syntactic_scope = self.source_scope;
309+
let mut scope = self.source_scope;
310310
self.visit_bindings(pattern, &mut |this, mutability, name, var, span, ty| {
311311
if visibility_scope.is_none() {
312312
visibility_scope = Some(this.new_source_scope(scope_span,
313313
LintLevel::Inherited,
314314
None));
315315
// If we have lints, create a new source scope
316316
// that marks the lints for the locals. See the comment
317-
// on the `syntactic_source_info` field for why this is needed.
317+
// on the `source_info` field for why this is needed.
318318
if lint_level.is_explicit() {
319-
syntactic_scope =
319+
scope =
320320
this.new_source_scope(scope_span, lint_level, None);
321321
}
322322
}
323-
let syntactic_source_info = SourceInfo {
323+
let source_info = SourceInfo {
324324
span,
325-
scope: syntactic_scope,
325+
scope,
326326
};
327327
let visibility_scope = visibility_scope.unwrap();
328-
this.declare_binding(syntactic_source_info, visibility_scope, mutability, name, var,
328+
this.declare_binding(source_info, visibility_scope, mutability, name, var,
329329
ty, has_guard);
330330
});
331331
visibility_scope
@@ -1114,7 +1114,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
11141114
/// `&T`. The second local is a binding for occurrences of `var`
11151115
/// in the arm body, which will have type `T`.
11161116
fn declare_binding(&mut self,
1117-
syntactic_source_info: SourceInfo,
1117+
source_info: SourceInfo,
11181118
visibility_scope: SourceScope,
11191119
mutability: Mutability,
11201120
name: Name,
@@ -1123,15 +1123,15 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
11231123
has_guard: ArmHasGuard)
11241124
{
11251125
debug!("declare_binding(var_id={:?}, name={:?}, var_ty={:?}, visibility_scope={:?}, \
1126-
syntactic_source_info={:?})",
1127-
var_id, name, var_ty, visibility_scope, syntactic_source_info);
1126+
source_info={:?})",
1127+
var_id, name, var_ty, visibility_scope, source_info);
11281128

11291129
let tcx = self.hir.tcx();
11301130
let local = LocalDecl::<'tcx> {
11311131
mutability,
11321132
ty: var_ty.clone(),
11331133
name: Some(name),
1134-
syntactic_source_info,
1134+
source_info,
11351135
visibility_scope,
11361136
internal: false,
11371137
is_user_variable: true,
@@ -1143,7 +1143,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
11431143
mutability,
11441144
ty: tcx.mk_imm_ref(tcx.types.re_empty, var_ty),
11451145
name: Some(name),
1146-
syntactic_source_info,
1146+
source_info,
11471147
visibility_scope,
11481148
internal: false,
11491149
is_user_variable: true,

0 commit comments

Comments
 (0)