]> git.proxmox.com Git - rustc.git/blob - src/test/ui/generics/mid-path-type-params.rs
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / generics / mid-path-type-params.rs
1 // run-pass
2
3 #![allow(dead_code)]
4 // pretty-expanded FIXME #23616
5
6 struct S<T> {
7 contents: T,
8 }
9
10 impl<T> S<T> {
11 fn new<U>(x: T, _: U) -> S<T> {
12 S {
13 contents: x,
14 }
15 }
16 }
17
18 trait Trait<T> {
19 fn new<U>(x: T, y: U) -> Self;
20 }
21
22 struct S2 {
23 contents: isize,
24 }
25
26 impl Trait<isize> for S2 {
27 fn new<U>(x: isize, _: U) -> S2 {
28 S2 {
29 contents: x,
30 }
31 }
32 }
33
34 pub fn main() {
35 let _ = S::<isize>::new::<f64>(1, 1.0);
36 let _: S2 = Trait::<isize>::new::<f64>(1, 1.0);
37 }