summary refs log tree commit diff
path: root/src/test/ui/consts/unsizing-cast-non-null.rs
blob: 67d9f6baca5b447a440c09036d63474d3c5beb5e (plain)
1
2
3
4
5
6
7
8
9
10
// Regression test for #75118.

use std::ptr::NonNull;

pub const fn dangling_slice<T>() -> NonNull<[T]> {
    NonNull::<[T; 0]>::dangling()
    //~^ ERROR: unsizing casts are only allowed for references right now
}

fn main() {}