File: slice-const-param-mismatch.min.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 (68 lines) | stat: -rw-r--r-- 2,597 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
error: `&'static str` is forbidden as the type of a const generic parameter
  --> $DIR/slice-const-param-mismatch.rs:8:29
   |
LL | struct ConstString<const T: &'static str>;
   |                             ^^^^^^^^^^^^
   |
   = note: the only supported types are integers, `bool`, and `char`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
   |
LL + #![feature(adt_const_params)]
   |
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
   |
LL + #![feature(unsized_const_params)]
   |

error: `&'static [u8]` is forbidden as the type of a const generic parameter
  --> $DIR/slice-const-param-mismatch.rs:11:28
   |
LL | struct ConstBytes<const T: &'static [u8]>;
   |                            ^^^^^^^^^^^^^
   |
   = note: the only supported types are integers, `bool`, and `char`
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
   |
LL + #![feature(adt_const_params)]
   |
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
   |
LL + #![feature(unsized_const_params)]
   |

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

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