create localdecl and add span to it · rust-lang/rust@9130484

File tree

2 files changed

lines changed

    • rustc_smir/src/rustc_smir

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -106,7 +106,14 @@ impl<'tcx> Context for Tables<'tcx> {

106106

.collect(),

107107

})

108108

.collect(),

109-

locals: mir.local_decls.iter().map(|decl| self.intern_ty(decl.ty)).collect(),

109+

locals: mir

110+

.local_decls

111+

.iter()

112+

.map(|decl| stable_mir::mir::LocalDecl {

113+

ty: self.intern_ty(decl.ty),

114+

span: decl.source_info.span.stable(self),

115+

})

116+

.collect(),

110117

}

111118

}

112119
Original file line numberDiff line numberDiff line change

@@ -5,7 +5,13 @@ use crate::{ty::Ty, Span};

55

#[derive(Clone, Debug)]

66

pub struct Body {

77

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,

915

}

1016
1117

#[derive(Clone, Debug)]