about summary refs log tree commit diff
path: root/tests/ui/delegation/generics/free-fn-to-trait-method.stderr
blob: d8299d00c7e9420dcec0d02a14fc412fd9de5f28 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
error[E0308]: mismatched types
  --> $DIR/free-fn-to-trait-method.rs:36:23
   |
LL |         fn foo<U>(&self, _: U, _: T) {}
   |                - found this type parameter
...
LL |     reuse Trait::<_>::foo::<i32> as generic_arguments1;
   |                       ^^^
   |                       |
   |                       expected `i32`, found type parameter `U`
   |                       arguments to this function are incorrect
   |
   = note:        expected type `i32`
           found type parameter `U`
note: method defined here
  --> $DIR/free-fn-to-trait-method.rs:31:12
   |
LL |         fn foo<U>(&self, _: U, _: T) {}
   |            ^^^           ----

error[E0308]: mismatched types
  --> $DIR/free-fn-to-trait-method.rs:38:29
   |
LL |     trait Trait<T> {
   |     -------------- found this type parameter
...
LL |     reuse <u8 as Trait<_>>::foo as generic_arguments2;
   |                             ^^^
   |                             |
   |                             expected `&u8`, found `&Self`
   |                             arguments to this function are incorrect
   |
   = note: expected reference `&u8`
              found reference `&Self`
note: method defined here
  --> $DIR/free-fn-to-trait-method.rs:31:12
   |
LL |         fn foo<U>(&self, _: U, _: T) {}
   |            ^^^    -----

error[E0277]: the trait bound `S: Copy` is not satisfied
  --> $DIR/free-fn-to-trait-method.rs:53:18
   |
LL |     bounds(&0u8, S, U);
   |     ------       ^ the trait `Copy` is not implemented for `S`
   |     |
   |     required by a bound introduced by this call
   |
note: required by a bound in `bounds`
  --> $DIR/free-fn-to-trait-method.rs:23:54
   |
LL |         fn foo<U: Clone>(&self, t: T, u: U) where T: Copy {}
   |                                                      ^^^^ required by this bound in `bounds`
...
LL | reuse bounds::Trait::foo as bounds;
   |                             ------ required by a bound in this function
help: consider annotating `S` with `#[derive(Copy)]`
   |
LL +     #[derive(Copy)]
LL |     struct S;
   |

error[E0277]: the trait bound `U: Clone` is not satisfied
  --> $DIR/free-fn-to-trait-method.rs:53:21
   |
LL |     bounds(&0u8, S, U);
   |     ------          ^ the trait `Clone` is not implemented for `U`
   |     |
   |     required by a bound introduced by this call
   |
note: required by a bound in `bounds`
  --> $DIR/free-fn-to-trait-method.rs:23:19
   |
LL |         fn foo<U: Clone>(&self, t: T, u: U) where T: Copy {}
   |                   ^^^^^ required by this bound in `bounds`
...
LL | reuse bounds::Trait::foo as bounds;
   |                             ------ required by a bound in this function
help: consider annotating `U` with `#[derive(Clone)]`
   |
LL +     #[derive(Clone)]
LL |     struct U;
   |

error: aborting due to 4 previous errors

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