(root)/
gcc-13.2.0/
gcc/
testsuite/
rust/
compile/
unsafe8.rs
struct S;

impl S {
    unsafe fn foo(self) {}
}

fn main() {
    let s = S;
    s.foo(); // { dg-error "call to unsafe method" }

    unsafe {
        s.foo();
    }
}