Skip to content

Commit 3c062ae

Browse files
committed
---
yaml --- r: 184889 b: refs/heads/snap-stage3 c: d316a34 h: refs/heads/master i: 184887: af1931e v: v3
1 parent 8195435 commit 3c062ae

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: f0f7ca27de6b4e03f30012656dad270cda55a363
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 59ab2daad3a2a78ba8d72689b684aff6a751b992
4+
refs/heads/snap-stage3: d316a34ec2cfb983dbfa1458678accc49a6156ad
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/test/compile-fail/lint-unsafe-code.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
#![allow(dead_code)]
1313
#![deny(unsafe_code)]
1414

15+
use std::marker::PhantomFn;
16+
1517
struct Bar;
1618

1719
#[allow(unsafe_code)]
1820
mod allowed_unsafe {
21+
use std::marker::PhantomFn;
1922
fn allowed() { unsafe {} }
2023
unsafe fn also_allowed() {}
21-
unsafe trait AllowedUnsafe {}
24+
unsafe trait AllowedUnsafe : PhantomFn<Self> {}
2225
unsafe impl AllowedUnsafe for super::Bar {}
2326
}
2427

@@ -29,7 +32,7 @@ macro_rules! unsafe_in_macro {
2932
}
3033

3134
unsafe fn baz() {} //~ ERROR: declaration of an `unsafe` function
32-
unsafe trait Foo {} //~ ERROR: declaration of an `unsafe` trait
35+
unsafe trait Foo : PhantomFn<Self> {} //~ ERROR: declaration of an `unsafe` trait
3336
unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait
3437

3538
trait Baz {

0 commit comments

Comments
 (0)