summary refs log tree commit diff
path: root/src/test/ui/recursion
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-06-15 12:01:01 +0200
committerGitHub <noreply@github.com>2020-06-15 12:01:01 +0200
commitf9c8a67593abd24ee7f6ccd23becbffd97d21379 (patch)
tree991e8fa98b1c948cb6219028c68b0fabda05c95b /src/test/ui/recursion
parentd97e8ca33524399620aef1c0053f8b593bfbf521 (diff)
parent2210abea71270867fe2c69782f282c654e106fac (diff)
downloadrust-f9c8a67593abd24ee7f6ccd23becbffd97d21379.tar.gz
rust-f9c8a67593abd24ee7f6ccd23becbffd97d21379.zip
Rollup merge of #72879 - RalfJung:miri-tctx-at, r=oli-obk
Miri: avoid tracking current location three times

Miri tracks the current instruction to execute in the call stack, but it also additionally has two `TyCtxtAt` that carry a `Span` that also tracks the current instruction. That is quite silly, so this PR uses `TyCtxt` instead, and then uses a method for computing the current span when a `TyCtxtAt` is needed. Having less redundant (semi-)global state seems like a good improvement to me. :D

To keep the ConstProp errors the same, I had to add the option to `error_to_const_error` to overwrite the span. Also for some reason this changes cycle errors a bit -- not sure if we are now better or worse as giving those queries the right span. (It is unfortunately quite easy to accidentally use `DUMMY_SP` by calling the query on a `TyCtxt` instead of a `TyCtxtAt`.)

r? @oli-obk @eddyb
Diffstat (limited to 'src/test/ui/recursion')
-rw-r--r--src/test/ui/recursion/recursive-static-definition.stderr4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/recursion/recursive-static-definition.stderr b/src/test/ui/recursion/recursive-static-definition.stderr
index b724c261a7c..093606e100c 100644
--- a/src/test/ui/recursion/recursive-static-definition.stderr
+++ b/src/test/ui/recursion/recursive-static-definition.stderr
@@ -1,8 +1,8 @@
 error[E0391]: cycle detected when const-evaluating `FOO`
-  --> $DIR/recursive-static-definition.rs:1:23
+  --> $DIR/recursive-static-definition.rs:1:1
    |
 LL | pub static FOO: u32 = FOO;
-   |                       ^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: ...which requires const-evaluating `FOO`...
   --> $DIR/recursive-static-definition.rs:1:1