mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
run const_eval_raw with root_span
This commit is contained in:
@@ -891,7 +891,7 @@ pub fn const_eval_raw(
|
||||
// FIXME: We can hit delay_span_bug if this is an invalid const, interning finds
|
||||
// that problem, but we never run validation to show an error. Can we ensure
|
||||
// this does not happen?
|
||||
let val = self.tcx.at(self.cur_span()).const_eval_raw(param_env.and(gid))?;
|
||||
let val = self.tcx_at().const_eval_raw(param_env.and(gid))?;
|
||||
self.raw_const_to_mplace(val)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
error[E0391]: cycle detected when const-evaluating `a`
|
||||
--> $DIR/infinite-recursion-const-fn.rs:3:25
|
||||
--> $DIR/infinite-recursion-const-fn.rs:3:1
|
||||
|
|
||||
LL | const fn a() -> usize { b() }
|
||||
| ^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires const-evaluating `b`...
|
||||
--> $DIR/infinite-recursion-const-fn.rs:4:25
|
||||
--> $DIR/infinite-recursion-const-fn.rs:4:1
|
||||
|
|
||||
LL | const fn b() -> usize { a() }
|
||||
| ^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: ...which again requires const-evaluating `a`, completing the cycle
|
||||
note: cycle used when const-evaluating `ARR::{{constant}}#0`
|
||||
--> $DIR/infinite-recursion-const-fn.rs:5:18
|
||||
|
||||
Reference in New Issue
Block a user