about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/crashes/119701.rs21
-rw-r--r--tests/crashes/121127.rs23
-rw-r--r--tests/crashes/121411.rs13
-rw-r--r--tests/crashes/129075.rs16
-rw-r--r--tests/crashes/129127.rs21
-rw-r--r--tests/crashes/129214.rs30
-rw-r--r--tests/crashes/131294-2.rs25
-rw-r--r--tests/crashes/131294.rs16
-rw-r--r--tests/ui/const-generics/issues/issue-83765.stderr8
-rw-r--r--tests/ui/traits/const-traits/eval-bad-signature.rs (renamed from tests/crashes/112623.rs)3
-rw-r--r--tests/ui/traits/const-traits/eval-bad-signature.stderr21
11 files changed, 27 insertions, 170 deletions
diff --git a/tests/crashes/119701.rs b/tests/crashes/119701.rs
deleted file mode 100644
index bdb326ea76b..00000000000
--- a/tests/crashes/119701.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-//@ known-bug: #119701
-#![feature(const_trait_impl, generic_const_exprs)]
-
-fn main() {
-    let _ = process::<()>([()]);
-}
-
-fn process<T: const Trait>() -> [(); T::make(2)] {
-    input
-}
-
-#[const_trait]
-trait Trait {
-    fn make(input: u8) -> usize;
-}
-
-impl const Trait for () {
-    fn make(input: usize) -> usize {
-        input / 2
-    }
-}
diff --git a/tests/crashes/121127.rs b/tests/crashes/121127.rs
deleted file mode 100644
index e50dc7763fc..00000000000
--- a/tests/crashes/121127.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-//@ known-bug: #121127
-//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes -C debuginfo=2
-// Note that as of PR#123949 this only crashes with debuginfo enabled
-
-#![feature(specialization)]
-
-pub trait Foo {
-    fn abc() -> u32;
-}
-
-pub trait Marker {}
-
-impl<T> Foo for T {
-    default fn abc(f: fn(&T), t: &T) -> u32 {
-        16
-    }
-}
-
-impl<T: Marker> Foo for T {
-    fn def() -> u32 {
-        Self::abc()
-    }
-}
diff --git a/tests/crashes/121411.rs b/tests/crashes/121411.rs
deleted file mode 100644
index 2456910e6fa..00000000000
--- a/tests/crashes/121411.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ known-bug: #121411
-#![feature(const_trait_impl)]
-
-#[const_trait]
-trait Foo {
-    fn into_iter(&self) {}
-}
-
-impl const Foo for () {
-    fn into_iter(a: u32, b: u32) {}
-}
-
-const _: () = Foo::into_iter(&());
diff --git a/tests/crashes/129075.rs b/tests/crashes/129075.rs
deleted file mode 100644
index 4a0e920914c..00000000000
--- a/tests/crashes/129075.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-//@ known-bug: rust-lang/rust#129075
-//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes
-
-struct Foo<T>([T; 2]);
-
-impl<T: Default + Copy> Default for Foo<T> {
-    fn default(&mut self) -> Self {
-        Foo([Default::default(); 2])
-    }
-}
-
-fn field_array() {
-    let a: i32;
-    let b;
-    Foo([a, b]) = Default::default();
-}
diff --git a/tests/crashes/129127.rs b/tests/crashes/129127.rs
deleted file mode 100644
index 8ec848dbd05..00000000000
--- a/tests/crashes/129127.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-//@ known-bug: rust-lang/rust#129127
-//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir -Zcross-crate-inline-threshold=always
-
-
-
-
-pub struct Rows<'a>();
-
-impl<'a> Iterator for Rows<'a> {
-    type Item = ();
-
-    fn next() -> Option<Self::Item> {
-        let mut rows = Rows();
-        rows.map(|row| row).next()
-    }
-}
-
-fn main() {
-    let mut rows = Rows();
-    rows.next();
-}
diff --git a/tests/crashes/129214.rs b/tests/crashes/129214.rs
deleted file mode 100644
index e14b9f379d6..00000000000
--- a/tests/crashes/129214.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-//@ known-bug: rust-lang/rust#129214
-//@ compile-flags: -Zvalidate-mir -Copt-level=3 --crate-type=lib
-
-trait to_str {}
-
-trait map<T> {
-    fn map<U, F>(&self, f: F) -> Vec<U>
-    where
-        F: FnMut(&Box<usize>) -> U;
-}
-impl<T> map<T> for Vec<T> {
-    fn map<U, F>(&self, mut f: F) -> Vec<U>
-    where
-        F: FnMut(&T) -> U,
-    {
-        let mut r = Vec::new();
-        for i in self {
-            r.push(f(i));
-        }
-        r
-    }
-}
-
-fn foo<U, T: map<U>>(x: T) -> Vec<String> {
-    x.map(|_e| "hi".to_string())
-}
-
-pub fn main() {
-    assert_eq!(foo(vec![1]), ["hi".to_string()]);
-}
diff --git a/tests/crashes/131294-2.rs b/tests/crashes/131294-2.rs
deleted file mode 100644
index 130a8b10fb7..00000000000
--- a/tests/crashes/131294-2.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-//@ known-bug: #131294
-//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir -Zcross-crate-inline-threshold=always
-
-// https://github.com/rust-lang/rust/issues/131294#issuecomment-2395088049 second comment
-struct Rows;
-
-impl Iterator for Rows {
-    type Item = String;
-
-    fn next() -> Option<String> {
-        let args = format_args!("Hello world");
-
-        {
-            match args.as_str() {
-                Some(t) => t.to_owned(),
-                None => String::new(),
-            }
-        }
-            .into()
-    }
-}
-
-fn main() {
-    Rows.next();
-}
diff --git a/tests/crashes/131294.rs b/tests/crashes/131294.rs
deleted file mode 100644
index ec6c9567467..00000000000
--- a/tests/crashes/131294.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-//@ known-bug: #131294
-//@ compile-flags: -Zmir-opt-level=5 -Zvalidate-mir -Zcross-crate-inline-threshold=always
-
-struct Rows;
-
-impl Iterator for Rows {
-    type Item = String;
-
-    fn next() -> Option<Self::Item> {
-        std::fmt::format(format_args!("Hello world")).into()
-    }
-}
-
-fn main() {
-    Rows.next();
-}
diff --git a/tests/ui/const-generics/issues/issue-83765.stderr b/tests/ui/const-generics/issues/issue-83765.stderr
index c3292314f23..cce62749912 100644
--- a/tests/ui/const-generics/issues/issue-83765.stderr
+++ b/tests/ui/const-generics/issues/issue-83765.stderr
@@ -29,11 +29,11 @@ note: ...which requires computing candidate for `<LazyUpdim<'_, T, <T as TensorD
 LL | trait TensorDimension {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: ...which again requires resolving instance `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>::DIM`, completing the cycle
-note: cycle used when checking that `<impl at $DIR/issue-83765.rs:56:1: 56:97>` is well-formed
-  --> $DIR/issue-83765.rs:56:1
+note: cycle used when checking assoc item `<impl at $DIR/issue-83765.rs:56:1: 56:97>::bget` is compatible with trait definition
+  --> $DIR/issue-83765.rs:58:5
    |
-LL | impl<'a, T: Broadcastable, const DIM: usize> Broadcastable for LazyUpdim<'a, T, { T::DIM }, DIM> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     fn bget(&self, index: [usize; DIM]) -> Option<Self::Element> {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 error[E0308]: method not compatible with trait
diff --git a/tests/crashes/112623.rs b/tests/ui/traits/const-traits/eval-bad-signature.rs
index 592ad742e5f..97c573ea652 100644
--- a/tests/crashes/112623.rs
+++ b/tests/ui/traits/const-traits/eval-bad-signature.rs
@@ -1,4 +1,4 @@
-//@ known-bug: #112623
+// Make sure we don't ICE when evaluating a trait whose impl has a bad signature.
 
 #![feature(const_trait_impl)]
 
@@ -15,6 +15,7 @@ struct FortyTwo;
 
 impl const Value for FortyTwo {
     fn value() -> i64 {
+        //~^ ERROR method `value` has an incompatible type for trait
         42
     }
 }
diff --git a/tests/ui/traits/const-traits/eval-bad-signature.stderr b/tests/ui/traits/const-traits/eval-bad-signature.stderr
new file mode 100644
index 00000000000..a64cf631743
--- /dev/null
+++ b/tests/ui/traits/const-traits/eval-bad-signature.stderr
@@ -0,0 +1,21 @@
+error[E0053]: method `value` has an incompatible type for trait
+  --> $DIR/eval-bad-signature.rs:17:19
+   |
+LL |     fn value() -> i64 {
+   |                   ^^^ expected `u32`, found `i64`
+   |
+note: type in trait
+  --> $DIR/eval-bad-signature.rs:7:19
+   |
+LL |     fn value() -> u32;
+   |                   ^^^
+   = note: expected signature `fn() -> u32`
+              found signature `fn() -> i64`
+help: change the output type to match the trait
+   |
+LL |     fn value() -> u32 {
+   |                   ~~~
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0053`.