]>
Commit | Line | Data |
---|---|---|
6a06907d XL |
1 | error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied |
2 | --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 | |
3 | | | |
4 | LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_> { | |
5 | | ^^^^^^^^^^^^---- help: remove these generics | |
6 | | | | |
7 | | expected 0 lifetime arguments | |
8 | | | |
9 | note: struct defined here, with 0 lifetime parameters | |
10 | --> $DIR/issue-82126-mismatched-subst-and-hir.rs:23:8 | |
11 | | | |
12 | LL | struct LockedMarket<T>(T); | |
13 | | ^^^^^^^^^^^^ | |
14 | ||
15 | error[E0107]: this struct takes 1 type argument but 0 type arguments were supplied | |
16 | --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 | |
17 | | | |
18 | LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_> { | |
19 | | ^^^^^^^^^^^^ expected 1 type argument | |
20 | | | |
21 | note: struct defined here, with 1 type parameter: `T` | |
22 | --> $DIR/issue-82126-mismatched-subst-and-hir.rs:23:8 | |
23 | | | |
24 | LL | struct LockedMarket<T>(T); | |
25 | | ^^^^^^^^^^^^ - | |
26 | help: add missing type argument | |
27 | | | |
28 | LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_, T> { | |
29 | | ^^^ | |
30 | ||
31 | error[E0515]: cannot return value referencing temporary value | |
32 | --> $DIR/issue-82126-mismatched-subst-and-hir.rs:19:5 | |
33 | | | |
34 | LL | LockedMarket(generator.lock().unwrap().buy()) | |
35 | | ^^^^^^^^^^^^^-------------------------^^^^^^^ | |
36 | | | | | |
37 | | | temporary value created here | |
38 | | returns a value referencing data owned by the current function | |
39 | ||
40 | error: aborting due to 3 previous errors | |
41 | ||
42 | Some errors have detailed explanations: E0107, E0515. | |
43 | For more information about an error, try `rustc --explain E0107`. |