Add a ConstParamTy trait
This commit is contained in:
parent
518d348f87
commit
9a716dafbe
9 changed files with 300 additions and 122 deletions
12
tests/ui/const-generics/const_patam_ty_impl_bad_field.rs
Normal file
12
tests/ui/const-generics/const_patam_ty_impl_bad_field.rs
Normal 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() {}
|
||||
12
tests/ui/const-generics/const_patam_ty_impl_bad_field.stderr
Normal file
12
tests/ui/const-generics/const_patam_ty_impl_bad_field.stderr
Normal 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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue