Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
901b340c1f5d208561d4261cc3ee634973b35326
rust/tests/ui/lint/auxiliary/deny-macro.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
117 B
Rust
Raw Normal View History

Allow `#[deny(..)]` inside `#[forbid(..)]` as a no-op with a warning Forbid cannot be overriden. When someome tries to do this anyways, it results in a hard error. That makes sense. Except it doesn't, because macros. Macros may reasonably use `#[deny]` in their expansion to assert that their expanded code follows the lint. This is doesn't work when the output gets expanded into a `forbid()` context. This is pretty silly, since both the macros and the code agree on the lint! Therefore, we allow `#[deny(..)]`ing a lint that's already forbidden, keeping the level at forbid.
2024-10-17 19:34:04 +02:00
#[macro_export]
macro_rules! emit_deny {
() => {
#[deny(unsafe_code)]
let _so_safe = 0;
};
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 158ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API