2020-08-18 15:44:06 -05:00
|
|
|
error: `&'static str` is forbidden as the type of a const generic parameter
|
2024-07-14 07:38:51 -05:00
|
|
|
--> $DIR/slice-const-param-mismatch.rs:8:29
|
2020-08-10 13:50:58 -05:00
|
|
|
|
|
|
|
|
LL | struct ConstString<const T: &'static str>;
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2024-09-29 15:28:11 -05:00
|
|
|
= note: the only supported types are integers, `bool`, and `char`
|
2024-03-07 16:09:00 -06:00
|
|
|
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
|
|
|
|
|
|
|
|
LL + #![feature(adt_const_params)]
|
|
|
|
|
|
2024-07-14 07:38:51 -05:00
|
|
|
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
|
|
|
|
|
|
|
|
LL + #![feature(unsized_const_params)]
|
|
|
|
|
|
2020-08-10 13:50:58 -05:00
|
|
|
|
2020-08-18 15:44:06 -05:00
|
|
|
error: `&'static [u8]` is forbidden as the type of a const generic parameter
|
2024-07-14 07:38:51 -05:00
|
|
|
--> $DIR/slice-const-param-mismatch.rs:11:28
|
2020-08-10 13:50:58 -05:00
|
|
|
|
|
|
|
|
LL | struct ConstBytes<const T: &'static [u8]>;
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
2024-09-29 15:28:11 -05:00
|
|
|
= note: the only supported types are integers, `bool`, and `char`
|
2024-03-07 16:09:00 -06:00
|
|
|
help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
|
|
|
|
|
|
|
|
|
LL + #![feature(adt_const_params)]
|
|
|
|
|
|
2024-07-14 07:38:51 -05:00
|
|
|
help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
|
|
|
|
|
|
|
|
|
LL + #![feature(unsized_const_params)]
|
|
|
|
|
|
2020-08-10 13:50:58 -05:00
|
|
|
|
2024-02-09 06:17:55 -06:00
|
|
|
error[E0308]: mismatched types
|
2024-07-14 07:38:51 -05:00
|
|
|
--> $DIR/slice-const-param-mismatch.rs:17:35
|
2024-02-09 06:17:55 -06:00
|
|
|
|
|
|
|
|
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
|
2024-07-14 07:38:51 -05:00
|
|
|
--> $DIR/slice-const-param-mismatch.rs:19:33
|
2024-02-09 06:17:55 -06:00
|
|
|
|
|
|
|
|
LL | let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">;
|
|
|
|
| ------------------- ^^^^^^^^^^^^^^^^^^^^^ expected `"ℇ㇈↦"`, found `"ℇ㇈↥"`
|
|
|
|
| |
|
|
|
|
| expected due to this
|
|
|
|
|
|
|
|
|
= note: expected struct `ConstString<"ℇ㇈↦">`
|
|
|
|
found struct `ConstString<"ℇ㇈↥">`
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2024-07-14 07:38:51 -05:00
|
|
|
--> $DIR/slice-const-param-mismatch.rs:21:33
|
2024-02-09 06:17:55 -06:00
|
|
|
|
|
|
|
|
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
|
2020-08-10 13:50:58 -05:00
|
|
|
|
2024-02-09 06:17:55 -06:00
|
|
|
For more information about this error, try `rustc --explain E0308`.
|