We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e82cd26 commit bf13792Copy full SHA for bf13792
src/test/compile-fail/lint-unsafe-code.rs
@@ -12,13 +12,16 @@
12
#![allow(dead_code)]
13
#![deny(unsafe_code)]
14
15
+use std::marker::PhantomFn;
16
+
17
struct Bar;
18
19
#[allow(unsafe_code)]
20
mod allowed_unsafe {
21
+ use std::marker::PhantomFn;
22
fn allowed() { unsafe {} }
23
unsafe fn also_allowed() {}
- unsafe trait AllowedUnsafe {}
24
+ unsafe trait AllowedUnsafe : PhantomFn<Self> {}
25
unsafe impl AllowedUnsafe for super::Bar {}
26
}
27
@@ -29,7 +32,7 @@ macro_rules! unsafe_in_macro {
29
32
30
33
31
34
unsafe fn baz() {} //~ ERROR: declaration of an `unsafe` function
-unsafe trait Foo {} //~ ERROR: declaration of an `unsafe` trait
35
+unsafe trait Foo : PhantomFn<Self> {} //~ ERROR: declaration of an `unsafe` trait
36
unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait
37
38
trait Baz {
0 commit comments