summary refs log tree commit diff
path: root/tests/ui/impl-trait/precise-capturing/rpitit.stderr
blob: 45eceef2f494b281fb0a8d41eff0263b90c53abb (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
error: `use<...>` precise capturing syntax is currently not allowed in return-position `impl Trait` in traits
  --> $DIR/rpitit.rs:11:36
   |
LL |     fn hello() -> impl PartialEq + use<Self>;
   |                                    ^^^^^^^^^
   |
   = note: currently, return-position `impl Trait` in traits and trait implementations capture all lifetimes in scope

error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list
  --> $DIR/rpitit.rs:11:19
   |
LL | trait Foo<'a> {
   |           -- this lifetime parameter is captured
LL |     fn hello() -> impl PartialEq + use<Self>;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime captured due to being mentioned in the bounds of the `impl Trait`

error: lifetime may not live long enough
  --> $DIR/rpitit.rs:15:5
   |
LL |   fn test<'a, 'b, T: for<'r> Foo<'r>>() {
   |           --  -- lifetime `'b` defined here
   |           |
   |           lifetime `'a` defined here
LL | /     PartialEq::eq(
LL | |         &<T as Foo<'a>>::hello(),
LL | |         &<T as Foo<'b>>::hello(),
LL | |     );
   | |_____^ argument requires that `'a` must outlive `'b`
   |
   = help: consider adding the following bound: `'a: 'b`

error: lifetime may not live long enough
  --> $DIR/rpitit.rs:15:5
   |
LL |   fn test<'a, 'b, T: for<'r> Foo<'r>>() {
   |           --  -- lifetime `'b` defined here
   |           |
   |           lifetime `'a` defined here
LL | /     PartialEq::eq(
LL | |         &<T as Foo<'a>>::hello(),
LL | |         &<T as Foo<'b>>::hello(),
LL | |     );
   | |_____^ argument 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 4 previous errors