]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc1623.stderr
Add more context to the literal overflow message
[rust.git] / src / test / ui / rfc1623.stderr
1 error[E0308]: mismatched types
2   --> $DIR/rfc1623.rs:22:35
3    |
4 LL |   static SOME_STRUCT: &SomeStruct = SomeStruct {
5    |  ___________________________________^
6 LL | |     foo: &Foo { bools: &[false, true] },
7 LL | |     bar: &Bar { bools: &[true, true] },
8 LL | |     f: &id,
9 LL | |
10 LL | |
11 LL | | };
12    | |_^ expected `&SomeStruct<'static, 'static, 'static>`, found struct `SomeStruct`
13    |
14 help: consider borrowing here
15    |
16 LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
17 LL |     foo: &Foo { bools: &[false, true] },
18 LL |     bar: &Bar { bools: &[true, true] },
19 LL |     f: &id,
20 LL |
21 LL |
22  ...
23
24 error[E0631]: type mismatch in function arguments
25   --> $DIR/rfc1623.rs:25:8
26    |
27 LL | fn id<T>(t: T) -> T {
28    | ------------------- found signature of `fn(_) -> _`
29 ...
30 LL |     f: &id,
31    |        ^^^ expected signature of `for<'a, 'b> fn(&'a Foo<'b>) -> _`
32    |
33    = note: required for the cast to the object type `dyn for<'a, 'b> std::ops::Fn(&'a Foo<'b>) -> &'a Foo<'b>`
34
35 error[E0271]: type mismatch resolving `for<'a, 'b> <fn(_) -> _ {id::<_>} as std::ops::FnOnce<(&'a Foo<'b>,)>>::Output == &'a Foo<'b>`
36   --> $DIR/rfc1623.rs:25:8
37    |
38 LL |     f: &id,
39    |        ^^^ expected bound lifetime parameter 'a, found concrete lifetime
40    |
41    = note: required for the cast to the object type `dyn for<'a, 'b> std::ops::Fn(&'a Foo<'b>) -> &'a Foo<'b>`
42
43 error: aborting due to 3 previous errors
44
45 Some errors have detailed explanations: E0271, E0308, E0631.
46 For more information about an error, try `rustc --explain E0271`.