about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2021-10-07 20:26:14 -0700
committerGitHub <noreply@github.com>2021-10-07 20:26:14 -0700
commitaed18018410ea09de7924938e15f877bc3df4a71 (patch)
tree206bcbd5321df8c11357551346c286ac30ca270a /src/test
parent1c1c6eda94e9841d0a534ba012034b05173c6a13 (diff)
parent4028b093e468afad4896a1658924e3e3f3b8f57c (diff)
downloadrust-aed18018410ea09de7924938e15f877bc3df4a71.tar.gz
rust-aed18018410ea09de7924938e15f877bc3df4a71.zip
Rollup merge of #89476 - cjgillot:expn-id, r=petrochenkov
Correct decoding of foreign expansions during incr. comp.

Fixes https://github.com/rust-lang/rust/issues/74946

The original issue was due to a wrong assertion in `expn_hash_to_expn_id`.

The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/incremental/mir-opt.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/incremental/mir-opt.rs b/src/test/incremental/mir-opt.rs
new file mode 100644
index 00000000000..5bd863439df
--- /dev/null
+++ b/src/test/incremental/mir-opt.rs
@@ -0,0 +1,11 @@
+// MIR optimizations can create expansions after the TyCtxt has been created.
+// This test verifies that those expansions can be decoded correctly.
+
+// revisions:rpass1 rpass2
+// compile-flags: -Z query-dep-graph -Z mir-opt-level=3
+
+fn main() {
+    if std::env::var("a").is_ok() {
+        println!("b");
+    }
+}