diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index f1ce3ccda0465..e6b5aa59622d2 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -1979,7 +1979,6 @@ ui/issues/issue-27997.rs ui/issues/issue-28105.rs ui/issues/issue-28109.rs ui/issues/issue-28181.rs -ui/issues/issue-2823.rs ui/issues/issue-28279.rs ui/issues/issue-28344.rs ui/issues/issue-28433.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 2e069af23d653..44dd1e50f5b04 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -17,7 +17,7 @@ use ignore::Walk; const ENTRY_LIMIT: u32 = 901; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1626; +const ISSUES_ENTRY_LIMIT: u32 = 1624; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files diff --git a/tests/ui/diagnostic_namespace/on_impl_trait.rs b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.rs similarity index 75% rename from tests/ui/diagnostic_namespace/on_impl_trait.rs rename to tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.rs index 32a492c53a950..1ffa604b2bc06 100644 --- a/tests/ui/diagnostic_namespace/on_impl_trait.rs +++ b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.rs @@ -1,5 +1,6 @@ -// used to ICE, see -// Instead it should just ignore the diagnostic attribute +//! used to ICE, see +//! Instead it should just ignore the diagnostic attribute + #![feature(trait_alias)] trait Test {} diff --git a/tests/ui/diagnostic_namespace/on_impl_trait.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr similarity index 88% rename from tests/ui/diagnostic_namespace/on_impl_trait.stderr rename to tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr index 59b9c31bc53ea..5eee647892271 100644 --- a/tests/ui/diagnostic_namespace/on_impl_trait.stderr +++ b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr @@ -1,5 +1,5 @@ warning: `#[diagnostic::on_unimplemented]` can only be applied to trait definitions - --> $DIR/on_impl_trait.rs:7:1 + --> $DIR/on_impl_trait.rs:8:1 | LL | #[diagnostic::on_unimplemented(message = "blah", label = "blah", note = "blah")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | #[diagnostic::on_unimplemented(message = "blah", label = "blah", note = "bl = note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default error[E0277]: the trait bound `{integer}: Alias` is not satisfied - --> $DIR/on_impl_trait.rs:15:9 + --> $DIR/on_impl_trait.rs:16:9 | LL | foo(&1); | --- ^^ the trait `Test` is not implemented for `{integer}` @@ -15,13 +15,13 @@ LL | foo(&1); | required by a bound introduced by this call | help: this trait has no implementations, consider adding one - --> $DIR/on_impl_trait.rs:5:1 + --> $DIR/on_impl_trait.rs:6:1 | LL | trait Test {} | ^^^^^^^^^^ = note: required for `{integer}` to implement `Alias` note: required by a bound in `foo` - --> $DIR/on_impl_trait.rs:12:11 + --> $DIR/on_impl_trait.rs:13:11 | LL | fn foo(v: &T) {} | ^^^^^ required by this bound in `foo` diff --git a/tests/ui/issues/issue-2823.rs b/tests/ui/issues/issue-2823.rs deleted file mode 100644 index 7b443b4152613..0000000000000 --- a/tests/ui/issues/issue-2823.rs +++ /dev/null @@ -1,14 +0,0 @@ -struct C { - x: isize, -} - -impl Drop for C { - fn drop(&mut self) { - println!("dropping: {}", self.x); - } -} - -fn main() { - let c = C{ x: 2}; - let _d = c.clone(); //~ ERROR no method named `clone` found -} diff --git a/tests/ui/issues/issue-2823.stderr b/tests/ui/issues/issue-2823.stderr deleted file mode 100644 index 5cd3f080450d6..0000000000000 --- a/tests/ui/issues/issue-2823.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0599]: no method named `clone` found for struct `C` in the current scope - --> $DIR/issue-2823.rs:13:16 - | -LL | struct C { - | -------- method `clone` not found for this struct -... -LL | let _d = c.clone(); - | ^^^^^ method not found in `C` - | - = help: items from traits can only be used if the trait is implemented and in scope - = note: the following trait defines an item `clone`, perhaps you need to implement it: - candidate #1: `Clone` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/methods/clone-missing.rs b/tests/ui/methods/clone-missing.rs index f2e4ad268c63a..c5ecd3f175e2d 100644 --- a/tests/ui/methods/clone-missing.rs +++ b/tests/ui/methods/clone-missing.rs @@ -1,19 +1,34 @@ -// This test checks that calling `.clone()` on a type that does not implement the `Clone` trait -// results in a compilation error. The `Foo` struct does not derive or implement `Clone`, -// so attempting to clone it should fail. +//! This test checks that calling `.clone()` on a type that does +//! not implement the `Clone` trait results in a compilation error. +//! The `NotClone` and AlsoNotClone structs do not derive or +//! implement `Clone`, so attempting to clone them should fail. -struct Foo { - i: isize, +struct NotClone { + i: isize, } -fn foo(i:isize) -> Foo { - Foo { - i: i +fn not_clone(i: isize) -> NotClone { + NotClone { i } +} + +struct AlsoNotClone { + i: isize, + j: NotClone, +} + +fn also_not_clone(i: isize) -> AlsoNotClone { + AlsoNotClone { + i, + j: NotClone { i: i }, } } fn main() { - let x = foo(10); + let x = not_clone(10); + let _y = x.clone(); + //~^ ERROR no method named `clone` found + + let x = also_not_clone(10); let _y = x.clone(); //~^ ERROR no method named `clone` found } diff --git a/tests/ui/methods/clone-missing.stderr b/tests/ui/methods/clone-missing.stderr index 4ab1aae4934bf..8676e73c8ca25 100644 --- a/tests/ui/methods/clone-missing.stderr +++ b/tests/ui/methods/clone-missing.stderr @@ -1,16 +1,29 @@ -error[E0599]: no method named `clone` found for struct `Foo` in the current scope - --> $DIR/clone-missing.rs:17:16 +error[E0599]: no method named `clone` found for struct `NotClone` in the current scope + --> $DIR/clone-missing.rs:28:16 | -LL | struct Foo { - | ---------- method `clone` not found for this struct +LL | struct NotClone { + | --------------- method `clone` not found for this struct ... LL | let _y = x.clone(); - | ^^^^^ method not found in `Foo` + | ^^^^^ method not found in `NotClone` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: candidate #1: `Clone` -error: aborting due to 1 previous error +error[E0599]: no method named `clone` found for struct `AlsoNotClone` in the current scope + --> $DIR/clone-missing.rs:32:16 + | +LL | struct AlsoNotClone { + | ------------------- method `clone` not found for this struct +... +LL | let _y = x.clone(); + | ^^^^^ method not found in `AlsoNotClone` + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `clone`, perhaps you need to implement it: + candidate #1: `Clone` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/noncopyable-class.rs b/tests/ui/noncopyable-class.rs deleted file mode 100644 index 11b6eb736e9db..0000000000000 --- a/tests/ui/noncopyable-class.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Test that a class with a non-copyable field can't be -// copied - -#[derive(Debug)] -struct Bar { - x: isize, -} - -impl Drop for Bar { - fn drop(&mut self) {} -} - -fn bar(x:isize) -> Bar { - Bar { - x: x - } -} - -#[derive(Debug)] -struct Foo { - i: isize, - j: Bar, -} - -fn foo(i:isize) -> Foo { - Foo { - i: i, - j: bar(5) - } -} - -fn main() { - let x = foo(10); - let _y = x.clone(); //~ ERROR no method named `clone` found - println!("{:?}", x); -} diff --git a/tests/ui/noncopyable-class.stderr b/tests/ui/noncopyable-class.stderr deleted file mode 100644 index b8f7276c898f8..0000000000000 --- a/tests/ui/noncopyable-class.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0599]: no method named `clone` found for struct `Foo` in the current scope - --> $DIR/noncopyable-class.rs:34:16 - | -LL | struct Foo { - | ---------- method `clone` not found for this struct -... -LL | let _y = x.clone(); - | ^^^^^ method not found in `Foo` - | - = help: items from traits can only be used if the trait is implemented and in scope - = note: the following trait defines an item `clone`, perhaps you need to implement it: - candidate #1: `Clone` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/tests/ui/on-unimplemented/expected-comma-found-token.rs b/tests/ui/on-unimplemented/expected-comma-found-token.rs index 8fb34f21152ab..d60ab3341fd6d 100644 --- a/tests/ui/on-unimplemented/expected-comma-found-token.rs +++ b/tests/ui/on-unimplemented/expected-comma-found-token.rs @@ -1,7 +1,6 @@ -// Tests that two closures cannot simultaneously have mutable -// access to the variable, whether that mutable access be used -// for direct assignment or for taking mutable ref. Issue #6801. +//! Test for invalid MetaItem syntax in the attribute +#![crate_type = "lib"] #![feature(rustc_attrs)] #[rustc_on_unimplemented( @@ -9,5 +8,3 @@ label="the label" //~ ERROR expected `,`, found `label` )] trait T {} - -fn main() { } diff --git a/tests/ui/on-unimplemented/expected-comma-found-token.stderr b/tests/ui/on-unimplemented/expected-comma-found-token.stderr index 7c0874e36a6a9..2717100a1dc64 100644 --- a/tests/ui/on-unimplemented/expected-comma-found-token.stderr +++ b/tests/ui/on-unimplemented/expected-comma-found-token.stderr @@ -1,5 +1,5 @@ error: expected `,`, found `label` - --> $DIR/expected-comma-found-token.rs:9:5 + --> $DIR/expected-comma-found-token.rs:8:5 | LL | message="the message" | - expected `,`