File: type-mismatch-in-nested-goal.current.stderr

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (45 lines) | stat: -rw-r--r-- 1,599 bytes parent folder | download | duplicates (24)
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
error: the constant `N` is not of type `bool`
  --> $DIR/type-mismatch-in-nested-goal.rs:9:50
   |
LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {}
   |                                                  ^^^^ expected `bool`, found `usize`
   |
note: required by a const generic parameter in `A`
  --> $DIR/type-mismatch-in-nested-goal.rs:5:9
   |
LL | trait A<const B: bool> {}
   |         ^^^^^^^^^^^^^ required by this const generic parameter in `A`

error: the constant `true` is not of type `usize`
  --> $DIR/type-mismatch-in-nested-goal.rs:13:13
   |
LL |     needs_a([]);
   |     ------- ^^ expected `usize`, found `bool`
   |     |
   |     required by a bound introduced by this call
   |
note: required by a const generic parameter in `needs_a`
  --> $DIR/type-mismatch-in-nested-goal.rs:9:12
   |
LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {}
   |            ^^^^^^^^^^^^^^ required by this const generic parameter in `needs_a`

error[E0308]: mismatched types
  --> $DIR/type-mismatch-in-nested-goal.rs:13:13
   |
LL |     needs_a([]);
   |     ------- ^^ expected an array with a size of true, found one with a size of 0
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected array `[u8; true]`
              found array `[_; 0]`
note: function defined here
  --> $DIR/type-mismatch-in-nested-goal.rs:9:4
   |
LL | fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {}
   |    ^^^^^^^                 ----------

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0308`.