summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr
blob: e12d42e5ed0cc654e1cb3b4bbb3cded857d63035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
error: lifetime may not live long enough
  --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:29
   |
LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
   |        --  -- lifetime `'b` defined here
   |        |
   |        lifetime `'a` defined here
...
LL |     let z: I::A = if cond { x } else { y };
   |                             ^ assignment requires that `'a` must outlive `'b`
   |
   = help: consider adding the following bound: `'a: 'b`

error: lifetime may not live long enough
  --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:22:40
   |
LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>(
   |        --  -- lifetime `'b` defined here
   |        |
   |        lifetime `'a` defined here
...
LL |     let z: I::A = if cond { x } else { y };
   |                                        ^ assignment requires that `'b` must outlive `'a`
   |
   = help: consider adding the following bound: `'b: 'a`

help: `'a` and `'b` must be the same: replace one with the other

error: aborting due to 2 previous errors