89 lines
2.9 KiB
Plaintext
89 lines
2.9 KiB
Plaintext
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`.
|