summaryrefslogtreecommitdiffstats
path: root/src/test/ui/cast/cast-macro-lhs.rs
blob: b509b3239bc58b133523f4c50735a68cd7c3483d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Test to make sure we suggest "consider casting" on the right span

macro_rules! foo {
    () => { 0 }
}

fn main() {
    let x = foo!() as *const [u8];
    //~^ ERROR cannot cast `usize` to a pointer that is wide
    //~| NOTE creating a `*const [u8]` requires both an address and a length
    //~| NOTE consider casting this expression to `*const ()`, then using `core::ptr::from_raw_parts`
}