Add !StructuralEq
test for ConstParamTy
This commit is contained in:
parent
1c544108b1
commit
7234d63ea4
@ -0,0 +1,17 @@
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(adt_const_params)]
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
struct ImplementsConstParamTy;
|
||||
impl std::marker::ConstParamTy for ImplementsConstParamTy {}
|
||||
|
||||
struct CantParam(ImplementsConstParamTy);
|
||||
|
||||
impl std::marker::ConstParamTy for CantParam {}
|
||||
//~^ error: the type `CantParam` does not `#[derive(Eq)]`
|
||||
|
||||
fn check<T: std::marker::ConstParamTy>() {}
|
||||
|
||||
fn main() {
|
||||
check::<ImplementsConstParamTy>();
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
error[E0277]: the type `CantParam` does not `#[derive(Eq)]`
|
||||
--> $DIR/const_param_ty_impl_no_structural_eq.rs:10:36
|
||||
|
|
||||
LL | impl std::marker::ConstParamTy for CantParam {}
|
||||
| ^^^^^^^^^ the trait `StructuralEq` is not implemented for `CantParam`
|
||||
|
|
||||
note: required by a bound in `ConstParamTy`
|
||||
--> $SRC_DIR/core/src/marker.rs:LL:COL
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
Loading…
x
Reference in New Issue
Block a user