about summary refs log tree commit diff
path: root/tests/ui/asm/conditionally-sized-ptr-fail.rs
blob: b0a93495ffafe116296284f73d42b14b94dab387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ needs-asm-support

use std::arch::asm;

fn _f<T: ?Sized>(p: *mut T) {
    unsafe {
        asm!("/* {} */", in(reg) p);
        //~^ ERROR cannot use value of unsized pointer type `*mut T` for inline assembly
    }
}

fn _g(p: *mut [u8]) {
    unsafe {
        asm!("/* {} */", in(reg) p);
        //~^ ERROR cannot use value of unsized pointer type `*mut [u8]` for inline assembly
    }
}

fn main() {}