Skip to content

Commit 6756561

Browse files
committed
fix test after rebase
1 parent c95210f commit 6756561

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

tests/ui/suggestions/derive-clone-already-present-issue-146515.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
use std::rc::Rc;
44

5-
#[derive(Clone)]
6-
struct ContainsRc<T> {
5+
#[derive(Clone)] //~ NOTE in this expansion
6+
struct ContainsRc<T> { //~ NOTE derive introduces an implicit `T: Clone` bound
77
value: Rc<T>,
88
}
99

@@ -14,7 +14,6 @@ fn clone_me<T>(x: &ContainsRc<T>) -> ContainsRc<T> {
1414
//~| NOTE expected `ContainsRc<T>`, found `&ContainsRc<T>`
1515
//~| NOTE expected struct `ContainsRc<_>`
1616
//~| NOTE `ContainsRc<T>` does not implement `Clone`, so `&ContainsRc<T>` was cloned instead
17-
//~| NOTE the trait `Clone` must be implemented
1817
}
1918

2019
fn main() {}

tests/ui/suggestions/derive-clone-already-present-issue-146515.stderr

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ note: `ContainsRc<T>` does not implement `Clone`, so `&ContainsRc<T>` was cloned
1414
|
1515
LL | x.clone()
1616
| ^
17-
= help: `Clone` is not implemented because the trait bound `T: Clone` is not satisfied
18-
note: the trait `Clone` must be implemented
19-
--> $SRC_DIR/core/src/clone.rs:LL:COL
17+
help: `Clone` is not implemented because a trait bound is not satisfied
18+
--> $DIR/derive-clone-already-present-issue-146515.rs:6:19
19+
|
20+
LL | #[derive(Clone)]
21+
| ----- in this derive macro expansion
22+
LL | struct ContainsRc<T> {
23+
| ^ derive introduces an implicit `T: Clone` bound
24+
= help: consider manually implementing `Clone` to avoid the implicit type parameter bounds
2025

2126
error: aborting due to 1 previous error
2227

0 commit comments

Comments
 (0)