]> git.lizzy.rs Git - rust.git/blob - tests/ui/cast/cast-macro-lhs.rs
Rollup merge of #106783 - WaffleLapkin:break-my-ident, r=wesleywiser
[rust.git] / tests / ui / cast / cast-macro-lhs.rs
1 // Test to make sure we suggest "consider casting" on the right span
2
3 macro_rules! foo {
4     () => { 0 }
5 }
6
7 fn main() {
8     let x = foo!() as *const [u8];
9     //~^ ERROR cannot cast `usize` to a pointer that is wide
10     //~| NOTE creating a `*const [u8]` requires both an address and a length
11     //~| NOTE consider casting this expression to `*const ()`, then using `core::ptr::from_raw_parts`
12 }