summaryrefslogtreecommitdiffstats
path: root/tests/incremental/inlined_hir_34991/main.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/incremental/inlined_hir_34991/main.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/incremental/inlined_hir_34991/main.rs')
-rw-r--r--tests/incremental/inlined_hir_34991/main.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/incremental/inlined_hir_34991/main.rs b/tests/incremental/inlined_hir_34991/main.rs
new file mode 100644
index 000000000..bb76a0bb8
--- /dev/null
+++ b/tests/incremental/inlined_hir_34991/main.rs
@@ -0,0 +1,23 @@
+// Regression test for #34991: an ICE occurred here because we inline
+// some of the vector routines and give them a local def-id `X`. This
+// got hashed after codegen (`hir_owner(X)`). When we load back up, we get an
+// error because the `X` is remapped to the original def-id (in
+// libstd), and we can't hash a HIR node from std.
+
+// revisions:rpass1 rpass2
+
+#![feature(rustc_attrs)]
+
+use std::vec::Vec;
+
+pub fn foo() -> Vec<i32> {
+ vec![1, 2, 3]
+}
+
+pub fn bar() {
+ foo();
+}
+
+pub fn main() {
+ bar();
+}