about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-05-05 08:24:37 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-05-05 09:02:43 +0000
commita75d559e24ed648acb3a95677b2f1fae5c2ac419 (patch)
treeccf93308f58fd7ef904119af89616a841bcead3e
parentc227d85021a4e5eaaac002af2c9d24b9f20ebed4 (diff)
downloadrust-a75d559e24ed648acb3a95677b2f1fae5c2ac419.tar.gz
rust-a75d559e24ed648acb3a95677b2f1fae5c2ac419.zip
Add known bug cases
-rw-r--r--src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs24
-rw-r--r--src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.stderr32
-rw-r--r--src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs13
-rw-r--r--src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.stderr10
4 files changed, 79 insertions, 0 deletions
diff --git a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs
new file mode 100644
index 00000000000..9ad7cad39d0
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs
@@ -0,0 +1,24 @@
+// known-bug
+// failure-status: 101
+// compile-flags: --edition=2021 --crate-type=lib
+// rustc-env:RUST_BACKTRACE=0
+
+// normalize-stderr-test "thread 'rustc' panicked.*" -> "thread 'rustc' panicked"
+// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
+// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
+// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
+// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
+// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
+// normalize-stderr-test "note: rustc.*running on.*\n\n" -> ""
+// normalize-stderr-test "#.*\n" -> ""
+// normalize-stderr-test ".*delayed.*\n" -> ""
+
+// tracked in https://github.com/rust-lang/rust/issues/96572
+
+#![feature(type_alias_impl_trait)]
+
+fn main() {
+    type T = impl Copy;
+    let foo: T = (1u32, 2u32);
+    let (a, b): (u32, u32) = foo;
+}
diff --git a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.stderr b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.stderr
new file mode 100644
index 00000000000..84d2705bf24
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.stderr
@@ -0,0 +1,32 @@
+error: internal compiler error: no errors encountered even though `delay_span_bug` issued
+
+error: internal compiler error: broken MIR in DefId(0:3 ~ cross_inference_pattern_bug[646d]::main) ((_1.0: u32)): can't project out of PlaceTy { ty: main::T, variant_index: None }
+  --> $DIR/cross_inference_pattern_bug.rs:23:10
+   |
+LL |     let (a, b): (u32, u32) = foo;
+   |          ^
+   |
+
+error: internal compiler error: TyKind::Error constructed but no error reported
+   |
+
+error: internal compiler error: TyKind::Error constructed but no error reported
+   |
+
+error: internal compiler error: broken MIR in DefId(0:3 ~ cross_inference_pattern_bug[646d]::main) ((_1.1: u32)): can't project out of PlaceTy { ty: main::T, variant_index: None }
+  --> $DIR/cross_inference_pattern_bug.rs:23:13
+   |
+LL |     let (a, b): (u32, u32) = foo;
+   |             ^
+   |
+
+error: internal compiler error: TyKind::Error constructed but no error reported
+   |
+
+error: internal compiler error: TyKind::Error constructed but no error reported
+   |
+
+thread 'rustc' panicked
+
+query stack during panic:
+end of query stack
diff --git a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs
new file mode 100644
index 00000000000..179f525de52
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs
@@ -0,0 +1,13 @@
+// known-bug
+// compile-flags: --edition=2021 --crate-type=lib
+// rustc-env:RUST_BACKTRACE=0
+
+// tracked in https://github.com/rust-lang/rust/issues/96572
+
+#![feature(type_alias_impl_trait)]
+
+fn main() {
+    type T = impl Copy;  // error: unconstrained opaque type
+    let foo: T = (1u32, 2u32);
+    let (a, b) = foo; // removing this line makes the code compile
+}
diff --git a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.stderr b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.stderr
new file mode 100644
index 00000000000..8aa1f495639
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.stderr
@@ -0,0 +1,10 @@
+error: unconstrained opaque type
+  --> $DIR/cross_inference_pattern_bug_no_type.rs:10:14
+   |
+LL |     type T = impl Copy;  // error: unconstrained opaque type
+   |              ^^^^^^^^^
+   |
+   = note: `T` must be used in combination with a concrete type within the same module
+
+error: aborting due to previous error
+