diff options
Diffstat (limited to 'src/test/ui/missing-trait-bounds')
12 files changed, 0 insertions, 208 deletions
diff --git a/src/test/ui/missing-trait-bounds/auxiliary/issue-69725.rs b/src/test/ui/missing-trait-bounds/auxiliary/issue-69725.rs deleted file mode 100644 index 13606e498..000000000 --- a/src/test/ui/missing-trait-bounds/auxiliary/issue-69725.rs +++ /dev/null @@ -1,8 +0,0 @@ -#[derive(Clone)] -pub struct Struct<A>(A); - -impl<A> Struct<A> { - pub fn new() -> Self { - todo!() - } -} diff --git a/src/test/ui/missing-trait-bounds/issue-35677.fixed b/src/test/ui/missing-trait-bounds/issue-35677.fixed deleted file mode 100644 index 08174d8d8..000000000 --- a/src/test/ui/missing-trait-bounds/issue-35677.fixed +++ /dev/null @@ -1,11 +0,0 @@ -// run-rustfix -#![allow(dead_code)] -use std::collections::HashSet; -use std::hash::Hash; - -fn is_subset<T>(this: &HashSet<T>, other: &HashSet<T>) -> bool where T: Eq, T: Hash { - this.is_subset(other) - //~^ ERROR the method -} - -fn main() {} diff --git a/src/test/ui/missing-trait-bounds/issue-35677.rs b/src/test/ui/missing-trait-bounds/issue-35677.rs deleted file mode 100644 index 2cb394386..000000000 --- a/src/test/ui/missing-trait-bounds/issue-35677.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-rustfix -#![allow(dead_code)] -use std::collections::HashSet; -use std::hash::Hash; - -fn is_subset<T>(this: &HashSet<T>, other: &HashSet<T>) -> bool { - this.is_subset(other) - //~^ ERROR the method -} - -fn main() {} diff --git a/src/test/ui/missing-trait-bounds/issue-35677.stderr b/src/test/ui/missing-trait-bounds/issue-35677.stderr deleted file mode 100644 index a2201b946..000000000 --- a/src/test/ui/missing-trait-bounds/issue-35677.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0599]: the method `is_subset` exists for reference `&HashSet<T>`, but its trait bounds were not satisfied - --> $DIR/issue-35677.rs:7:10 - | -LL | this.is_subset(other) - | ^^^^^^^^^ method cannot be called on `&HashSet<T>` due to unsatisfied trait bounds - | - = note: the following trait bounds were not satisfied: - `T: Eq` - `T: Hash` -help: consider restricting the type parameters to satisfy the trait bounds - | -LL | fn is_subset<T>(this: &HashSet<T>, other: &HashSet<T>) -> bool where T: Eq, T: Hash { - | ++++++++++++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/missing-trait-bounds/issue-69725.fixed b/src/test/ui/missing-trait-bounds/issue-69725.fixed deleted file mode 100644 index d57badcfd..000000000 --- a/src/test/ui/missing-trait-bounds/issue-69725.fixed +++ /dev/null @@ -1,13 +0,0 @@ -// run-rustfix -// aux-build:issue-69725.rs -#![allow(dead_code)] - -extern crate issue_69725; -use issue_69725::Struct; - -fn crash<A>() where A: Clone { - let _ = Struct::<A>::new().clone(); - //~^ ERROR: the method -} - -fn main() {} diff --git a/src/test/ui/missing-trait-bounds/issue-69725.rs b/src/test/ui/missing-trait-bounds/issue-69725.rs deleted file mode 100644 index 9c88969c5..000000000 --- a/src/test/ui/missing-trait-bounds/issue-69725.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-rustfix -// aux-build:issue-69725.rs -#![allow(dead_code)] - -extern crate issue_69725; -use issue_69725::Struct; - -fn crash<A>() { - let _ = Struct::<A>::new().clone(); - //~^ ERROR: the method -} - -fn main() {} diff --git a/src/test/ui/missing-trait-bounds/issue-69725.stderr b/src/test/ui/missing-trait-bounds/issue-69725.stderr deleted file mode 100644 index 980d9dd16..000000000 --- a/src/test/ui/missing-trait-bounds/issue-69725.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0599]: the method `clone` exists for struct `Struct<A>`, but its trait bounds were not satisfied - --> $DIR/issue-69725.rs:9:32 - | -LL | let _ = Struct::<A>::new().clone(); - | ^^^^^ method cannot be called on `Struct<A>` due to unsatisfied trait bounds - | - ::: $DIR/auxiliary/issue-69725.rs:2:1 - | -LL | pub struct Struct<A>(A); - | -------------------- doesn't satisfy `Struct<A>: Clone` - | - = note: the following trait bounds were not satisfied: - `A: Clone` - which is required by `Struct<A>: Clone` -help: consider restricting the type parameter to satisfy the trait bound - | -LL | fn crash<A>() where A: Clone { - | ++++++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.fixed b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.fixed deleted file mode 100644 index 6b24375e4..000000000 --- a/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.fixed +++ /dev/null @@ -1,7 +0,0 @@ -// run-rustfix - -pub fn foo<T: std::cmp::PartialEq>(s: &[T], t: &[T]) { - let _ = s == t; //~ ERROR binary operation `==` cannot be applied to type `&[T]` -} - -fn main() {} diff --git a/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.rs b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.rs deleted file mode 100644 index df47be070..000000000 --- a/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.rs +++ /dev/null @@ -1,7 +0,0 @@ -// run-rustfix - -pub fn foo<T>(s: &[T], t: &[T]) { - let _ = s == t; //~ ERROR binary operation `==` cannot be applied to type `&[T]` -} - -fn main() {} diff --git a/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.stderr b/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.stderr deleted file mode 100644 index cde075501..000000000 --- a/src/test/ui/missing-trait-bounds/missing-trait-bound-for-op.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0369]: binary operation `==` cannot be applied to type `&[T]` - --> $DIR/missing-trait-bound-for-op.rs:4:15 - | -LL | let _ = s == t; - | - ^^ - &[T] - | | - | &[T] - | -help: consider restricting type parameter `T` - | -LL | pub fn foo<T: std::cmp::PartialEq>(s: &[T], t: &[T]) { - | +++++++++++++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.rs b/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.rs deleted file mode 100644 index afd47f71c..000000000 --- a/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.rs +++ /dev/null @@ -1,31 +0,0 @@ -#[derive(Default, PartialEq)] -struct Foo<T> { - bar: Box<[T]>, -} - -trait Bar { - fn foo(&self) {} -} - -impl<T: Default + Bar> Bar for Foo<T> {} - -impl<T> Foo<T> { - fn bar(&self) { - self.foo(); - //~^ ERROR the method - } -} - -struct Fin<T> where T: Bar { - bar: Box<[T]>, -} - -impl<T: Default + Bar> Bar for Fin<T> {} - -impl<T: Bar> Fin<T> { - fn bar(&self) { - self.foo(); - //~^ ERROR the method - } -} -fn main() {} diff --git a/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr b/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr deleted file mode 100644 index 9e94aa2c7..000000000 --- a/src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr +++ /dev/null @@ -1,52 +0,0 @@ -error[E0599]: the method `foo` exists for reference `&Foo<T>`, but its trait bounds were not satisfied - --> $DIR/missing-trait-bounds-for-method-call.rs:14:14 - | -LL | struct Foo<T> { - | ------------- doesn't satisfy `Foo<T>: Bar` -... -LL | self.foo(); - | ^^^ method cannot be called on `&Foo<T>` due to unsatisfied trait bounds - | -note: trait bound `T: Default` was not satisfied - --> $DIR/missing-trait-bounds-for-method-call.rs:10:9 - | -LL | impl<T: Default + Bar> Bar for Foo<T> {} - | ^^^^^^^ --- ------ - | | - | unsatisfied trait bound introduced here -note: trait bound `T: Bar` was not satisfied - --> $DIR/missing-trait-bounds-for-method-call.rs:10:19 - | -LL | impl<T: Default + Bar> Bar for Foo<T> {} - | ^^^ --- ------ - | | - | unsatisfied trait bound introduced here -help: consider restricting the type parameters to satisfy the trait bounds - | -LL | struct Foo<T> where T: Bar, T: Default { - | ++++++++++++++++++++++++ - -error[E0599]: the method `foo` exists for reference `&Fin<T>`, but its trait bounds were not satisfied - --> $DIR/missing-trait-bounds-for-method-call.rs:27:14 - | -LL | struct Fin<T> where T: Bar { - | ------------- doesn't satisfy `Fin<T>: Bar` -... -LL | self.foo(); - | ^^^ method cannot be called on `&Fin<T>` due to unsatisfied trait bounds - | -note: trait bound `T: Default` was not satisfied - --> $DIR/missing-trait-bounds-for-method-call.rs:23:9 - | -LL | impl<T: Default + Bar> Bar for Fin<T> {} - | ^^^^^^^ --- ------ - | | - | unsatisfied trait bound introduced here -help: consider restricting the type parameter to satisfy the trait bound - | -LL | struct Fin<T> where T: Bar, T: Default { - | ++++++++++++ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0599`. |