]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-15094.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / 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 signature `extern "rust-call" fn
14     //~| found signature `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 }