Debian Codegraph @

gcc/testsuite/rust/compile/unsafe8.rs

raw
1 struct S;
2
3 impl S {
4 unsafe fn foo(self) {}
5 }
6
7 fn main() {
8 let s = S;
9 s.foo(); // { dg-error "call to unsafe method" }
10
11 unsafe {
12 s.foo();
13 }
14 }