about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-07-20 11:29:39 +0530
committerGitHub <noreply@github.com>2022-07-20 11:29:39 +0530
commitf02bbbcba6faf0fddce6ded97dea6f934d0f642b (patch)
treea2a2fa2a27cf79a57ea7987dae2bba2cfae1775a /src
parent80395679cb123099ef53f94b9d514729720e136c (diff)
parent0065929599d276ce756a55948e8316615be1e7ec (diff)
downloadrust-f02bbbcba6faf0fddce6ded97dea6f934d0f642b.tar.gz
rust-f02bbbcba6faf0fddce6ded97dea6f934d0f642b.zip
Rollup merge of #99433 - cjgillot:erase-foreign-sig, r=compiler-errors
Erase regions before comparing signatures of foreign fns.

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

The version with explicit lifetimes is probably tracked in another bug, but I could not find it.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/foreign/issue-99276-same-type-lifetimes.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/foreign/issue-99276-same-type-lifetimes.rs b/src/test/ui/foreign/issue-99276-same-type-lifetimes.rs
new file mode 100644
index 00000000000..fce603c801f
--- /dev/null
+++ b/src/test/ui/foreign/issue-99276-same-type-lifetimes.rs
@@ -0,0 +1,24 @@
+// Check that we do not ICE when structurally comparing types with lifetimes present.
+// check-pass
+
+pub struct Record<'a> {
+    pub args: &'a [(usize, &'a str)],
+}
+
+mod a {
+    extern "Rust" {
+        fn foo<'a, 'b>(record: &'a super::Record<'b>);
+
+        fn bar<'a, 'b>(record: &'a super::Record<'b>);
+    }
+}
+
+mod b {
+    extern "Rust" {
+        fn foo<'a, 'b>(record: &'a super::Record<'b>);
+
+        fn bar<'a, 'b>(record: &'a super::Record<'b>);
+    }
+}
+
+fn main() {}