fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.5 KiB46 linesraw
1error[E0308]: mismatched types
2  --> $DIR/rfc1623.rs:22:35
3   |
4LL |   static SOME_STRUCT: &SomeStruct = SomeStruct {
5   |  ___________________________________^
6LL | |     foo: &Foo { bools: &[false, true] },
7LL | |     bar: &Bar { bools: &[true, true] },
8LL | |     f: &id,
9LL | |
10LL | |
11LL | | };
12   | |_^ expected `&SomeStruct<'static, 'static, 'static>`, found struct `SomeStruct`
13   |
14help: consider borrowing here
15   |
16LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
17LL |     foo: &Foo { bools: &[false, true] },
18LL |     bar: &Bar { bools: &[true, true] },
19LL |     f: &id,
20LL |
21LL |
22 ...
23
24error[E0631]: type mismatch in function arguments
25  --> $DIR/rfc1623.rs:25:8
26   |
27LL | fn id<T>(t: T) -> T {
28   | ------------------- found signature of `fn(_) -> _`
29...
30LL |     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
35error[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   |
38LL |     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
43error: aborting due to 3 previous errors
44
45Some errors have detailed explanations: E0271, E0308, E0631.
46For more information about an error, try `rustc --explain E0271`.