2021-02-18 14:01:44 -06:00
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
2021-02-08 16:15:45 -06:00
--> $DIR/test-2.rs:9:8
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | 10.dup::<i32>();
2021-01-02 12:45:11 -06:00
| ^^^------- help: remove these generics
| |
2021-02-18 14:01:44 -06:00
| expected 0 generic arguments
2021-01-02 12:45:11 -06:00
|
2021-02-18 14:01:44 -06:00
note: associated function defined here, with 0 generic parameters
2021-02-08 16:15:45 -06:00
--> $DIR/test-2.rs:4:16
2021-01-02 12:45:11 -06:00
|
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
| ^^^
2018-08-08 07:28:26 -05:00
2021-02-18 14:01:44 -06:00
error[E0107]: this associated function takes 1 generic argument but 2 generic arguments were supplied
2021-02-08 16:15:45 -06:00
--> $DIR/test-2.rs:11:8
2018-08-08 07:28:26 -05:00
|
2019-03-09 06:03:44 -06:00
LL | 10.blah::<i32, i32>();
2021-02-18 14:01:44 -06:00
| ^^^^ --- help: remove this generic argument
2021-01-02 12:45:11 -06:00
| |
2021-02-18 14:01:44 -06:00
| expected 1 generic argument
2021-01-02 12:45:11 -06:00
|
2021-02-18 14:01:44 -06:00
note: associated function defined here, with 1 generic parameter: `X`
2021-02-08 16:15:45 -06:00
--> $DIR/test-2.rs:4:39
2021-01-02 12:45:11 -06:00
|
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
| ^^^^ -
2018-08-08 07:28:26 -05:00
error[E0038]: the trait `bar` cannot be made into an object
2021-02-08 16:15:45 -06:00
--> $DIR/test-2.rs:13:16
2018-08-08 07:28:26 -05:00
|
2019-05-28 13:46:13 -05:00
LL | (box 10 as Box<dyn bar>).dup();
2020-10-19 19:57:18 -05:00
| ^^^^^^^^^^^^ `bar` cannot be made into an object
2020-01-31 18:47:00 -06:00
|
2020-10-15 19:23:45 -05: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 16:15:45 -06:00
--> $DIR/test-2.rs:4:30
2018-08-08 07:28:26 -05:00
|
2019-09-02 22:22:22 -05:00
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
2020-10-15 19:23:45 -05:00
| --- ^^^^ ^^^^ ...because method `blah` has generic type parameters
2020-01-31 20:48:35 -06:00
| | |
| | ...because method `dup` references the `Self` type in its return type
2020-01-31 18:47:00 -06:00
| this trait cannot be made into an object...
2021-09-12 13:49:56 -05:00
= help: consider moving `dup` to another trait
= help: consider moving `blah` to another trait
2020-10-15 19:23:45 -05:00
error[E0038]: the trait `bar` cannot be made into an object
2021-02-08 16:15:45 -06:00
--> $DIR/test-2.rs:13:6
2020-10-15 19:23:45 -05:00
|
2019-05-28 13:46:13 -05:00
LL | (box 10 as Box<dyn bar>).dup();
2020-10-19 19:57:18 -05:00
| ^^^^^^ `bar` cannot be made into an object
2018-08-08 07:28:26 -05:00
|
2020-10-15 19:23:45 -05: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 16:15:45 -06:00
--> $DIR/test-2.rs:4:30
2020-10-15 19:23:45 -05: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...
2021-09-12 13:49:56 -05:00
= help: consider moving `dup` to another trait
= help: consider moving `blah` to another trait
2020-09-02 02:40:56 -05: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 07:28:26 -05:00
2018-09-20 02:21:29 -05:00
error: aborting due to 4 previous errors
2018-08-08 07:28:26 -05:00
2019-04-17 12:26:38 -05:00
Some errors have detailed explanations: E0038, E0107.
2018-08-08 07:28:26 -05:00
For more information about an error, try `rustc --explain E0038`.