summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-13434.rs
blob: 1b7d3e20173a7f31e1069a8841d7c6273efa8bec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// run-pass
#[derive(Debug)]
struct MyStruct;

trait Repro {
  fn repro(self, s: MyStruct) -> String;
}

impl<F> Repro for F where F: FnOnce(MyStruct) -> String {
  fn repro(self, s: MyStruct) -> String {
    self(s)
  }
}

fn do_stuff<R: Repro>(r: R) -> String {
  r.repro(MyStruct)
}

pub fn main() {
  assert_eq!("MyStruct".to_string(), do_stuff(|s: MyStruct| format!("{:?}", s)));
}