File: const-param-decl-on-type-instead-of-impl.stderr

package info (click to toggle)
rustc 1.86.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid
  • size: 913,560 kB
  • sloc: xml: 158,127; python: 35,921; javascript: 19,689; sh: 19,600; cpp: 18,906; ansic: 13,124; asm: 4,376; makefile: 708; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (50 lines) | stat: -rw-r--r-- 1,832 bytes parent folder | download | duplicates (6)
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
error: unexpected `const` parameter declaration
  --> $DIR/const-param-decl-on-type-instead-of-impl.rs:2:12
   |
LL | impl NInts<const N: usize> {}
   |            ^^^^^^^^^^^^^^ expected a `const` expression, not a parameter declaration
   |
help: `const` parameters must be declared for the `impl`
   |
LL - impl NInts<const N: usize> {}
LL + impl<const N: usize> NInts<N> {}
   |

error: unexpected `const` parameter declaration
  --> $DIR/const-param-decl-on-type-instead-of-impl.rs:8:17
   |
LL | fn banana(a: <T<const N: usize>>::BAR) {}
   |                 ^^^^^^^^^^^^^^ expected a `const` expression, not a parameter declaration

error: unexpected `const` parameter declaration
  --> $DIR/const-param-decl-on-type-instead-of-impl.rs:12:26
   |
LL |     path::path::Struct::<const N: usize>()
   |                          ^^^^^^^^^^^^^^ expected a `const` expression, not a parameter declaration

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `path`
  --> $DIR/const-param-decl-on-type-instead-of-impl.rs:12:5
   |
LL |     path::path::Struct::<const N: usize>()
   |     ^^^^ use of unresolved module or unlinked crate `path`
   |
   = help: you might be missing a crate named `path`

error[E0412]: cannot find type `T` in this scope
  --> $DIR/const-param-decl-on-type-instead-of-impl.rs:8:15
   |
LL | fn banana(a: <T<const N: usize>>::BAR) {}
   |               ^ not found in this scope

error[E0308]: mismatched types
  --> $DIR/const-param-decl-on-type-instead-of-impl.rs:5:17
   |
LL |     let _: () = 42;
   |            --   ^^ expected `()`, found integer
   |            |
   |            expected due to this

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0308, E0412, E0433.
For more information about an error, try `rustc --explain E0308`.