Skip to content

Commit 782b917

Browse files
committed
gccrs: Add test case to show we emit better errors now
Fixes #3144 gcc/testsuite/ChangeLog: * rust/compile/issue-3144.rs: New test. Signed-off-by: Philip Herron <[email protected]>
1 parent 0a66f03 commit 782b917

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#[lang = "sized"]
2+
pub trait Sized {}
3+
4+
#[lang = "copy"]
5+
trait Copy {}
6+
7+
#[lang = "clone"]
8+
pub trait Clone {
9+
fn clone(&self) -> Self;
10+
}
11+
12+
impl Clone for i32 {
13+
fn clone(&self) -> i32 {
14+
*self
15+
}
16+
}
17+
18+
struct S {}
19+
20+
#[derive(Clone, Copy)]
21+
// { dg-error {bounds not satisfied for S .Clone. is not satisfied .E0277.} "" { target *-*-* } .-1 }
22+
struct S2 {
23+
a: i32,
24+
s: S,
25+
}
26+
27+
fn main() -> i32 {
28+
0
29+
}

0 commit comments

Comments
 (0)