2024-11-20 14:19:36 -08:00
|
|
|
error[E0038]: the trait `Qiz` is not dyn compatible
|
2021-07-20 10:56:33 -05:00
|
|
|
--> $DIR/issue-19380.rs:11:29
|
2018-07-15 14:11:54 -07:00
|
|
|
|
|
2020-10-15 17:23:45 -07:00
|
|
|
LL | foos: &'static [&'static (dyn Qiz + 'static)]
|
2024-11-20 14:19:36 -08:00
|
|
|
| ^^^^^^^^^^^^^^^^^ `Qiz` is not dyn compatible
|
2020-10-15 17:23:45 -07:00
|
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 05:14:07 +01:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2020-10-15 17:23:45 -07:00
|
|
|
--> $DIR/issue-19380.rs:2:6
|
|
|
|
|
|
|
2020-01-31 16:47:00 -08:00
|
|
|
LL | trait Qiz {
|
2024-11-20 14:19:36 -08:00
|
|
|
| --- this trait is not dyn compatible...
|
2019-09-02 20:22:22 -07:00
|
|
|
LL | fn qiz();
|
2020-10-15 17:23:45 -07:00
|
|
|
| ^^^ ...because associated function `qiz` has no `self` parameter
|
2024-11-20 14:19:36 -08:00
|
|
|
= help: only type `Foo` implements `Qiz`; consider using it directly instead.
|
2020-10-15 17:23:45 -07:00
|
|
|
help: consider turning `qiz` into a method by giving it a `&self` argument
|
2020-01-31 16:47:00 -08:00
|
|
|
|
|
2020-10-15 17:23:45 -07:00
|
|
|
LL | fn qiz(&self);
|
2021-06-21 19:07:19 -07:00
|
|
|
| +++++
|
2020-10-15 17:23:45 -07:00
|
|
|
help: alternatively, consider constraining `qiz` so it does not apply to trait objects
|
2020-01-31 18:48:35 -08:00
|
|
|
|
|
|
|
|
|
LL | fn qiz() where Self: Sized;
|
2021-06-21 19:07:19 -07:00
|
|
|
| +++++++++++++++++
|
2018-07-15 14:11:54 -07:00
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
error[E0038]: the trait `Qiz` is not dyn compatible
|
2023-10-25 10:49:24 +00:00
|
|
|
--> $DIR/issue-19380.rs:16:33
|
|
|
|
|
|
|
|
|
|
|
LL | const BAR : Bar = Bar { foos: &[&FOO]};
|
2024-11-20 14:19:36 -08:00
|
|
|
| ^^^^ `Qiz` is not dyn compatible
|
2023-10-25 10:49:24 +00:00
|
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 05:14:07 +01:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2023-10-25 10:49:24 +00:00
|
|
|
--> $DIR/issue-19380.rs:2:6
|
|
|
|
|
|
|
|
|
|
|
LL | trait Qiz {
|
2024-11-20 14:19:36 -08:00
|
|
|
| --- this trait is not dyn compatible...
|
2023-10-25 10:49:24 +00:00
|
|
|
LL | fn qiz();
|
|
|
|
|
| ^^^ ...because associated function `qiz` has no `self` parameter
|
2024-11-20 14:19:36 -08:00
|
|
|
= help: only type `Foo` implements `Qiz`; consider using it directly instead.
|
2023-10-25 10:49:24 +00:00
|
|
|
= note: required for the cast from `&Foo` to `&'static (dyn Qiz + 'static)`
|
|
|
|
|
help: consider turning `qiz` into a method by giving it a `&self` argument
|
|
|
|
|
|
|
|
|
|
|
LL | fn qiz(&self);
|
|
|
|
|
| +++++
|
|
|
|
|
help: alternatively, consider constraining `qiz` so it does not apply to trait objects
|
|
|
|
|
|
|
|
|
|
|
LL | fn qiz() where Self: Sized;
|
|
|
|
|
| +++++++++++++++++
|
|
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
error[E0038]: the trait `Qiz` is not dyn compatible
|
2024-08-05 17:26:46 -07:00
|
|
|
--> $DIR/issue-19380.rs:16:31
|
|
|
|
|
|
|
|
|
|
|
LL | const BAR : Bar = Bar { foos: &[&FOO]};
|
2024-11-20 14:19:36 -08:00
|
|
|
| ^^^^^^^ `Qiz` is not dyn compatible
|
2024-08-05 17:26:46 -07:00
|
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 05:14:07 +01:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2024-08-05 17:26:46 -07:00
|
|
|
--> $DIR/issue-19380.rs:2:6
|
|
|
|
|
|
|
|
|
|
|
LL | trait Qiz {
|
2024-11-20 14:19:36 -08:00
|
|
|
| --- this trait is not dyn compatible...
|
2024-08-05 17:26:46 -07:00
|
|
|
LL | fn qiz();
|
|
|
|
|
| ^^^ ...because associated function `qiz` has no `self` parameter
|
2024-11-20 14:19:36 -08:00
|
|
|
= help: only type `Foo` implements `Qiz`; consider using it directly instead.
|
2024-08-05 17:26:46 -07:00
|
|
|
help: consider turning `qiz` into a method by giving it a `&self` argument
|
|
|
|
|
|
|
|
|
|
|
LL | fn qiz(&self);
|
|
|
|
|
| +++++
|
|
|
|
|
help: alternatively, consider constraining `qiz` so it does not apply to trait objects
|
|
|
|
|
|
|
|
|
|
|
LL | fn qiz() where Self: Sized;
|
|
|
|
|
| +++++++++++++++++
|
|
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2018-07-15 14:11:54 -07:00
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0038`.
|