about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-02-21 10:41:52 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-02-22 01:53:18 +0530
commitd316a34ec2cfb983dbfa1458678accc49a6156ad (patch)
tree40d921af84cba731ad34efa8a46bbd8a4c0ab77e
parent59ab2daad3a2a78ba8d72689b684aff6a751b992 (diff)
downloadrust-d316a34ec2cfb983dbfa1458678accc49a6156ad.tar.gz
rust-d316a34ec2cfb983dbfa1458678accc49a6156ad.zip
Fix lint-unsafe-code test from #22542
-rw-r--r--src/test/compile-fail/lint-unsafe-code.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/compile-fail/lint-unsafe-code.rs b/src/test/compile-fail/lint-unsafe-code.rs
index 486e7142f27..7b17d887757 100644
--- a/src/test/compile-fail/lint-unsafe-code.rs
+++ b/src/test/compile-fail/lint-unsafe-code.rs
@@ -12,13 +12,16 @@
 #![allow(dead_code)]
 #![deny(unsafe_code)]
 
+use std::marker::PhantomFn;
+
 struct Bar;
 
 #[allow(unsafe_code)]
 mod allowed_unsafe {
+    use std::marker::PhantomFn;
     fn allowed() { unsafe {} }
     unsafe fn also_allowed() {}
-    unsafe trait AllowedUnsafe {}
+    unsafe trait AllowedUnsafe : PhantomFn<Self> {}
     unsafe impl AllowedUnsafe for super::Bar {}
 }
 
@@ -29,7 +32,7 @@ macro_rules! unsafe_in_macro {
 }
 
 unsafe fn baz() {} //~ ERROR: declaration of an `unsafe` function
-unsafe trait Foo {} //~ ERROR: declaration of an `unsafe` trait
+unsafe trait Foo : PhantomFn<Self> {} //~ ERROR: declaration of an `unsafe` trait
 unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait
 
 trait Baz {