]> git.lizzy.rs Git - rust.git/blob - src/test/ui/function-pointer/unsized-ret.stderr
Make some diagnostics not depend on the source of what they reference being available
[rust.git] / src / test / ui / function-pointer / unsized-ret.stderr
1 error[E0277]: the size for values of type `str` cannot be known at compilation time
2   --> $DIR/unsized-ret.rs:10:27
3    |
4 LL |     foo::<fn() -> str, _>(None, ());
5    |     --------------------- ^^^^ doesn't have a size known at compile-time
6    |     |
7    |     required by a bound introduced by this call
8    |
9    = help: within `fn() -> str`, the trait `Sized` is not implemented for `str`
10    = note: required because it appears within the type `fn() -> str`
11 note: required by a bound in `foo`
12   --> $DIR/unsized-ret.rs:5:11
13    |
14 LL | fn foo<F: Fn<T>, T:std::marker::Tuple>(f: Option<F>, t: T) {
15    |           ^^^^^ required by this bound in `foo`
16
17 error[E0277]: the size for values of type `(dyn std::fmt::Display + 'a)` cannot be known at compilation time
18   --> $DIR/unsized-ret.rs:13:66
19    |
20 LL |     foo::<for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&(),));
21    |     ------------------------------------------------------------ ^^^^ doesn't have a size known at compile-time
22    |     |
23    |     required by a bound introduced by this call
24    |
25    = help: within `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`, the trait `for<'a> Sized` is not implemented for `(dyn std::fmt::Display + 'a)`
26    = note: required because it appears within the type `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`
27 note: required by a bound in `foo`
28   --> $DIR/unsized-ret.rs:5:11
29    |
30 LL | fn foo<F: Fn<T>, T:std::marker::Tuple>(f: Option<F>, t: T) {
31    |           ^^^^^ required by this bound in `foo`
32
33 error: aborting due to 2 previous errors
34
35 For more information about this error, try `rustc --explain E0277`.