create localdecl and add span to it · rust-lang/rust@9130484 (original) (raw)
File tree
2 files changed
lines changed
- rustc_smir/src/rustc_smir
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -106,7 +106,14 @@ impl<'tcx> Context for Tables<'tcx> { | ||
106 | 106 | .collect(), |
107 | 107 | }) |
108 | 108 | .collect(), |
109 | -locals: mir.local_decls.iter().map(|decl | |
109 | +locals: mir | |
110 | +.local_decls | |
111 | +.iter() | |
112 | +.map(|decl | |
113 | +ty: self.intern_ty(decl.ty), | |
114 | +span: decl.source_info.span.stable(self), | |
115 | +}) | |
116 | +.collect(), | |
110 | 117 | } |
111 | 118 | } |
112 | 119 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -5,7 +5,13 @@ use crate::{ty::Ty, Span}; | ||
5 | 5 | #[derive(Clone, Debug)] |
6 | 6 | pub struct Body { |
7 | 7 | pub blocks: Vec<BasicBlock>, |
8 | -pub locals: Vec<Ty>, | |
8 | +pub locals: Vec<LocalDecl>, | |
9 | +} | |
10 | + | |
11 | +#[derive(Clone, Debug)] | |
12 | +pub struct LocalDecl { | |
13 | +pub ty: Ty, | |
14 | +pub span: Span, | |
9 | 15 | } |
10 | 16 | |
11 | 17 | #[derive(Clone, Debug)] |