File tree 8 files changed +44
-99
lines changed
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
1979
1979
ui/issues/issue-28105.rs
1980
1980
ui/issues/issue-28109.rs
1981
1981
ui/issues/issue-28181.rs
1982
- ui/issues/issue-2823.rs
1983
1982
ui/issues/issue-28279.rs
1984
1983
ui/issues/issue-28344.rs
1985
1984
ui/issues/issue-28433.rs
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use ignore::Walk;
17
17
const ENTRY_LIMIT : u32 = 901 ;
18
18
// FIXME: The following limits should be reduced eventually.
19
19
20
- const ISSUES_ENTRY_LIMIT : u32 = 1626 ;
20
+ const ISSUES_ENTRY_LIMIT : u32 = 1624 ;
21
21
22
22
const EXPECTED_TEST_FILE_EXTENSIONS : & [ & str ] = & [
23
23
"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.
4
5
5
- struct Foo {
6
- i : isize ,
6
+ struct NotClone {
7
+ i : isize ,
7
8
}
8
9
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 } ,
12
23
}
13
24
}
14
25
15
26
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 ) ;
17
32
let _y = x. clone ( ) ;
18
33
//~^ ERROR no method named `clone` found
19
34
}
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
3
3
|
4
- LL | struct Foo {
5
- | ---------- method `clone` not found for this struct
4
+ LL | struct NotClone {
5
+ | --------------- method `clone` not found for this struct
6
6
...
7
7
LL | let _y = x.clone();
8
- | ^^^^^ method not found in `Foo `
8
+ | ^^^^^ method not found in `NotClone `
9
9
|
10
10
= help: items from traits can only be used if the trait is implemented and in scope
11
11
= note: the following trait defines an item `clone`, perhaps you need to implement it:
12
12
candidate #1: `Clone`
13
13
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
15
28
16
29
For 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