about summary refs log tree commit diff
path: root/tests/ui/generic-associated-types/issue-74684-2.stderr
blob: d39513ec523af42a6181a843e18d18e0eb10356f (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
error[E0271]: type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
  --> $DIR/issue-74684-2.rs:21:9
   |
LL |     bug(Box::new(x));
   |     --- ^^^^^^^^^^^ type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
   |     |
   |     required by a bound introduced by this call
   |
note: expected this to be `[u8]`
  --> $DIR/issue-74684-2.rs:8:18
   |
LL |     type F<'a> = i32;
   |                  ^^^
note: required by a bound in `bug`
  --> $DIR/issue-74684-2.rs:11:28
   |
LL | fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> {
   |                            ^^^^^^^^^^^^ required by this bound in `bug`

error[E0597]: `a` does not live long enough
  --> $DIR/issue-74684-2.rs:13:25
   |
LL | fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> {
   |        -- lifetime `'a` defined here
LL |     let a = [0; 1];
   |         - binding `a` declared here
LL |     let x = T::identity(&a);
   |             ------------^^-
   |             |           |
   |             |           borrowed value does not live long enough
   |             argument requires that `a` is borrowed for `'a`
LL |     todo!()
LL | }
   | - `a` dropped here while still borrowed

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0271, E0597.
For more information about an error, try `rustc --explain E0271`.