]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/lint/reasons-forbidden.rs
1 #![feature(lint_reasons)]
3 // If you turn off deduplicate diagnostics (which rustc turns on by default but
4 // compiletest turns off when it runs ui tests), then the errors are
5 // (unfortunately) repeated here because the checking is done as we read in the
6 // errors, and currently that happens two or three different times, depending on
9 // The test is much cleaner if we deduplicate, though.
11 // compile-flags: -Z deduplicate-diagnostics=yes
15 //~^ NOTE `forbid` level set here
16 //~| NOTE the lint level is defined here
17 reason
= "our errors & omissions insurance policy doesn't cover unsafe Rust"
23 let a_billion_dollar_mistake
= ptr
::null();
26 //~^ ERROR allow(unsafe_code) incompatible with previous forbid
27 //~| NOTE our errors & omissions insurance policy doesn't cover unsafe Rust
28 //~| NOTE overruled by previous forbid
30 //~^ ERROR usage of an `unsafe` block
31 //~| NOTE our errors & omissions insurance policy doesn't cover unsafe Rust
32 *a_billion_dollar_mistake