about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/crashes/135470.rs40
-rw-r--r--tests/crashes/135528.rs18
-rw-r--r--tests/crashes/135570.rs12
-rw-r--r--tests/crashes/135617.rs13
-rw-r--r--tests/crashes/135646.rs5
-rw-r--r--tests/crashes/135668.rs38
-rw-r--r--tests/crashes/135718.rs50
-rw-r--r--tests/crashes/135720.rs4
-rw-r--r--tests/crashes/135845.rs6
-rw-r--r--tests/crashes/135863.rs10
-rw-r--r--tests/crashes/136063.rs6
11 files changed, 202 insertions, 0 deletions
diff --git a/tests/crashes/135470.rs b/tests/crashes/135470.rs
new file mode 100644
index 00000000000..7d357a9317f
--- /dev/null
+++ b/tests/crashes/135470.rs
@@ -0,0 +1,40 @@
+//@ known-bug: #135470
+//@ compile-flags: --edition=2021 -Copt-level=0
+
+use std::future::Future;
+trait Access {
+    type Lister;
+
+    fn list() -> impl Future<Output = Self::Lister> {
+        async { todo!() }
+    }
+}
+
+trait Foo {}
+impl Access for dyn Foo {
+    type Lister = ();
+}
+
+fn main() {
+    let svc = async {
+        async { <dyn Foo>::list() }.await;
+    };
+    &svc as &dyn Service;
+}
+
+trait UnaryService {
+    fn call2() {}
+}
+trait Unimplemented {}
+impl<T: Unimplemented> UnaryService for T {}
+struct Wrap<T>(T);
+impl<T: Send> UnaryService for Wrap<T> {}
+
+trait Service {
+    fn call(&self);
+}
+impl<T: Send> Service for T {
+    fn call(&self) {
+        Wrap::<T>::call2();
+    }
+}
diff --git a/tests/crashes/135528.rs b/tests/crashes/135528.rs
new file mode 100644
index 00000000000..a1418f40be6
--- /dev/null
+++ b/tests/crashes/135528.rs
@@ -0,0 +1,18 @@
+//@ known-bug: #135528
+//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes
+#![feature(type_alias_impl_trait)]
+type Tait = impl Copy;
+
+fn set(x: &isize) -> isize {
+    *x
+}
+
+fn d(x: Tait) {
+    set(x);
+}
+
+fn other_define() -> Tait {
+    ()
+}
+
+fn main() {}
diff --git a/tests/crashes/135570.rs b/tests/crashes/135570.rs
new file mode 100644
index 00000000000..a9eda97ef9d
--- /dev/null
+++ b/tests/crashes/135570.rs
@@ -0,0 +1,12 @@
+//@ known-bug: #135570
+//@compile-flags: -Zvalidate-mir -Zmir-enable-passes=+Inline -Copt-level=0 -Zmir-enable-passes=+GVN
+//@ only-x86_64
+
+fn function_with_bytes<const BYTES: &'static [u8; 0xc7b889180b67b07d_bc1a3c88783d35b5_u128]>(
+) -> &'static [u8] {
+    BYTES
+}
+
+fn main() {
+    function_with_bytes::<b"aa">() == &[];
+}
diff --git a/tests/crashes/135617.rs b/tests/crashes/135617.rs
new file mode 100644
index 00000000000..ac524b823a0
--- /dev/null
+++ b/tests/crashes/135617.rs
@@ -0,0 +1,13 @@
+//@ known-bug: #135617
+trait Project {
+    const ASSOC: usize;
+}
+
+fn foo()
+where
+    for<'a> (): Project,
+{
+    [(); <() as Project>::ASSOC];
+}
+
+pub fn main() {}
diff --git a/tests/crashes/135646.rs b/tests/crashes/135646.rs
new file mode 100644
index 00000000000..67b0ad93db4
--- /dev/null
+++ b/tests/crashes/135646.rs
@@ -0,0 +1,5 @@
+//@ known-bug: #135646
+//@ compile-flags: --edition=2024 -Zpolonius=next
+fn main() {
+    &{ [1, 2, 3][4] };
+}
diff --git a/tests/crashes/135668.rs b/tests/crashes/135668.rs
new file mode 100644
index 00000000000..8126a65606b
--- /dev/null
+++ b/tests/crashes/135668.rs
@@ -0,0 +1,38 @@
+//@ known-bug: #135668
+//@ compile-flags: --edition=2021
+use std::future::Future;
+
+pub async fn foo() {
+    let _ = create_task().await;
+}
+
+async fn create_task() -> impl Sized {
+    bind(documentation)
+}
+
+async fn documentation() {
+    include_str!("nonexistent");
+}
+
+fn bind<F>(_filter: F) -> impl Sized
+where
+    F: FilterBase,
+{
+    || -> <F as FilterBase>::Assoc { panic!() }
+}
+
+trait FilterBase {
+    type Assoc;
+}
+
+impl<F, R> FilterBase for F
+where
+    F: Fn() -> R,
+    // Removing the below line makes it correctly error on both stable and beta
+    R: Future,
+    // Removing the below line makes it ICE on both stable and beta
+    R: Send,
+    // Removing the above two bounds makes it ICE on stable but correctly error on beta
+{
+    type Assoc = F;
+}
diff --git a/tests/crashes/135718.rs b/tests/crashes/135718.rs
new file mode 100644
index 00000000000..c0e628f4c46
--- /dev/null
+++ b/tests/crashes/135718.rs
@@ -0,0 +1,50 @@
+//@ known-bug: #135718
+
+struct Equal;
+
+struct Bar;
+
+trait TwiceNested {}
+impl<M> TwiceNested for Bar where Bar: NestMakeEqual<NestEq = M> {}
+
+struct Sum;
+
+trait Not {
+    fn not();
+}
+
+impl<P> Not for Sum
+where
+    Bar: NestMakeEqual<NestEq = P>,
+    Self: Problem<P>,
+{
+    fn not() {}
+}
+
+trait NestMakeEqual {
+    type NestEq;
+}
+
+trait MakeEqual {
+    type Eq;
+}
+
+struct Foo;
+impl MakeEqual for Foo {
+    type Eq = Equal;
+}
+
+impl<O> NestMakeEqual for Bar
+where
+    Foo: MakeEqual<Eq = O>,
+{
+    type NestEq = O;
+}
+
+trait Problem<M> {}
+impl Problem<()> for Sum where Bar: TwiceNested {}
+impl Problem<Equal> for Sum where Bar: TwiceNested {}
+
+fn main() {
+    Sum::not();
+}
diff --git a/tests/crashes/135720.rs b/tests/crashes/135720.rs
new file mode 100644
index 00000000000..ee85bc4b66a
--- /dev/null
+++ b/tests/crashes/135720.rs
@@ -0,0 +1,4 @@
+//@ known-bug: #135720
+#![feature(generic_const_exprs)]
+type S<'l> = [i32; A];
+fn lint_me(x: S<()>) {}
diff --git a/tests/crashes/135845.rs b/tests/crashes/135845.rs
new file mode 100644
index 00000000000..ed038d8a1f1
--- /dev/null
+++ b/tests/crashes/135845.rs
@@ -0,0 +1,6 @@
+//@ known-bug: #135845
+struct S<'a, T: ?Sized>(&'a T);
+
+fn b<'a>() -> S<'static, _> {
+    S::<'a>(&0)
+}
diff --git a/tests/crashes/135863.rs b/tests/crashes/135863.rs
new file mode 100644
index 00000000000..a0ff5988a0d
--- /dev/null
+++ b/tests/crashes/135863.rs
@@ -0,0 +1,10 @@
+//@ known-bug: #135863
+struct A;
+
+impl A {
+    fn len(self: &&B) {}
+}
+
+fn main() {
+    A.len()
+}
diff --git a/tests/crashes/136063.rs b/tests/crashes/136063.rs
new file mode 100644
index 00000000000..078cc59dfa2
--- /dev/null
+++ b/tests/crashes/136063.rs
@@ -0,0 +1,6 @@
+//@ known-bug: #136063
+#![feature(generic_const_exprs)]
+trait A<const B: u8 = X> {}
+impl A<1> for bool {}
+fn bar(arg : &dyn A<x>) { bar(true) }
+pub fn main() {}