File: slice-const-param-mismatch.adt_const_params.stderr

package info (click to toggle)
rustc-web 1.85.0%2Bdfsg3-1~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,759,988 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,056; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (49 lines) | stat: -rw-r--r-- 1,817 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
error[E0741]: `&'static str` can't be used as a const parameter type
  --> $DIR/slice-const-param-mismatch.rs:8:29
   |
LL | struct ConstString<const T: &'static str>;
   |                             ^^^^^^^^^^^^

error[E0741]: `&'static [u8]` can't be used as a const parameter type
  --> $DIR/slice-const-param-mismatch.rs:11:28
   |
LL | struct ConstBytes<const T: &'static [u8]>;
   |                            ^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> $DIR/slice-const-param-mismatch.rs:17:35
   |
LL |     let _: ConstString<"Hello"> = ConstString::<"World">;
   |            --------------------   ^^^^^^^^^^^^^^^^^^^^^^ expected `"Hello"`, found `"World"`
   |            |
   |            expected due to this
   |
   = note: expected struct `ConstString<"Hello">`
              found struct `ConstString<"World">`

error[E0308]: mismatched types
  --> $DIR/slice-const-param-mismatch.rs:19:33
   |
LL |     let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">;
   |            -------------------   ^^^^^^^^^^^^^^^^^^^^^ expected `"ℇ㇈↦"`, found `"ℇ㇈↥"`
   |            |
   |            expected due to this
   |
   = note: expected struct `ConstString<"ℇ㇈↦">`
              found struct `ConstString<"ℇ㇈↥">`

error[E0308]: mismatched types
  --> $DIR/slice-const-param-mismatch.rs:21:33
   |
LL |     let _: ConstBytes<b"AAA"> = ConstBytes::<b"BBB">;
   |            ------------------   ^^^^^^^^^^^^^^^^^^^^ expected `b"AAA"`, found `b"BBB"`
   |            |
   |            expected due to this
   |
   = note: expected struct `ConstBytes<b"AAA">`
              found struct `ConstBytes<b"BBB">`

error: aborting due to 5 previous errors

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