rust/tests/ui/const-generics/raw-ptr-const-param.rs

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

13 lines
396 B
Rust
Raw Normal View History

//@ revisions: full min
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Const<const P: *const u32>; //~ ERROR: using raw pointers as const generic parameters
fn main() {
let _: Const<{ 15 as *const _ }> = Const::<{ 10 as *const _ }>;
//~^ ERROR: mismatched types
let _: Const<{ 10 as *const _ }> = Const::<{ 10 as *const _ }>;
}