auto merge of #10606 : huonw/rust/lint-unsafe-in-macro, r=thestinger

Add a test for the case I mentioned on #10599.
This commit is contained in:
bors 2013-11-22 04:41:33 -08:00
commit a9b1dcf24a

View File

@ -10,11 +10,20 @@
#[allow(unused_unsafe)];
#[deny(unsafe_block)];
#[feature(macro_rules)];
unsafe fn allowed() {}
#[allow(unsafe_block)] fn also_allowed() { unsafe {} }
macro_rules! unsafe_in_macro {
() => {
unsafe {} //~ ERROR: usage of an `unsafe` block
}
}
fn main() {
unsafe {} //~ ERROR: usage of an `unsafe` block
unsafe_in_macro!()
}