summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/inductive-overflow
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/traits/inductive-overflow')
-rw-r--r--src/test/ui/traits/inductive-overflow/lifetime.rs32
-rw-r--r--src/test/ui/traits/inductive-overflow/lifetime.stderr22
-rw-r--r--src/test/ui/traits/inductive-overflow/simultaneous.rs20
-rw-r--r--src/test/ui/traits/inductive-overflow/simultaneous.stderr20
-rw-r--r--src/test/ui/traits/inductive-overflow/supertrait-auto-trait.rs18
-rw-r--r--src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr35
-rw-r--r--src/test/ui/traits/inductive-overflow/supertrait.rs15
-rw-r--r--src/test/ui/traits/inductive-overflow/supertrait.stderr20
-rw-r--r--src/test/ui/traits/inductive-overflow/two-traits.rs22
-rw-r--r--src/test/ui/traits/inductive-overflow/two-traits.stderr32
10 files changed, 0 insertions, 236 deletions
diff --git a/src/test/ui/traits/inductive-overflow/lifetime.rs b/src/test/ui/traits/inductive-overflow/lifetime.rs
deleted file mode 100644
index 004e47737..000000000
--- a/src/test/ui/traits/inductive-overflow/lifetime.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-// Test that we don't hit the recursion limit for short cycles involving lifetimes.
-
-// Shouldn't hit this, we should realize that we're in a cycle sooner.
-#![recursion_limit="20"]
-
-trait NotAuto {}
-trait Y {
- type P;
-}
-
-impl<'a> Y for C<'a> {
- type P = Box<X<C<'a>>>;
-}
-
-struct C<'a>(&'a ());
-struct X<T: Y>(T::P);
-
-impl<T: NotAuto> NotAuto for Box<T> {} //~ NOTE: required
-impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
-impl<'a> NotAuto for C<'a> {}
-
-fn is_send<S: NotAuto>() {}
-//~^ NOTE: required
-//~| NOTE: required
-
-fn main() {
- // Should only be a few notes.
- is_send::<X<C<'static>>>();
- //~^ ERROR overflow evaluating
- //~| 3 redundant requirements hidden
- //~| required for
-}
diff --git a/src/test/ui/traits/inductive-overflow/lifetime.stderr b/src/test/ui/traits/inductive-overflow/lifetime.stderr
deleted file mode 100644
index b72d53bdd..000000000
--- a/src/test/ui/traits/inductive-overflow/lifetime.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0275]: overflow evaluating the requirement `X<C<'_>>: NotAuto`
- --> $DIR/lifetime.rs:28:5
- |
-LL | is_send::<X<C<'static>>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: required for `Box<X<C<'_>>>` to implement `NotAuto`
- --> $DIR/lifetime.rs:18:18
- |
-LL | impl<T: NotAuto> NotAuto for Box<T> {}
- | ^^^^^^^ ^^^^^^
- = note: 3 redundant requirements hidden
- = note: required for `X<C<'static>>` to implement `NotAuto`
-note: required by a bound in `is_send`
- --> $DIR/lifetime.rs:22:15
- |
-LL | fn is_send<S: NotAuto>() {}
- | ^^^^^^^ required by this bound in `is_send`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0275`.
diff --git a/src/test/ui/traits/inductive-overflow/simultaneous.rs b/src/test/ui/traits/inductive-overflow/simultaneous.rs
deleted file mode 100644
index 40ac92146..000000000
--- a/src/test/ui/traits/inductive-overflow/simultaneous.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Regression test for #33344, initial version. This example allowed
-// arbitrary trait bounds to be synthesized.
-
-trait Tweedledum: IntoIterator {}
-trait Tweedledee: IntoIterator {}
-
-impl<T: Tweedledum> Tweedledee for T {}
-impl<T: Tweedledee> Tweedledum for T {}
-
-trait Combo: IntoIterator {}
-impl<T: Tweedledee + Tweedledum> Combo for T {}
-
-fn is_ee<T: Combo>(t: T) {
- t.into_iter();
-}
-
-fn main() {
- is_ee(4);
- //~^ ERROR overflow evaluating the requirement `{integer}: Tweedle
-}
diff --git a/src/test/ui/traits/inductive-overflow/simultaneous.stderr b/src/test/ui/traits/inductive-overflow/simultaneous.stderr
deleted file mode 100644
index 09930e60e..000000000
--- a/src/test/ui/traits/inductive-overflow/simultaneous.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0275]: overflow evaluating the requirement `{integer}: Tweedledum`
- --> $DIR/simultaneous.rs:18:5
- |
-LL | is_ee(4);
- | ^^^^^
- |
-note: required for `{integer}` to implement `Combo`
- --> $DIR/simultaneous.rs:11:34
- |
-LL | impl<T: Tweedledee + Tweedledum> Combo for T {}
- | ^^^^^ ^
-note: required by a bound in `is_ee`
- --> $DIR/simultaneous.rs:13:13
- |
-LL | fn is_ee<T: Combo>(t: T) {
- | ^^^^^ required by this bound in `is_ee`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0275`.
diff --git a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.rs b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.rs
deleted file mode 100644
index 5fea47a1b..000000000
--- a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Auto-trait-based version of #29859, supertrait version. Test that using
-// a simple auto trait `..` impl alone still doesn't allow arbitrary bounds
-// to be synthesized.
-
-#![feature(auto_traits)]
-#![feature(negative_impls)]
-
-auto trait Magic: Copy {} //~ ERROR E0568
-
-fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
-
-#[derive(Debug)]
-struct NoClone;
-
-fn main() {
- let (a, b) = copy(NoClone); //~ ERROR
- println!("{:?} {:?}", a, b);
-}
diff --git a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
deleted file mode 100644
index 3ec288d13..000000000
--- a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error[E0568]: auto traits cannot have super traits or lifetime bounds
- --> $DIR/supertrait-auto-trait.rs:8:17
- |
-LL | auto trait Magic: Copy {}
- | -----^^^^^^ help: remove the super traits or lifetime bounds
- | |
- | auto trait cannot have super traits or lifetime bounds
-
-error[E0277]: the trait bound `NoClone: Copy` is not satisfied
- --> $DIR/supertrait-auto-trait.rs:16:23
- |
-LL | let (a, b) = copy(NoClone);
- | ---- ^^^^^^^ the trait `Copy` is not implemented for `NoClone`
- | |
- | required by a bound introduced by this call
- |
-note: required for `NoClone` to implement `Magic`
- --> $DIR/supertrait-auto-trait.rs:8:12
- |
-LL | auto trait Magic: Copy {}
- | ^^^^^
-note: required by a bound in `copy`
- --> $DIR/supertrait-auto-trait.rs:10:12
- |
-LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
- | ^^^^^ required by this bound in `copy`
-help: consider annotating `NoClone` with `#[derive(Copy)]`
- |
-LL | #[derive(Copy)]
- |
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0277, E0568.
-For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/traits/inductive-overflow/supertrait.rs b/src/test/ui/traits/inductive-overflow/supertrait.rs
deleted file mode 100644
index c7aa4d90f..000000000
--- a/src/test/ui/traits/inductive-overflow/supertrait.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Regression test for #29859, supertrait version. This example
-// allowed arbitrary trait bounds to be synthesized.
-
-trait Magic: Copy {}
-impl<T: Magic> Magic for T {}
-
-fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
-
-#[derive(Debug)]
-struct NoClone;
-
-fn main() {
- let (a, b) = copy(NoClone); //~ ERROR E0275
- println!("{:?} {:?}", a, b);
-}
diff --git a/src/test/ui/traits/inductive-overflow/supertrait.stderr b/src/test/ui/traits/inductive-overflow/supertrait.stderr
deleted file mode 100644
index 4b862cf79..000000000
--- a/src/test/ui/traits/inductive-overflow/supertrait.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0275]: overflow evaluating the requirement `NoClone: Magic`
- --> $DIR/supertrait.rs:13:18
- |
-LL | let (a, b) = copy(NoClone);
- | ^^^^
- |
-note: required for `NoClone` to implement `Magic`
- --> $DIR/supertrait.rs:5:16
- |
-LL | impl<T: Magic> Magic for T {}
- | ^^^^^ ^
-note: required by a bound in `copy`
- --> $DIR/supertrait.rs:7:12
- |
-LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
- | ^^^^^ required by this bound in `copy`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0275`.
diff --git a/src/test/ui/traits/inductive-overflow/two-traits.rs b/src/test/ui/traits/inductive-overflow/two-traits.rs
deleted file mode 100644
index 463b55d85..000000000
--- a/src/test/ui/traits/inductive-overflow/two-traits.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Regression test for #29859, initial version. This example allowed
-// arbitrary trait bounds to be synthesized.
-
-// Trait that you want all types to implement.
-use std::marker::{Sync as Trait};
-
-pub trait Magic {
- type X: Trait;
-}
-impl<T: Magic> Magic for T {
- type X = Self;
- //~^ ERROR E0277
-}
-
-fn check<T: Trait>() {}
-
-fn wizard<T: Magic>() { check::<<T as Magic>::X>(); }
-
-fn main() {
- wizard::<*mut ()>(); //~ ERROR E0275
- // check::<*mut ()>();
-}
diff --git a/src/test/ui/traits/inductive-overflow/two-traits.stderr b/src/test/ui/traits/inductive-overflow/two-traits.stderr
deleted file mode 100644
index 0d0bf8861..000000000
--- a/src/test/ui/traits/inductive-overflow/two-traits.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0277]: `T` cannot be shared between threads safely
- --> $DIR/two-traits.rs:11:14
- |
-LL | type X = Self;
- | ^^^^ `T` cannot be shared between threads safely
- |
-note: required by a bound in `Magic::X`
- --> $DIR/two-traits.rs:8:13
- |
-LL | type X: Trait;
- | ^^^^^ required by this bound in `Magic::X`
-help: consider further restricting this bound
- |
-LL | impl<T: Magic + std::marker::Sync> Magic for T {
- | +++++++++++++++++++
-
-error[E0275]: overflow evaluating the requirement `*mut (): Magic`
- --> $DIR/two-traits.rs:20:5
- |
-LL | wizard::<*mut ()>();
- | ^^^^^^^^^^^^^^^^^
- |
-note: required by a bound in `wizard`
- --> $DIR/two-traits.rs:17:14
- |
-LL | fn wizard<T: Magic>() { check::<<T as Magic>::X>(); }
- | ^^^^^ required by this bound in `wizard`
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0275, E0277.
-For more information about an error, try `rustc --explain E0275`.