Use DUMMY_SP in less places

Fixes #845
This commit is contained in:
bjorn3 2020-01-04 17:49:00 +01:00
parent ca92695a2c
commit c5a7fca527
3 changed files with 4 additions and 2 deletions

View File

@ -501,7 +501,7 @@ fn trans_stmt<'tcx>(
assert!(lval
.layout()
.ty
.is_sized(fx.tcx.at(DUMMY_SP), ParamEnv::reveal_all()));
.is_sized(fx.tcx.at(stmt.source_info.span), ParamEnv::reveal_all()));
let ty_size = fx.layout_of(fx.monomorphize(ty)).size.bytes();
let val = CValue::const_val(fx, fx.tcx.types.usize, ty_size.into());
lval.write_cvalue(fx, val);

View File

@ -1,5 +1,7 @@
use std::borrow::Cow;
use syntax::source_map::DUMMY_SP;
use rustc::mir::interpret::{
read_target_uint, AllocId, Allocation, ConstValue, GlobalAlloc, InterpResult, Scalar,
};

View File

@ -64,7 +64,7 @@ mod prelude {
pub use std::convert::{TryFrom, TryInto};
pub use syntax::ast::{FloatTy, IntTy, UintTy};
pub use syntax::source_map::{Pos, Span, DUMMY_SP};
pub use syntax::source_map::{Pos, Span};
pub use rustc::bug;
pub use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE};