]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-15094.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-15094.rs
1 #![feature(fn_traits, unboxed_closures)]
2
3 use std::{fmt, ops};
4
5 struct Debuger<T> {
6 x: T
7 }
8
9 impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> {
10 type Output = ();
11 fn call_once(self, _args: ()) {
12 //~^ ERROR `call_once` has an incompatible type for trait
13 //~| expected fn pointer `extern "rust-call" fn
14 //~| found fn pointer `fn
15 println!("{:?}", self.x);
16 }
17 }
18
19 fn make_shower<T>(x: T) -> Debuger<T> {
20 Debuger { x: x }
21 }
22
23 pub fn main() {
24 let show3 = make_shower(3);
25 show3();
26 }