mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-17 04:30:48 +00:00
106 lines
4.4 KiB
Plaintext
106 lines
4.4 KiB
Plaintext
error[E0403]: the name `N` is already used for a generic parameter in this item's generic parameters
|
|
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:18
|
|
|
|
|
LL | trait Trait<const N: Trait = bar> {
|
|
| - first use of `N`
|
|
...
|
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
|
|
| ^ already used
|
|
|
|
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
|
|
|
|
error[E0423]: expected value, found builtin type `u32`
|
|
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:29
|
|
|
|
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
|
|
| ^^^ not a value
|
|
|
|
error[E0425]: cannot find value `bar` in this scope
|
|
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:15:9
|
|
|
|
|
LL | bar
|
|
| ^^^ not found in this scope
|
|
|
|
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
|
|
help: if this is a dyn-compatible trait, use `dyn`
|
|
|
|
|
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
|
|
|
|
warning: trait objects without an explicit `dyn` are deprecated
|
|
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:44
|
|
|
|
|
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>
|
|
help: if this is a dyn-compatible trait, use `dyn`
|
|
|
|
|
LL | fn fnc<const N: Trait = u32>(&self) -> dyn Trait {
|
|
| +++
|
|
|
|
error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
|
|
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:12
|
|
|
|
|
LL | fn fnc<const N: Trait = u32>(&self) -> Trait {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: trait objects without an explicit `dyn` are deprecated
|
|
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:21
|
|
|
|
|
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>
|
|
help: if this is a dyn-compatible trait, use `dyn`
|
|
|
|
|
LL | fn fnc<const N: dyn Trait = u32>(&self) -> Trait {
|
|
| +++
|
|
|
|
error: associated item referring to unboxed trait object for its own trait
|
|
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:44
|
|
|
|
|
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 {
|
|
| ~~~~
|
|
|
|
error: aborting due to 7 previous errors; 3 warnings emitted
|
|
|
|
Some errors have detailed explanations: E0391, E0403, E0423, E0425.
|
|
For more information about an error, try `rustc --explain E0391`.
|