Skip to content

Commit a4ce307

Browse files
committed
Coalesce duplicate missing clone tests
1 parent fc2cd77 commit a4ce307

File tree

8 files changed

+44
-99
lines changed

8 files changed

+44
-99
lines changed

src/tools/tidy/src/issues.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,6 @@ ui/issues/issue-27997.rs
19791979
ui/issues/issue-28105.rs
19801980
ui/issues/issue-28109.rs
19811981
ui/issues/issue-28181.rs
1982-
ui/issues/issue-2823.rs
19831982
ui/issues/issue-28279.rs
19841983
ui/issues/issue-28344.rs
19851984
ui/issues/issue-28433.rs

src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use ignore::Walk;
1717
const ENTRY_LIMIT: u32 = 901;
1818
// FIXME: The following limits should be reduced eventually.
1919

20-
const ISSUES_ENTRY_LIMIT: u32 = 1626;
20+
const ISSUES_ENTRY_LIMIT: u32 = 1624;
2121

2222
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2323
"rs", // test source files

tests/ui/issues/issue-2823.rs

-14
This file was deleted.

tests/ui/issues/issue-2823.stderr

-16
This file was deleted.

tests/ui/methods/clone-missing.rs

+24-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
1-
// This test checks that calling `.clone()` on a type that does not implement the `Clone` trait
2-
// results in a compilation error. The `Foo` struct does not derive or implement `Clone`,
3-
// so attempting to clone it should fail.
1+
//! This test checks that calling `.clone()` on a type that does
2+
//! not implement the `Clone` trait results in a compilation error.
3+
//! The `NotClone` and AlsoNotClone structs do not derive or
4+
//! implement `Clone`, so attempting to clone them should fail.
45
5-
struct Foo {
6-
i: isize,
6+
struct NotClone {
7+
i: isize,
78
}
89

9-
fn foo(i:isize) -> Foo {
10-
Foo {
11-
i: i
10+
fn not_clone(i: isize) -> NotClone {
11+
NotClone { i }
12+
}
13+
14+
struct AlsoNotClone {
15+
i: isize,
16+
j: NotClone,
17+
}
18+
19+
fn also_not_clone(i: isize) -> AlsoNotClone {
20+
AlsoNotClone {
21+
i,
22+
j: NotClone { i: i },
1223
}
1324
}
1425

1526
fn main() {
16-
let x = foo(10);
27+
let x = not_clone(10);
28+
let _y = x.clone();
29+
//~^ ERROR no method named `clone` found
30+
31+
let x = also_not_clone(10);
1732
let _y = x.clone();
1833
//~^ ERROR no method named `clone` found
1934
}

tests/ui/methods/clone-missing.stderr

+19-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1-
error[E0599]: no method named `clone` found for struct `Foo` in the current scope
2-
--> $DIR/clone-missing.rs:17:16
1+
error[E0599]: no method named `clone` found for struct `NotClone` in the current scope
2+
--> $DIR/clone-missing.rs:28:16
33
|
4-
LL | struct Foo {
5-
| ---------- method `clone` not found for this struct
4+
LL | struct NotClone {
5+
| --------------- method `clone` not found for this struct
66
...
77
LL | let _y = x.clone();
8-
| ^^^^^ method not found in `Foo`
8+
| ^^^^^ method not found in `NotClone`
99
|
1010
= help: items from traits can only be used if the trait is implemented and in scope
1111
= note: the following trait defines an item `clone`, perhaps you need to implement it:
1212
candidate #1: `Clone`
1313

14-
error: aborting due to 1 previous error
14+
error[E0599]: no method named `clone` found for struct `AlsoNotClone` in the current scope
15+
--> $DIR/clone-missing.rs:32:16
16+
|
17+
LL | struct AlsoNotClone {
18+
| ------------------- method `clone` not found for this struct
19+
...
20+
LL | let _y = x.clone();
21+
| ^^^^^ method not found in `AlsoNotClone`
22+
|
23+
= help: items from traits can only be used if the trait is implemented and in scope
24+
= note: the following trait defines an item `clone`, perhaps you need to implement it:
25+
candidate #1: `Clone`
26+
27+
error: aborting due to 2 previous errors
1528

1629
For more information about this error, try `rustc --explain E0599`.

tests/ui/noncopyable-class.rs

-36
This file was deleted.

tests/ui/noncopyable-class.stderr

-16
This file was deleted.

0 commit comments

Comments
 (0)