blob: a085dd6ac57618d82ea41d94ee35c3c907c36e95 (
plain)
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
|
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:4:18
|
LL | trait Trait<const N: dyn Trait = bar> {
| - first use of `N`
...
LL | fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
| ^ already used
error[E0425]: cannot find value `bar` in this scope
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:34
|
LL | trait Trait<const N: dyn 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:4:33
|
LL | fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
| ^^^ not a value
error[E0425]: cannot find value `bar` in this scope
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:9:9
|
LL | bar
| ^^^ not found in this scope
error[E0391]: cycle detected when computing type of `Trait::N`
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:26
|
LL | trait Trait<const N: dyn 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: dyn 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
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:4:12
|
LL | fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: associated item referring to unboxed trait object for its own trait
--> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:48
|
LL | trait Trait<const N: dyn Trait = bar> {
| ----- in this trait
...
LL | fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
| ^^^^^^^^^
|
help: you might have meant to use `Self` to refer to the implementing type
|
LL - fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
LL + fn fnc<const N: dyn Trait = u32>(&self) -> Self {
|
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0391, E0403, E0423, E0425.
For more information about an error, try `rustc --explain E0391`.
|