Skip to content

Commit 3d67649

Browse files
committed
Add a regression test
1 parent 1631b4d commit 3d67649

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#[derive(Clone)]
2+
pub struct Struct<A>(A);
3+
4+
impl<A> Struct<A> {
5+
pub fn new() -> Self {
6+
todo!()
7+
}
8+
}

src/test/ui/issues/issue-69725.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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() {}

src/test/ui/issues/issue-69725.stderr

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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`.

0 commit comments

Comments
 (0)