2018-09-30 01:00:50 +00:00
|
|
|
#![feature(lint_reasons)]
|
|
|
|
|
2018-09-30 00:25:26 +00:00
|
|
|
#![forbid(
|
|
|
|
unsafe_code,
|
|
|
|
//~^ NOTE `forbid` level set here
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| NOTE `forbid` level set here
|
|
|
|
//~| NOTE `forbid` level set here
|
2018-09-30 00:25:26 +00:00
|
|
|
reason = "our errors & omissions insurance policy doesn't cover unsafe Rust"
|
|
|
|
)]
|
|
|
|
|
|
|
|
use std::ptr;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a_billion_dollar_mistake = ptr::null();
|
|
|
|
|
|
|
|
#[allow(unsafe_code)]
|
|
|
|
//~^ ERROR allow(unsafe_code) overruled by outer forbid(unsafe_code)
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| ERROR allow(unsafe_code) overruled by outer forbid(unsafe_code)
|
|
|
|
//~| ERROR allow(unsafe_code) overruled by outer forbid(unsafe_code)
|
2018-09-30 00:25:26 +00:00
|
|
|
//~| NOTE overruled by previous forbid
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| NOTE overruled by previous forbid
|
|
|
|
//~| NOTE overruled by previous forbid
|
|
|
|
//~| NOTE our errors & omissions insurance policy doesn't cover unsafe Rust
|
|
|
|
//~| NOTE our errors & omissions insurance policy doesn't cover unsafe Rust
|
2018-09-30 00:25:26 +00:00
|
|
|
//~| NOTE our errors & omissions insurance policy doesn't cover unsafe Rust
|
|
|
|
unsafe {
|
|
|
|
*a_billion_dollar_mistake
|
|
|
|
}
|
|
|
|
}
|