mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
17 lines
388 B
Rust
17 lines
388 B
Rust
// revisions: full min
|
|
//[full] check-pass
|
|
|
|
#![cfg_attr(full, feature(adt_const_params))]
|
|
#![cfg_attr(full, allow(incomplete_features))]
|
|
|
|
struct Const<const P: &'static ()>;
|
|
//[min]~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter
|
|
|
|
fn main() {
|
|
const A: &'static () = unsafe {
|
|
std::mem::transmute(10 as *const ())
|
|
};
|
|
|
|
let _ = Const::<{A}>;
|
|
}
|