File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ #[ derive( Clone ) ]
2+ pub struct Struct < A > ( A ) ;
3+
4+ impl < A > Struct < A > {
5+ pub fn new ( ) -> Self {
6+ todo ! ( )
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ // aux-build:issue-69725.rs
2+
3+ extern crate issue_69725;
4+ use issue_69725:: Struct ;
5+
6+ fn crash < A > ( ) {
7+ let _ = Struct :: < A > :: new ( ) . clone ( ) ;
8+ //~^ ERROR: no method named `clone` found
9+ }
10+
11+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0599]: no method named `clone` found for struct `issue_69725::Struct<A>` in the current scope
2+ --> $DIR/issue-69725.rs:7:32
3+ |
4+ LL | let _ = Struct::<A>::new().clone();
5+ | ^^^^^ method not found in `issue_69725::Struct<A>`
6+ |
7+ ::: $DIR/auxiliary/issue-69725.rs:2:1
8+ |
9+ LL | pub struct Struct<A>(A);
10+ | ------------------------ doesn't satisfy `issue_69725::Struct<A>: std::clone::Clone`
11+ |
12+ = note: the method `clone` exists but the following trait bounds were not satisfied:
13+ `A: std::clone::Clone`
14+ which is required by `issue_69725::Struct<A>: std::clone::Clone`
15+
16+ error: aborting due to previous error
17+
18+ For more information about this error, try `rustc --explain E0599`.
You can’t perform that action at this time.
0 commit comments