Add a ConstParamTy trait

This commit is contained in:
Maybe Waffle 2023-02-17 13:44:35 +00:00
parent 518d348f87
commit 9a716dafbe
9 changed files with 300 additions and 122 deletions

View file

@ -0,0 +1,12 @@
#![feature(const_param_ty_trait)]
#[derive(PartialEq)]
struct NotParam;
#[derive(PartialEq)]
struct CantParam(NotParam);
impl std::marker::ConstParamTy for CantParam {}
//~^ error: the trait `ConstParamTy` may not be implemented for this type
fn main() {}

View file

@ -0,0 +1,12 @@
error[E0204]: the trait `ConstParamTy` may not be implemented for this type
--> $DIR/const_patam_ty_impl_bad_field.rs:9:36
|
LL | struct CantParam(NotParam);
| -------- this field does not implement `ConstParamTy`
LL |
LL | impl std::marker::ConstParamTy for CantParam {}
| ^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0204`.