File tree Expand file tree Collapse file tree 8 files changed +44
-99
lines changed Expand file tree Collapse file tree 8 files changed +44
-99
lines changed Original file line number Diff line number Diff line change @@ -1979,7 +1979,6 @@ ui/issues/issue-27997.rs
19791979ui/issues/issue-28105.rs
19801980ui/issues/issue-28109.rs
19811981ui/issues/issue-28181.rs
1982- ui/issues/issue-2823.rs
19831982ui/issues/issue-28279.rs
19841983ui/issues/issue-28344.rs
19851984ui/issues/issue-28433.rs
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use ignore::Walk;
1717const 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
2222const EXPECTED_TEST_FILE_EXTENSIONS : & [ & str ] = & [
2323 "rs" , // test source files
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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
1526fn 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}
Original file line number Diff line number Diff line change 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...
77LL | 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
1629For more information about this error, try `rustc --explain E0599`.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments