2021-01-02 18:45:11 +00:00
error[E0107]: this associated function takes 0 type arguments but 1 type argument was supplied
2021-02-08 22:15:45 +00:00
--> $DIR/test-2.rs:9:8
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | 10.dup::<i32>();
2021-01-02 18:45:11 +00:00
| ^^^------- help: remove these generics
| |
| expected 0 type arguments
|
note: associated function defined here, with 0 type parameters
2021-02-08 22:15:45 +00:00
--> $DIR/test-2.rs:4:16
2021-01-02 18:45:11 +00:00
|
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
| ^^^
2018-08-08 12:28:26 +00:00
2021-01-02 18:45:11 +00:00
error[E0107]: this associated function takes 1 type argument but 2 type arguments were supplied
2021-02-08 22:15:45 +00:00
--> $DIR/test-2.rs:11:8
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | 10.blah::<i32, i32>();
2021-01-02 18:45:11 +00:00
| ^^^^ ----- help: remove this type argument
| |
| expected 1 type argument
|
note: associated function defined here, with 1 type parameter: `X`
2021-02-08 22:15:45 +00:00
--> $DIR/test-2.rs:4:39
2021-01-02 18:45:11 +00:00
|
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
| ^^^^ -
2018-08-08 12:28:26 +00:00
error[E0038]: the trait `bar` cannot be made into an object
2021-02-08 22:15:45 +00:00
--> $DIR/test-2.rs:13:16
2018-08-08 12:28:26 +00:00
|
2019-05-28 18:46:13 +00:00
LL | (box 10 as Box<dyn bar>).dup();
2020-10-20 00:57:18 +00:00
| ^^^^^^^^^^^^ `bar` cannot be made into an object
2020-02-01 00:47:00 +00:00
|
= help: consider moving `dup` to another trait
= help: consider moving `blah` to another trait
2020-10-16 00:23:45 +00:00
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
2021-02-08 22:15:45 +00:00
--> $DIR/test-2.rs:4:30
2018-08-08 12:28:26 +00:00
|
2019-09-03 03:22:22 +00:00
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
2020-10-16 00:23:45 +00:00
| --- ^^^^ ^^^^ ...because method `blah` has generic type parameters
2020-02-01 02:48:35 +00:00
| | |
| | ...because method `dup` references the `Self` type in its return type
2020-02-01 00:47:00 +00:00
| this trait cannot be made into an object...
2020-10-16 00:23:45 +00:00
error[E0038]: the trait `bar` cannot be made into an object
2021-02-08 22:15:45 +00:00
--> $DIR/test-2.rs:13:6
2020-10-16 00:23:45 +00:00
|
2019-05-28 18:46:13 +00:00
LL | (box 10 as Box<dyn bar>).dup();
2020-10-20 00:57:18 +00:00
| ^^^^^^ `bar` cannot be made into an object
2018-08-08 12:28:26 +00:00
|
2020-02-01 00:47:00 +00:00
= help: consider moving `dup` to another trait
= help: consider moving `blah` to another trait
2020-10-16 00:23:45 +00:00
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
2021-02-08 22:15:45 +00:00
--> $DIR/test-2.rs:4:30
2020-10-16 00:23:45 +00:00
|
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
| --- ^^^^ ^^^^ ...because method `blah` has generic type parameters
| | |
| | ...because method `dup` references the `Self` type in its return type
| this trait cannot be made into an object...
2020-09-02 07:40:56 +00:00
= note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn bar>>` for `Box<{integer}>`
= note: required by cast to type `Box<dyn bar>`
2018-08-08 12:28:26 +00:00
2018-09-20 07:21:29 +00:00
error: aborting due to 4 previous errors
2018-08-08 12:28:26 +00:00
2019-04-17 17:26:38 +00:00
Some errors have detailed explanations: E0038, E0107.
2018-08-08 12:28:26 +00:00
For more information about an error, try `rustc --explain E0038`.