提交 60496504 编写于 作者: R Ralf Jung

avoid computing precise span for const_eval query

上级 32b01c78
......@@ -860,7 +860,7 @@ pub(super) fn const_eval(
} else {
self.param_env
};
let val = self.tcx.const_eval_global_id(param_env, gid, Some(self.cur_span()))?;
let val = self.tcx.const_eval_global_id(param_env, gid, Some(self.root_span))?;
// Even though `ecx.const_eval` is called from `eval_const_to_op` we can never have a
// recursion deeper than one level, because the `tcx.const_eval` above is guaranteed to not
......
......@@ -17,8 +17,8 @@ LL | bytes: [u8; std::mem::size_of::<Foo>()]
note: ...which requires const-evaluating `std::mem::size_of`...
--> $SRC_DIR/libcore/mem/mod.rs:LL:COL
|
LL | intrinsics::size_of::<T>()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | pub const fn size_of<T>() -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `std::intrinsics::size_of`...
--> $SRC_DIR/libcore/intrinsics.rs:LL:COL
|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册