From d316a34ec2cfb983dbfa1458678accc49a6156ad Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sat, 21 Feb 2015 10:41:52 +0530 Subject: [PATCH] Fix lint-unsafe-code test from #22542 --- src/test/compile-fail/lint-unsafe-code.rs | 7 +++++-- 1 file 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 486e7142f272..7b17d8877572 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 {} 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 {} //~ ERROR: declaration of an `unsafe` trait unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait trait Baz {