]> git.lizzy.rs Git - rust.git/blob - src/test/ui/function-pointer/unsized-ret.rs
Make some diagnostics not depend on the source of what they reference being available
[rust.git] / src / test / ui / function-pointer / unsized-ret.rs
1 #![feature(fn_traits)]
2 #![feature(unboxed_closures)]
3 #![feature(tuple_trait)]
4
5 fn foo<F: Fn<T>, T:std::marker::Tuple>(f: Option<F>, t: T) {
6     let y = (f.unwrap()).call(t);
7 }
8
9 fn main() {
10     foo::<fn() -> str, _>(None, ());
11     //~^ ERROR the size for values of type `str` cannot be known at compilation time
12
13     foo::<for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&(),));
14     //~^ ERROR the size for values of type `(dyn std::fmt::Display + 'a)` cannot be known at compilation time
15 }