2024-06-04 03:10:08 -05:00
error[E0425]: cannot find value `bar` in this scope
2024-10-04 09:10:28 -05:00
--> $DIR/not_wf_param_in_rpitit.rs:3:34
2024-06-04 03:10:08 -05:00
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
| ^^^ not found in this scope
2024-06-04 03:10:08 -05:00
error[E0391]: cycle detected when computing type of `Trait::N`
2024-10-04 09:10:28 -05:00
--> $DIR/not_wf_param_in_rpitit.rs:3:26
2024-06-04 03:10:08 -05:00
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
| ^^^^^
2024-06-04 03:10:08 -05:00
|
= note: ...which immediately requires computing type of `Trait::N` again
note: cycle used when computing explicit predicates of trait `Trait`
--> $DIR/not_wf_param_in_rpitit.rs:3:1
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-04 03:10:08 -05:00
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/not_wf_param_in_rpitit.rs:3:22
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
| ^^^^^^^^^ `Trait` cannot be made into an object
2024-06-04 03:10:08 -05:00
|
2024-09-25 03:38:40 -05:00
note: for a trait to be "dyn-compatible" 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>
2024-10-04 09:10:28 -05:00
--> $DIR/not_wf_param_in_rpitit.rs:9:14
2024-06-04 03:10:08 -05:00
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
2024-06-04 03:10:08 -05:00
| ----- this trait cannot be made into an object...
...
LL | async fn a() {}
| ^ ...because associated function `a` has no `self` parameter
help: consider turning `a` into a method by giving it a `&self` argument
|
LL | async fn a(&self) {}
| +++++
help: alternatively, consider constraining `a` so it does not apply to trait objects
|
LL | async fn a() where Self: Sized {}
| +++++++++++++++++
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/not_wf_param_in_rpitit.rs:3:13
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
| ^^^^^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
2024-06-04 03:10:08 -05:00
|
2024-09-25 03:38:40 -05:00
note: for a trait to be "dyn-compatible" 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>
2024-10-04 09:10:28 -05:00
--> $DIR/not_wf_param_in_rpitit.rs:9:14
2024-06-04 03:10:08 -05:00
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
2024-06-04 03:10:08 -05:00
| ----- this trait cannot be made into an object...
...
LL | async fn a() {}
| ^ ...because associated function `a` has no `self` parameter
help: consider turning `a` into a method by giving it a `&self` argument
|
LL | async fn a(&self) {}
| +++++
help: alternatively, consider constraining `a` so it does not apply to trait objects
|
LL | async fn a() where Self: Sized {}
| +++++++++++++++++
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/not_wf_param_in_rpitit.rs:3:13
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
| ^^^^^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
2024-06-04 03:10:08 -05:00
|
2024-09-25 03:38:40 -05:00
note: for a trait to be "dyn-compatible" 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>
2024-10-04 09:10:28 -05:00
--> $DIR/not_wf_param_in_rpitit.rs:9:14
2024-06-04 03:10:08 -05:00
|
2024-10-04 09:10:28 -05:00
LL | trait Trait<const N: dyn Trait = bar> {
2024-06-04 03:10:08 -05:00
| ----- this trait cannot be made into an object...
...
LL | async fn a() {}
| ^ ...because associated function `a` has no `self` parameter
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: consider turning `a` into a method by giving it a `&self` argument
|
LL | async fn a(&self) {}
| +++++
help: alternatively, consider constraining `a` so it does not apply to trait objects
|
LL | async fn a() where Self: Sized {}
| +++++++++++++++++
2024-10-04 09:10:28 -05:00
error: aborting due to 5 previous errors
2024-06-04 03:10:08 -05:00
2024-10-04 09:10:28 -05:00
Some errors have detailed explanations: E0038, E0391, E0425.
2024-06-04 03:10:08 -05:00
For more information about an error, try `rustc --explain E0038`.