]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc1623.stderr
move leak-check to during coherence, candidate eval
[rust.git] / src / test / ui / rfc1623.stderr
1 error[E0308]: mismatched types
2   --> $DIR/rfc1623.rs:21:35
3    |
4 LL |   static SOME_STRUCT: &SomeStruct = SomeStruct {
5    |  ___________________________________^
6 LL | |
7 LL | |     foo: &Foo { bools: &[false, true] },
8 LL | |     bar: &Bar { bools: &[true, true] },
9 LL | |     f: &id,
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 |
18 LL |     foo: &Foo { bools: &[false, true] },
19 LL |     bar: &Bar { bools: &[true, true] },
20 LL |     f: &id,
21 LL |
22  ...
23
24 error[E0271]: type mismatch resolving `for<'a, 'b> <fn(&Foo<'_>) -> &Foo<'_> {id::<&Foo<'_>>} as std::ops::FnOnce<(&'a Foo<'b>,)>>::Output == &'a Foo<'b>`
25   --> $DIR/rfc1623.rs:25:8
26    |
27 LL |     f: &id,
28    |        ^^^ expected bound lifetime parameter 'a, found concrete lifetime
29    |
30    = note: required for the cast to the object type `dyn for<'a, 'b> std::ops::Fn(&'a Foo<'b>) -> &'a Foo<'b>`
31
32 error: aborting due to 2 previous errors
33
34 Some errors have detailed explanations: E0271, E0308.
35 For more information about an error, try `rustc --explain E0271`.