File: ice-hir-wf-check-anon-const-issue-122199.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 893,176 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (105 lines) | stat: -rw-r--r-- 4,457 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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`.