From d45f6db5ee7dca4f1c5efa153b4fbe4e5d27a74c Mon Sep 17 00:00:00 2001 From: Caio Date: Tue, 20 Sep 2022 12:31:11 -0300 Subject: Move some tests to more reasonable directories --- src/test/ui/async-await/issue-73541-3.rs | 9 +++ src/test/ui/async-await/issue-73541-3.stderr | 12 ++++ src/test/ui/async-await/issue-73541.rs | 9 +++ src/test/ui/async-await/issue-73541.stderr | 14 ++++ src/test/ui/issues/issue-3563-2.rs | 14 ---- src/test/ui/issues/issue-43784-supertrait.rs | 10 --- src/test/ui/issues/issue-43784-supertrait.stderr | 19 ------ src/test/ui/issues/issue-73541-3.rs | 9 --- src/test/ui/issues/issue-73541-3.stderr | 12 ---- src/test/ui/issues/issue-73541.rs | 9 --- src/test/ui/issues/issue-73541.stderr | 14 ---- src/test/ui/span/issue-7575.rs | 75 ---------------------- src/test/ui/span/issue-7575.stderr | 82 ------------------------ src/test/ui/traits/issue-43784-supertrait.rs | 10 +++ src/test/ui/traits/issue-43784-supertrait.stderr | 19 ++++++ 15 files changed, 73 insertions(+), 244 deletions(-) create mode 100644 src/test/ui/async-await/issue-73541-3.rs create mode 100644 src/test/ui/async-await/issue-73541-3.stderr create mode 100644 src/test/ui/async-await/issue-73541.rs create mode 100644 src/test/ui/async-await/issue-73541.stderr delete mode 100644 src/test/ui/issues/issue-3563-2.rs delete mode 100644 src/test/ui/issues/issue-43784-supertrait.rs delete mode 100644 src/test/ui/issues/issue-43784-supertrait.stderr delete mode 100644 src/test/ui/issues/issue-73541-3.rs delete mode 100644 src/test/ui/issues/issue-73541-3.stderr delete mode 100644 src/test/ui/issues/issue-73541.rs delete mode 100644 src/test/ui/issues/issue-73541.stderr delete mode 100644 src/test/ui/span/issue-7575.rs delete mode 100644 src/test/ui/span/issue-7575.stderr create mode 100644 src/test/ui/traits/issue-43784-supertrait.rs create mode 100644 src/test/ui/traits/issue-43784-supertrait.stderr (limited to 'src/test') diff --git a/src/test/ui/async-await/issue-73541-3.rs b/src/test/ui/async-await/issue-73541-3.rs new file mode 100644 index 00000000000..02ca02da8ed --- /dev/null +++ b/src/test/ui/async-await/issue-73541-3.rs @@ -0,0 +1,9 @@ +fn main() { + 'aaaaab: loop { + || { + loop { continue 'aaaaaa } + //~^ ERROR use of undeclared label `'aaaaaa` + }; + + } +} diff --git a/src/test/ui/async-await/issue-73541-3.stderr b/src/test/ui/async-await/issue-73541-3.stderr new file mode 100644 index 00000000000..53487aaca99 --- /dev/null +++ b/src/test/ui/async-await/issue-73541-3.stderr @@ -0,0 +1,12 @@ +error[E0426]: use of undeclared label `'aaaaaa` + --> $DIR/issue-73541-3.rs:4:29 + | +LL | 'aaaaab: loop { + | ------- a label with a similar name exists but is unreachable +LL | || { +LL | loop { continue 'aaaaaa } + | ^^^^^^^ undeclared label `'aaaaaa` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0426`. diff --git a/src/test/ui/async-await/issue-73541.rs b/src/test/ui/async-await/issue-73541.rs new file mode 100644 index 00000000000..399a07cd3fc --- /dev/null +++ b/src/test/ui/async-await/issue-73541.rs @@ -0,0 +1,9 @@ +fn main() { + 'a: loop { + || { + loop { continue 'a } + //~^ ERROR use of unreachable label `'a` + }; + + } +} diff --git a/src/test/ui/async-await/issue-73541.stderr b/src/test/ui/async-await/issue-73541.stderr new file mode 100644 index 00000000000..4bb466ff16c --- /dev/null +++ b/src/test/ui/async-await/issue-73541.stderr @@ -0,0 +1,14 @@ +error[E0767]: use of unreachable label `'a` + --> $DIR/issue-73541.rs:4:29 + | +LL | 'a: loop { + | -- unreachable label defined here +LL | || { +LL | loop { continue 'a } + | ^^ unreachable label `'a` + | + = note: labels are unreachable through functions, closures, async blocks and modules + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0767`. diff --git a/src/test/ui/issues/issue-3563-2.rs b/src/test/ui/issues/issue-3563-2.rs deleted file mode 100644 index 88a449b85b8..00000000000 --- a/src/test/ui/issues/issue-3563-2.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass -// pretty-expanded FIXME #23616 - -trait Canvas { - fn add_point(&self, point: &isize); - fn add_points(&self, shapes: &[isize]) { - for pt in shapes { - self.add_point(pt) - } - } - -} - -pub fn main() {} diff --git a/src/test/ui/issues/issue-43784-supertrait.rs b/src/test/ui/issues/issue-43784-supertrait.rs deleted file mode 100644 index 55c26ccd2da..00000000000 --- a/src/test/ui/issues/issue-43784-supertrait.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub trait Partial: Copy { -} - -pub trait Complete: Partial { -} - -impl Partial for T where T: Complete {} -impl Complete for T {} //~ ERROR the trait bound `T: Copy` is not satisfied - -fn main() {} diff --git a/src/test/ui/issues/issue-43784-supertrait.stderr b/src/test/ui/issues/issue-43784-supertrait.stderr deleted file mode 100644 index bb890cb99ee..00000000000 --- a/src/test/ui/issues/issue-43784-supertrait.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0277]: the trait bound `T: Copy` is not satisfied - --> $DIR/issue-43784-supertrait.rs:8:9 - | -LL | impl Complete for T {} - | ^^^^^^^^ the trait `Copy` is not implemented for `T` - | -note: required by a bound in `Complete` - --> $DIR/issue-43784-supertrait.rs:4:21 - | -LL | pub trait Complete: Partial { - | ^^^^^^^ required by this bound in `Complete` -help: consider restricting type parameter `T` - | -LL | impl Complete for T {} - | +++++++++++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issues/issue-73541-3.rs b/src/test/ui/issues/issue-73541-3.rs deleted file mode 100644 index 02ca02da8ed..00000000000 --- a/src/test/ui/issues/issue-73541-3.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn main() { - 'aaaaab: loop { - || { - loop { continue 'aaaaaa } - //~^ ERROR use of undeclared label `'aaaaaa` - }; - - } -} diff --git a/src/test/ui/issues/issue-73541-3.stderr b/src/test/ui/issues/issue-73541-3.stderr deleted file mode 100644 index 53487aaca99..00000000000 --- a/src/test/ui/issues/issue-73541-3.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0426]: use of undeclared label `'aaaaaa` - --> $DIR/issue-73541-3.rs:4:29 - | -LL | 'aaaaab: loop { - | ------- a label with a similar name exists but is unreachable -LL | || { -LL | loop { continue 'aaaaaa } - | ^^^^^^^ undeclared label `'aaaaaa` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0426`. diff --git a/src/test/ui/issues/issue-73541.rs b/src/test/ui/issues/issue-73541.rs deleted file mode 100644 index 399a07cd3fc..00000000000 --- a/src/test/ui/issues/issue-73541.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn main() { - 'a: loop { - || { - loop { continue 'a } - //~^ ERROR use of unreachable label `'a` - }; - - } -} diff --git a/src/test/ui/issues/issue-73541.stderr b/src/test/ui/issues/issue-73541.stderr deleted file mode 100644 index 4bb466ff16c..00000000000 --- a/src/test/ui/issues/issue-73541.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0767]: use of unreachable label `'a` - --> $DIR/issue-73541.rs:4:29 - | -LL | 'a: loop { - | -- unreachable label defined here -LL | || { -LL | loop { continue 'a } - | ^^ unreachable label `'a` - | - = note: labels are unreachable through functions, closures, async blocks and modules - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0767`. diff --git a/src/test/ui/span/issue-7575.rs b/src/test/ui/span/issue-7575.rs deleted file mode 100644 index eddd158aef0..00000000000 --- a/src/test/ui/span/issue-7575.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Test the mechanism for warning about possible missing `self` declarations. -trait CtxtFn { - fn f8(self, _: usize) -> usize; - fn f9(_: usize) -> usize; -} - -trait OtherTrait { - fn f9(_: usize) -> usize; -} - -// Note: this trait is not implemented, but we can't really tell -// whether or not an impl would match anyhow without a self -// declaration to match against, so we wind up prisizeing it as a -// candidate. This seems not unreasonable -- perhaps the user meant to -// implement it, after all. -trait UnusedTrait { - fn f9(_: usize) -> usize; -} - -impl CtxtFn for usize { - fn f8(self, i: usize) -> usize { - i * 4 - } - - fn f9(i: usize) -> usize { - i * 4 - } -} - -impl OtherTrait for usize { - fn f9(i: usize) -> usize { - i * 8 - } -} - -struct Myisize(isize); - -impl Myisize { - fn fff(i: isize) -> isize { - i - } -} - -trait ManyImplTrait { - fn is_str() -> bool { - false - } -} - -impl ManyImplTrait for String { - fn is_str() -> bool { - true - } -} - -impl ManyImplTrait for usize {} -impl ManyImplTrait for isize {} -impl ManyImplTrait for char {} -impl ManyImplTrait for Myisize {} - -fn no_param_bound(u: usize, m: Myisize) -> usize { - u.f8(42) + u.f9(342) + m.fff(42) - //~^ ERROR no method named `f9` found - //~| ERROR no method named `fff` found - - -} - -fn param_bound(t: T) -> bool { - t.is_str() - //~^ ERROR no method named `is_str` found -} - -fn main() { -} diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr deleted file mode 100644 index 4f30edb3f89..00000000000 --- a/src/test/ui/span/issue-7575.stderr +++ /dev/null @@ -1,82 +0,0 @@ -error[E0599]: no method named `f9` found for type `usize` in the current scope - --> $DIR/issue-7575.rs:62:18 - | -LL | u.f8(42) + u.f9(342) + m.fff(42) - | ^^ this is an associated function, not a method - | - = note: found the following associated functions; to be used as methods, functions must have a `self` parameter -note: candidate #1 is defined in the trait `CtxtFn` - --> $DIR/issue-7575.rs:4:5 - | -LL | fn f9(_: usize) -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: candidate #2 is defined in the trait `OtherTrait` - --> $DIR/issue-7575.rs:8:5 - | -LL | fn f9(_: usize) -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: candidate #3 is defined in the trait `UnusedTrait` - --> $DIR/issue-7575.rs:17:5 - | -LL | fn f9(_: usize) -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - = help: items from traits can only be used if the trait is implemented and in scope - = note: the following traits define an item `f9`, perhaps you need to implement one of them: - candidate #1: `CtxtFn` - candidate #2: `OtherTrait` - candidate #3: `UnusedTrait` -help: disambiguate the associated function for candidate #1 - | -LL | u.f8(42) + ::f9(u, 342) + m.fff(42) - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -help: disambiguate the associated function for candidate #2 - | -LL | u.f8(42) + ::f9(u, 342) + m.fff(42) - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -help: disambiguate the associated function for candidate #3 - | -LL | u.f8(42) + ::f9(u, 342) + m.fff(42) - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0599]: no method named `fff` found for struct `Myisize` in the current scope - --> $DIR/issue-7575.rs:62:30 - | -LL | struct Myisize(isize); - | -------------- method `fff` not found for this struct -... -LL | u.f8(42) + u.f9(342) + m.fff(42) - | --^^^ - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `Myisize::fff` - | - = note: found the following associated functions; to be used as methods, functions must have a `self` parameter -note: the candidate is defined in an impl for the type `Myisize` - --> $DIR/issue-7575.rs:39:5 - | -LL | fn fff(i: isize) -> isize { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0599]: no method named `is_str` found for type parameter `T` in the current scope - --> $DIR/issue-7575.rs:70:7 - | -LL | fn param_bound(t: T) -> bool { - | - method `is_str` not found for this type parameter -LL | t.is_str() - | ^^^^^^ this is an associated function, not a method - | - = note: found the following associated functions; to be used as methods, functions must have a `self` parameter -note: the candidate is defined in the trait `ManyImplTrait` - --> $DIR/issue-7575.rs:45:5 - | -LL | fn is_str() -> bool { - | ^^^^^^^^^^^^^^^^^^^ - = help: items from traits can only be used if the type parameter is bounded by the trait -help: disambiguate the associated function for the candidate - | -LL | ::is_str(t) - | - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/traits/issue-43784-supertrait.rs b/src/test/ui/traits/issue-43784-supertrait.rs new file mode 100644 index 00000000000..55c26ccd2da --- /dev/null +++ b/src/test/ui/traits/issue-43784-supertrait.rs @@ -0,0 +1,10 @@ +pub trait Partial: Copy { +} + +pub trait Complete: Partial { +} + +impl Partial for T where T: Complete {} +impl Complete for T {} //~ ERROR the trait bound `T: Copy` is not satisfied + +fn main() {} diff --git a/src/test/ui/traits/issue-43784-supertrait.stderr b/src/test/ui/traits/issue-43784-supertrait.stderr new file mode 100644 index 00000000000..bb890cb99ee --- /dev/null +++ b/src/test/ui/traits/issue-43784-supertrait.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `T: Copy` is not satisfied + --> $DIR/issue-43784-supertrait.rs:8:9 + | +LL | impl Complete for T {} + | ^^^^^^^^ the trait `Copy` is not implemented for `T` + | +note: required by a bound in `Complete` + --> $DIR/issue-43784-supertrait.rs:4:21 + | +LL | pub trait Complete: Partial { + | ^^^^^^^ required by this bound in `Complete` +help: consider restricting type parameter `T` + | +LL | impl Complete for T {} + | +++++++++++++++++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. -- cgit 1.4.1-3-g733a5