Debian Codegraph @

gcc/testsuite/rust/compile/issue-2747.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 #[lang = "fn_once"]
5 pub trait FnOnce<Args> {
6 #[lang = "fn_once_output"]
7 type Output;
8
9 extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
10 }
11
12 struct Foo<'a, 'b: 'a> {
13 x: &'a i32,
14 y: &'a i32,
15 a: &'b i32,
16 q: &'a [&'b i32],
17 }
18
19 pub fn test<'x, 'y>(f: Foo<'x, 'y, ()>) {
20 // { dg-error "generic item takes at most 0 type arguments but 1 were supplied" "" { target *-*-* } .-1 }
21 let x = 5;
22 let y = 6;
23 let z = 7;
24 type F<'a, 'b> = fn(&'a i32, &'b i32) -> i32;
25 let f = Foo {
26 x: &x,
27 y: &y,
28 a: &z,
29 q: &[&x, &y],
30 };
31 }