summaryrefslogtreecommitdiffstats
path: root/src/test/ui/trait-bounds
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/trait-bounds
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/trait-bounds')
-rw-r--r--src/test/ui/trait-bounds/impl-bound-with-references-error.rs20
-rw-r--r--src/test/ui/trait-bounds/impl-bound-with-references-error.stderr24
-rw-r--r--src/test/ui/trait-bounds/impl-derived-implicit-sized-bound-2.rs33
-rw-r--r--src/test/ui/trait-bounds/impl-derived-implicit-sized-bound-2.stderr31
-rw-r--r--src/test/ui/trait-bounds/impl-derived-implicit-sized-bound.rs36
-rw-r--r--src/test/ui/trait-bounds/impl-derived-implicit-sized-bound.stderr31
-rw-r--r--src/test/ui/trait-bounds/impl-missing-where-clause-lifetimes-from-trait.rs38
-rw-r--r--src/test/ui/trait-bounds/impl-missing-where-clause-lifetimes-from-trait.stderr36
-rw-r--r--src/test/ui/trait-bounds/issue-75961.rs7
-rw-r--r--src/test/ui/trait-bounds/issue-93008.rs15
-rw-r--r--src/test/ui/trait-bounds/issue-94680.rs14
-rw-r--r--src/test/ui/trait-bounds/issue-94999.rs34
-rw-r--r--src/test/ui/trait-bounds/issue-95640.rs31
-rw-r--r--src/test/ui/trait-bounds/mismatch-fn-trait.rs28
-rw-r--r--src/test/ui/trait-bounds/mismatch-fn-trait.stderr81
-rw-r--r--src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed16
-rw-r--r--src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs14
-rw-r--r--src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr19
-rw-r--r--src/test/ui/trait-bounds/unsized-bound.rs32
-rw-r--r--src/test/ui/trait-bounds/unsized-bound.stderr273
20 files changed, 0 insertions, 813 deletions
diff --git a/src/test/ui/trait-bounds/impl-bound-with-references-error.rs b/src/test/ui/trait-bounds/impl-bound-with-references-error.rs
deleted file mode 100644
index e5d0a1aae..000000000
--- a/src/test/ui/trait-bounds/impl-bound-with-references-error.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Regression test for #105138.
-// This test ensures that the compiler does not add note
-// for implementation of trait whose inner type is erroneous.
-
-pub enum LabelText {
- Plain,
-}
-
-impl<T> From<T> for LabelText
-//~^ ERROR conflicting implementations of trait `From<LabelText>` for type `LabelText` [E0119]
-where
- T: Into<Cow<'static, str>>,
- //~^ ERROR cannot find type `Cow` in this scope [E0412]
-{
- fn from(text: T) -> Self {
- LabelText::Plain(text.into())
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/trait-bounds/impl-bound-with-references-error.stderr b/src/test/ui/trait-bounds/impl-bound-with-references-error.stderr
deleted file mode 100644
index 95fd6bd50..000000000
--- a/src/test/ui/trait-bounds/impl-bound-with-references-error.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error[E0412]: cannot find type `Cow` in this scope
- --> $DIR/impl-bound-with-references-error.rs:12:13
- |
-LL | T: Into<Cow<'static, str>>,
- | ^^^ not found in this scope
- |
-help: consider importing this enum
- |
-LL | use std::borrow::Cow;
- |
-
-error[E0119]: conflicting implementations of trait `From<LabelText>` for type `LabelText`
- --> $DIR/impl-bound-with-references-error.rs:9:1
- |
-LL | impl<T> From<T> for LabelText
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: conflicting implementation in crate `core`:
- - impl<T> From<T> for T;
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0119, E0412.
-For more information about an error, try `rustc --explain E0119`.
diff --git a/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound-2.rs b/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound-2.rs
deleted file mode 100644
index 557d89088..000000000
--- a/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound-2.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-struct Victim<'a, T: Perpetrator + ?Sized> {
- value: u8,
- perp: &'a T,
-}
-
-trait VictimTrait {
- type Ret;
- fn get(self) -> Self::Ret;
-}
-
-// Actual fix is here
-impl<'a, T: Perpetrator /*+ ?Sized*/> VictimTrait for Victim<'a, T> {
- type Ret = u8;
- fn get(self) -> Self::Ret {
- self.value
- }
-}
-
-trait Perpetrator {
- fn getter<'a>(&'a self) -> Victim<'a, Self> {
- Victim {
- value: 0,
- perp: self,
- }
- }
-
- fn trigger(&self) {
- self.getter().get();
- //~^ ERROR the method `get` exists for struct `Victim<'_, Self>`, but its trait bounds were not satisfied
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound-2.stderr b/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound-2.stderr
deleted file mode 100644
index 543ceac8e..000000000
--- a/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound-2.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0599]: the method `get` exists for struct `Victim<'_, Self>`, but its trait bounds were not satisfied
- --> $DIR/impl-derived-implicit-sized-bound-2.rs:28:19
- |
-LL | struct Victim<'a, T: Perpetrator + ?Sized> {
- | ------------------------------------------
- | |
- | method `get` not found for this struct
- | doesn't satisfy `Victim<'_, Self>: VictimTrait`
-...
-LL | self.getter().get();
- | ^^^ method cannot be called on `Victim<'_, Self>` due to unsatisfied trait bounds
- |
-note: trait bound `Self: Sized` was not satisfied
- --> $DIR/impl-derived-implicit-sized-bound-2.rs:12:10
- |
-LL | impl<'a, T: Perpetrator /*+ ?Sized*/> VictimTrait for Victim<'a, T> {
- | ^ ----------- -------------
- | |
- | unsatisfied trait bound introduced here
-help: consider relaxing the type parameter's implicit `Sized` bound
- |
-LL | impl<'a, T: ?Sized + Perpetrator /*+ ?Sized*/> VictimTrait for Victim<'a, T> {
- | ++++++++
-help: consider restricting the type parameter to satisfy the trait bound
- |
-LL | struct Victim<'a, T: Perpetrator + ?Sized> where Self: Sized {
- | +++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound.rs b/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound.rs
deleted file mode 100644
index 28da41a0c..000000000
--- a/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-struct Victim<'a, T: Perpetrator + ?Sized>
-where
- Self: Sized
-{
- value: u8,
- perp: &'a T,
-}
-
-trait VictimTrait {
- type Ret;
- fn get(self) -> Self::Ret;
-}
-
-// Actual fix is here
-impl<'a, T: Perpetrator /*+ ?Sized*/> VictimTrait for Victim<'a, T> {
- type Ret = u8;
- fn get(self) -> Self::Ret {
- self.value
- }
-}
-
-trait Perpetrator {
- fn getter<'a>(&'a self) -> Victim<'a, Self> {
- Victim {
- value: 0,
- perp: self,
- }
- }
-
- fn trigger(&self) {
- self.getter().get();
- //~^ ERROR the method `get` exists for struct `Victim<'_, Self>`, but its trait bounds were not satisfied
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound.stderr b/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound.stderr
deleted file mode 100644
index f08d68583..000000000
--- a/src/test/ui/trait-bounds/impl-derived-implicit-sized-bound.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0599]: the method `get` exists for struct `Victim<'_, Self>`, but its trait bounds were not satisfied
- --> $DIR/impl-derived-implicit-sized-bound.rs:31:19
- |
-LL | struct Victim<'a, T: Perpetrator + ?Sized>
- | ------------------------------------------
- | |
- | method `get` not found for this struct
- | doesn't satisfy `Victim<'_, Self>: VictimTrait`
-...
-LL | self.getter().get();
- | ^^^ method cannot be called on `Victim<'_, Self>` due to unsatisfied trait bounds
- |
-note: trait bound `Self: Sized` was not satisfied
- --> $DIR/impl-derived-implicit-sized-bound.rs:15:10
- |
-LL | impl<'a, T: Perpetrator /*+ ?Sized*/> VictimTrait for Victim<'a, T> {
- | ^ ----------- -------------
- | |
- | unsatisfied trait bound introduced here
-help: consider relaxing the type parameter's implicit `Sized` bound
- |
-LL | impl<'a, T: ?Sized + Perpetrator /*+ ?Sized*/> VictimTrait for Victim<'a, T> {
- | ++++++++
-help: consider restricting the type parameter to satisfy the trait bound
- |
-LL | Self: Sized, Self: Sized
- | +++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/trait-bounds/impl-missing-where-clause-lifetimes-from-trait.rs b/src/test/ui/trait-bounds/impl-missing-where-clause-lifetimes-from-trait.rs
deleted file mode 100644
index dcdbd0228..000000000
--- a/src/test/ui/trait-bounds/impl-missing-where-clause-lifetimes-from-trait.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-trait Trait<T> {
- fn foo<'a, K>(self, _: T, _: K) where T: 'a, K: 'a;
-}
-
-impl Trait<()> for () {
- fn foo<'a, K>(self, _: (), _: K) where { //~ ERROR E0195
- todo!();
- }
-}
-
-struct State;
-
-trait Foo<T> {
- fn foo<'a>(&self, state: &'a State) -> &'a T
- where
- T: 'a;
-}
-
-impl<F, T> Foo<T> for F
-where
- F: Fn(&State) -> &T,
-{
- fn foo<'a>(&self, state: &'a State) -> &'a T { //~ ERROR E0195
- self(state)
- }
-}
-
-trait Bar {
- fn foo<'a>(&'a self) {}
-}
-
-impl Bar for () {
- fn foo<'a: 'a>(&'a self) {} //~ ERROR E0195
-}
-
-fn main() {
- ().foo((), ());
-}
diff --git a/src/test/ui/trait-bounds/impl-missing-where-clause-lifetimes-from-trait.stderr b/src/test/ui/trait-bounds/impl-missing-where-clause-lifetimes-from-trait.stderr
deleted file mode 100644
index e26cb2216..000000000
--- a/src/test/ui/trait-bounds/impl-missing-where-clause-lifetimes-from-trait.stderr
+++ /dev/null
@@ -1,36 +0,0 @@
-error[E0195]: lifetime parameters or bounds on method `foo` do not match the trait declaration
- --> $DIR/impl-missing-where-clause-lifetimes-from-trait.rs:6:11
- |
-LL | fn foo<'a, K>(self, _: T, _: K) where T: 'a, K: 'a;
- | ------- -- -- this bound might be missing in the impl
- | | |
- | | this bound might be missing in the impl
- | lifetimes in impl do not match this method in trait
-...
-LL | fn foo<'a, K>(self, _: (), _: K) where {
- | ^^^^^^^ lifetimes do not match method in trait
-
-error[E0195]: lifetime parameters or bounds on method `foo` do not match the trait declaration
- --> $DIR/impl-missing-where-clause-lifetimes-from-trait.rs:23:11
- |
-LL | fn foo<'a>(&self, state: &'a State) -> &'a T
- | ---- lifetimes in impl do not match this method in trait
-LL | where
-LL | T: 'a;
- | -- this bound might be missing in the impl
-...
-LL | fn foo<'a>(&self, state: &'a State) -> &'a T {
- | ^^^^ lifetimes do not match method in trait
-
-error[E0195]: lifetime parameters or bounds on method `foo` do not match the trait declaration
- --> $DIR/impl-missing-where-clause-lifetimes-from-trait.rs:33:11
- |
-LL | fn foo<'a>(&'a self) {}
- | ---- lifetimes in impl do not match this method in trait
-...
-LL | fn foo<'a: 'a>(&'a self) {}
- | ^^^^^^^^ lifetimes do not match method in trait
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0195`.
diff --git a/src/test/ui/trait-bounds/issue-75961.rs b/src/test/ui/trait-bounds/issue-75961.rs
deleted file mode 100644
index 367eac718..000000000
--- a/src/test/ui/trait-bounds/issue-75961.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// check-pass
-
-pub fn foo<'a>(s: &'a mut ()) where &'a mut (): Clone {
- <&mut () as Clone>::clone(&s);
-}
-
-fn main() {}
diff --git a/src/test/ui/trait-bounds/issue-93008.rs b/src/test/ui/trait-bounds/issue-93008.rs
deleted file mode 100644
index f4d21a160..000000000
--- a/src/test/ui/trait-bounds/issue-93008.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// build-pass
-// compile-flags: -Zmir-opt-level=3 --crate-type=lib
-
-#![feature(trivial_bounds)]
-#![allow(trivial_bounds)]
-
-trait Foo {
- fn test(self);
-}
-fn baz<T>()
-where
- &'static str: Foo,
-{
- "Foo".test()
-}
diff --git a/src/test/ui/trait-bounds/issue-94680.rs b/src/test/ui/trait-bounds/issue-94680.rs
deleted file mode 100644
index 58e892079..000000000
--- a/src/test/ui/trait-bounds/issue-94680.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// check-pass
-
-fn main() {
- println!("{:?}", {
- type T = ();
-
- pub fn cloneit(it: &'_ mut T) -> (&'_ mut T, &'_ mut T)
- where
- for<'any> &'any mut T: Clone,
- {
- (it.clone(), it)
- }
- });
-}
diff --git a/src/test/ui/trait-bounds/issue-94999.rs b/src/test/ui/trait-bounds/issue-94999.rs
deleted file mode 100644
index e13190234..000000000
--- a/src/test/ui/trait-bounds/issue-94999.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-// check-pass
-
-trait Identity<Q> {
- type T;
-}
-
-impl<Q, T> Identity<Q> for T {
- type T = T;
-}
-
-trait Holds {
- type Q;
-}
-
-struct S;
-struct X(S);
-
-struct XHelper;
-
-impl Holds for X {
- type Q = XHelper;
-}
-
-impl<Q> Clone for X
-where
- <S as Identity<Q>>::T: Clone,
- X: Holds<Q = Q>,
-{
- fn clone(&self) -> Self {
- Self(self.0.clone())
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/trait-bounds/issue-95640.rs b/src/test/ui/trait-bounds/issue-95640.rs
deleted file mode 100644
index e4e998b5d..000000000
--- a/src/test/ui/trait-bounds/issue-95640.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// build-pass
-// compile-flags:-Zmir-opt-level=3
-
-struct D;
-
-trait Tr {
- type It;
- fn foo(self) -> Option<Self::It>;
-}
-
-impl<'a> Tr for &'a D {
- type It = ();
- fn foo(self) -> Option<()> {
- None
- }
-}
-
-fn run<F>(f: F)
-where
- for<'a> &'a D: Tr,
- F: Fn(<&D as Tr>::It),
-{
- let d = &D;
- while let Some(i) = d.foo() {
- f(i);
- }
-}
-
-fn main() {
- run(|_| {});
-}
diff --git a/src/test/ui/trait-bounds/mismatch-fn-trait.rs b/src/test/ui/trait-bounds/mismatch-fn-trait.rs
deleted file mode 100644
index 0ed64043a..000000000
--- a/src/test/ui/trait-bounds/mismatch-fn-trait.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-fn take(_f: impl FnMut(i32)) {}
-
-fn test1(f: impl FnMut(u32)) {
- take(f)
- //~^ ERROR [E0277]
-}
-
-fn test2(f: impl FnMut(i32, i32)) {
- take(f)
- //~^ ERROR [E0277]
-}
-
-fn test3(f: impl FnMut()) {
- take(f)
- //~^ ERROR [E0277]
-}
-
-fn test4(f: impl FnOnce(i32)) {
- take(f)
- //~^ ERROR [E0277]
-}
-
-fn test5(f: impl FnOnce(u32)) {
- take(f)
- //~^ ERROR [E0277]
-}
-
-fn main() {}
diff --git a/src/test/ui/trait-bounds/mismatch-fn-trait.stderr b/src/test/ui/trait-bounds/mismatch-fn-trait.stderr
deleted file mode 100644
index 961e6d88f..000000000
--- a/src/test/ui/trait-bounds/mismatch-fn-trait.stderr
+++ /dev/null
@@ -1,81 +0,0 @@
-error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut(u32)`
- --> $DIR/mismatch-fn-trait.rs:4:10
- |
-LL | take(f)
- | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut(u32)`
- | |
- | required by a bound introduced by this call
- |
- = note: expected a closure with arguments `(u32,)`
- found a closure with arguments `(i32,)`
-note: required by a bound in `take`
- --> $DIR/mismatch-fn-trait.rs:1:18
- |
-LL | fn take(_f: impl FnMut(i32)) {}
- | ^^^^^^^^^^ required by this bound in `take`
-
-error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut(i32, i32)`
- --> $DIR/mismatch-fn-trait.rs:9:10
- |
-LL | take(f)
- | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut(i32, i32)`
- | |
- | required by a bound introduced by this call
- |
- = note: expected a closure taking 2 arguments, but one taking 1 argument was given
-note: required by a bound in `take`
- --> $DIR/mismatch-fn-trait.rs:1:18
- |
-LL | fn take(_f: impl FnMut(i32)) {}
- | ^^^^^^^^^^ required by this bound in `take`
-
-error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut()`
- --> $DIR/mismatch-fn-trait.rs:14:10
- |
-LL | take(f)
- | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut()`
- | |
- | required by a bound introduced by this call
- |
- = note: expected a closure taking 0 arguments, but one taking 1 argument was given
-note: required by a bound in `take`
- --> $DIR/mismatch-fn-trait.rs:1:18
- |
-LL | fn take(_f: impl FnMut(i32)) {}
- | ^^^^^^^^^^ required by this bound in `take`
-
-error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnOnce(i32)`
- --> $DIR/mismatch-fn-trait.rs:19:10
- |
-LL | take(f)
- | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnOnce(i32)`
- | |
- | required by a bound introduced by this call
- |
- = note: `impl FnOnce(i32)` implements `FnOnce`, but it must implement `FnMut`, which is more general
-note: required by a bound in `take`
- --> $DIR/mismatch-fn-trait.rs:1:18
- |
-LL | fn take(_f: impl FnMut(i32)) {}
- | ^^^^^^^^^^ required by this bound in `take`
-
-error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnOnce(u32)`
- --> $DIR/mismatch-fn-trait.rs:24:10
- |
-LL | take(f)
- | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnOnce(u32)`
- | |
- | required by a bound introduced by this call
- |
- = note: `impl FnOnce(u32)` implements `FnOnce`, but it must implement `FnMut`, which is more general
- = note: expected a closure with arguments `(u32,)`
- found a closure with arguments `(i32,)`
-note: required by a bound in `take`
- --> $DIR/mismatch-fn-trait.rs:1:18
- |
-LL | fn take(_f: impl FnMut(i32)) {}
- | ^^^^^^^^^^ required by this bound in `take`
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed b/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed
deleted file mode 100644
index 39e90d7a3..000000000
--- a/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed
+++ /dev/null
@@ -1,16 +0,0 @@
-// run-rustfix
-#![allow(non_snake_case)]
-mod A {
- pub trait Trait {}
- impl Trait for i32 {}
-}
-
-mod B {
- use A::Trait;
-
-pub struct A<H: Trait>(pub H); //~ ERROR cannot find trait
-}
-
-fn main() {
- let _ = B::A(42);
-}
diff --git a/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs b/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs
deleted file mode 100644
index ee6ed0cae..000000000
--- a/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// run-rustfix
-#![allow(non_snake_case)]
-mod A {
- pub trait Trait {}
- impl Trait for i32 {}
-}
-
-mod B {
- pub struct A<H: A::Trait>(pub H); //~ ERROR cannot find trait
-}
-
-fn main() {
- let _ = B::A(42);
-}
diff --git a/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr b/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr
deleted file mode 100644
index b29766295..000000000
--- a/src/test/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0405]: cannot find trait `Trait` in `A`
- --> $DIR/shadowed-path-in-trait-bound-suggestion.rs:9:24
- |
-LL | pub struct A<H: A::Trait>(pub H);
- | ^^^^^ not found in `A`
- |
-help: consider importing this trait
- |
-LL | use A::Trait;
- |
-help: if you import `Trait`, refer to it directly
- |
-LL - pub struct A<H: A::Trait>(pub H);
-LL + pub struct A<H: Trait>(pub H);
- |
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0405`.
diff --git a/src/test/ui/trait-bounds/unsized-bound.rs b/src/test/ui/trait-bounds/unsized-bound.rs
deleted file mode 100644
index 035b8ef1b..000000000
--- a/src/test/ui/trait-bounds/unsized-bound.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-trait Trait<A> {}
-impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
-//~^ ERROR E0277
-//~| ERROR E0277
-impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
-//~^ ERROR E0277
-//~| ERROR E0277
-//~| ERROR E0277
-trait Trait2<A> {}
-impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
-//~^ ERROR E0277
-//~| ERROR E0277
-trait Trait3<A> {}
-impl<A> Trait3<A> for A where A: ?Sized {}
-//~^ ERROR E0277
-trait Trait4<A> {}
-impl<A: ?Sized> Trait4<A> for A {}
-//~^ ERROR E0277
-trait Trait5<A, B> {}
-impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
-//~^ ERROR E0277
-trait Trait6<A, B> {}
-impl<X: ?Sized, Y> Trait6<X, Y> for X {}
-//~^ ERROR E0277
-trait Trait7<A, B> {}
-impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
-//~^ ERROR E0277
-trait Trait8<A, B> {}
-impl<X, Y: ?Sized> Trait8<X, Y> for X {}
-//~^ ERROR E0277
-
-fn main() {}
diff --git a/src/test/ui/trait-bounds/unsized-bound.stderr b/src/test/ui/trait-bounds/unsized-bound.stderr
deleted file mode 100644
index ec85ada7a..000000000
--- a/src/test/ui/trait-bounds/unsized-bound.stderr
+++ /dev/null
@@ -1,273 +0,0 @@
-error[E0277]: the size for values of type `B` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:2:12
- |
-LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
- | - ^^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
- = note: required because it appears within the type `(A, B)`
-note: required by a bound in `Trait`
- --> $DIR/unsized-bound.rs:1:13
- |
-LL | trait Trait<A> {}
- | ^ required by this bound in `Trait`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
-LL + impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait<A: ?Sized> {}
- | ++++++++
-
-error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:2:30
- |
-LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
- | - ^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
- = note: only the last element of a tuple may have a dynamically sized type
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
-LL + impl<A, B> Trait<(A, B)> for (A, B) where B: ?Sized, {}
- |
-
-error[E0277]: the size for values of type `C` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:5:31
- |
-LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- | - ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
- = note: required because it appears within the type `(A, B, C)`
-note: required by a bound in `Trait`
- --> $DIR/unsized-bound.rs:1:13
- |
-LL | trait Trait<A> {}
- | ^ required by this bound in `Trait`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
-LL + impl<A, B: ?Sized, C> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait<A: ?Sized> {}
- | ++++++++
-
-error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:5:52
- |
-LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- | - ^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
- = note: only the last element of a tuple may have a dynamically sized type
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
-LL + impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) {}
- |
-
-error[E0277]: the size for values of type `B` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:5:52
- |
-LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- | - ^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
- = note: only the last element of a tuple may have a dynamically sized type
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
-LL + impl<A, B, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- |
-
-error[E0277]: the size for values of type `B` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:10:28
- |
-LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
- | - ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
- = note: required because it appears within the type `(A, B)`
-note: required by a bound in `Trait2`
- --> $DIR/unsized-bound.rs:9:14
- |
-LL | trait Trait2<A> {}
- | ^ required by this bound in `Trait2`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
-LL + impl<A: ?Sized, B> Trait2<(A, B)> for (A, B) {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait2<A: ?Sized> {}
- | ++++++++
-
-error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:10:47
- |
-LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
- | - ^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
- = note: only the last element of a tuple may have a dynamically sized type
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
-LL + impl<A, B: ?Sized> Trait2<(A, B)> for (A, B) {}
- |
-
-error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:14:9
- |
-LL | impl<A> Trait3<A> for A where A: ?Sized {}
- | - ^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
-note: required by a bound in `Trait3`
- --> $DIR/unsized-bound.rs:13:14
- |
-LL | trait Trait3<A> {}
- | ^ required by this bound in `Trait3`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A> Trait3<A> for A where A: ?Sized {}
-LL + impl<A> Trait3<A> for A {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait3<A: ?Sized> {}
- | ++++++++
-
-error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:17:17
- |
-LL | impl<A: ?Sized> Trait4<A> for A {}
- | - ^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
-note: required by a bound in `Trait4`
- --> $DIR/unsized-bound.rs:16:14
- |
-LL | trait Trait4<A> {}
- | ^ required by this bound in `Trait4`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<A: ?Sized> Trait4<A> for A {}
-LL + impl<A> Trait4<A> for A {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait4<A: ?Sized> {}
- | ++++++++
-
-error[E0277]: the size for values of type `X` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:20:12
- |
-LL | impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
- | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
-note: required by a bound in `Trait5`
- --> $DIR/unsized-bound.rs:19:14
- |
-LL | trait Trait5<A, B> {}
- | ^ required by this bound in `Trait5`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
-LL + impl<X, Y> Trait5<X, Y> for X {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait5<A: ?Sized, B> {}
- | ++++++++
-
-error[E0277]: the size for values of type `X` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:23:20
- |
-LL | impl<X: ?Sized, Y> Trait6<X, Y> for X {}
- | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
-note: required by a bound in `Trait6`
- --> $DIR/unsized-bound.rs:22:14
- |
-LL | trait Trait6<A, B> {}
- | ^ required by this bound in `Trait6`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<X: ?Sized, Y> Trait6<X, Y> for X {}
-LL + impl<X, Y> Trait6<X, Y> for X {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait6<A: ?Sized, B> {}
- | ++++++++
-
-error[E0277]: the size for values of type `Y` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:26:12
- |
-LL | impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
- | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
-note: required by a bound in `Trait7`
- --> $DIR/unsized-bound.rs:25:17
- |
-LL | trait Trait7<A, B> {}
- | ^ required by this bound in `Trait7`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
-LL + impl<X, Y> Trait7<X, Y> for X {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait7<A, B: ?Sized> {}
- | ++++++++
-
-error[E0277]: the size for values of type `Y` cannot be known at compilation time
- --> $DIR/unsized-bound.rs:29:20
- |
-LL | impl<X, Y: ?Sized> Trait8<X, Y> for X {}
- | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | this type parameter needs to be `std::marker::Sized`
- |
-note: required by a bound in `Trait8`
- --> $DIR/unsized-bound.rs:28:17
- |
-LL | trait Trait8<A, B> {}
- | ^ required by this bound in `Trait8`
-help: consider removing the `?Sized` bound to make the type parameter `Sized`
- |
-LL - impl<X, Y: ?Sized> Trait8<X, Y> for X {}
-LL + impl<X, Y> Trait8<X, Y> for X {}
- |
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Trait8<A, B: ?Sized> {}
- | ++++++++
-
-error: aborting due to 13 previous errors
-
-For more information about this error, try `rustc --explain E0277`.