rust/tests/ui/const-generics/issues/issue-74255.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
513 B
Rust
Raw Normal View History

// [full] check-pass
// revisions: full min
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
2020-07-16 05:46:02 -05:00
#[cfg(full)]
use std::marker::ConstParamTy;
2020-07-16 05:46:02 -05:00
#[derive(PartialEq, Eq)]
#[cfg_attr(full, derive(ConstParamTy))]
2020-07-16 05:46:02 -05:00
enum IceEnum {
Variant
}
struct IceStruct;
impl IceStruct {
fn ice_struct_fn<const I: IceEnum>() {}
//[min]~^ ERROR `IceEnum` is forbidden as the type of a const generic parameter
2020-07-16 05:46:02 -05:00
}
fn main() {
IceStruct::ice_struct_fn::<{IceEnum::Variant}>();
}