2024-03-23 00:52:17 -05:00
error[E0403]: the name `N` is already used for a generic parameter in this item's generic parameters
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:18
2024-03-23 00:52:17 -05:00
|
LL | trait Trait<const N: Trait = bar> {
| - first use of `N`
...
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^ already used
2024-03-18 22:50:23 -05:00
error[E0425]: cannot find value `bar` in this scope
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:30
|
LL | trait Trait<const N: Trait = bar> {
| ^^^ not found in this scope
2024-03-23 00:52:17 -05:00
error[E0423]: expected value, found builtin type `u32`
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:29
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^ not a value
error[E0425]: cannot find value `bar` in this scope
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:23:9
2024-03-23 00:52:17 -05:00
|
LL | bar
| ^^^ not found in this scope
2024-03-18 22:50:23 -05:00
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22
|
LL | trait Trait<const N: Trait = bar> {
| ^^^^^
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: `#[warn(bare_trait_objects)]` on by default
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-03-18 22:50:23 -05:00
|
LL | trait Trait<const N: dyn Trait = bar> {
| +++
error[E0391]: cycle detected when computing type of `Trait::N`
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22
|
LL | trait Trait<const N: Trait = bar> {
| ^^^^^
|
= note: ...which immediately requires computing type of `Trait::N` again
note: cycle used when computing explicit predicates of trait `Trait`
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:1
|
LL | trait Trait<const N: Trait = bar> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= 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
2024-03-23 00:52:17 -05:00
error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:12
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^^^^^^^^^^^^^^^^^^
warning: trait objects without an explicit `dyn` are deprecated
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:21
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^^^
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: dyn Trait = u32>(&self) -> Trait {
| +++
warning: trait objects without an explicit `dyn` are deprecated
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:44
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^^^
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: Trait = u32>(&self) -> dyn Trait {
| +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22
|
LL | trait Trait<const N: Trait = bar> {
| ^^^^^
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-03-23 00:52:17 -05:00
|
LL | trait Trait<const N: dyn Trait = bar> {
| +++
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22
|
LL | trait Trait<const N: Trait = bar> {
| ^^^^^ `Trait` cannot be made into an object
|
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-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8
2024-03-23 00:52:17 -05:00
|
LL | trait Trait<const N: Trait = bar> {
| ----- this trait cannot be made into an object...
...
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^ ...because method `fnc` has generic type parameters
= help: consider moving `fnc` to another trait
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:13
|
LL | trait Trait<const N: Trait = bar> {
| ^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
|
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-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8
2024-03-23 00:52:17 -05:00
|
LL | trait Trait<const N: Trait = bar> {
| ----- this trait cannot be made into an object...
...
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^ ...because method `fnc` has generic type parameters
= help: consider moving `fnc` to another trait
error: associated item referring to unboxed trait object for its own trait
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:44
2024-03-23 00:52:17 -05:00
|
LL | trait Trait<const N: Trait = bar> {
| ----- in this trait
...
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^^^
|
help: you might have meant to use `Self` to refer to the implementing type
|
LL | fn fnc<const N: Trait = u32>(&self) -> Self {
| ~~~~
warning: trait objects without an explicit `dyn` are deprecated
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:21
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^^^
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: dyn Trait = u32>(&self) -> Trait {
| +++
error[E0038]: the trait `Trait` cannot be made into an object
2024-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:21
2024-03-23 00:52:17 -05:00
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^^^ `Trait` cannot be made into an object
|
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-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8
2024-03-23 00:52:17 -05:00
|
LL | trait Trait<const N: Trait = bar> {
| ----- this trait cannot be made into an object...
...
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^ ...because method `fnc` has generic type parameters
= help: consider moving `fnc` to another trait
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:13
|
LL | trait Trait<const N: Trait = bar> {
| ^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
|
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-09-29 15:28:11 -05:00
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8
2024-03-23 00:52:17 -05:00
|
LL | trait Trait<const N: Trait = bar> {
| ----- this trait cannot be made into an object...
...
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
| ^^^ ...because method `fnc` has generic type parameters
= help: consider moving `fnc` to another trait
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2024-09-29 15:28:11 -05:00
error: aborting due to 11 previous errors; 5 warnings emitted
2024-03-18 22:50:23 -05:00
2024-03-23 00:52:17 -05:00
Some errors have detailed explanations: E0038, E0391, E0403, E0423, E0425.
For more information about an error, try `rustc --explain E0038`.