1
Fork 0

Mark windows_subsytem and no_builtins as crate-only attributes.

These attributes are only checked at the crate root, so they should
have a warning if they are used anywhere else.
This commit is contained in:
Eric Huss 2022-01-09 13:08:30 -08:00
parent 59d4bae018
commit b59e743666
3 changed files with 123 additions and 39 deletions

View file

@ -352,7 +352,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
// Runtime
ungated!(
windows_subsystem, Normal,
windows_subsystem, CrateLevel,
template!(NameValueStr: "windows|console"), FutureWarnFollowing
),
ungated!(panic_handler, Normal, template!(Word), WarnFollowing), // RFC 2070
@ -360,7 +360,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
// Code generation:
ungated!(inline, Normal, template!(Word, List: "always|never"), FutureWarnFollowing),
ungated!(cold, Normal, template!(Word), WarnFollowing),
ungated!(no_builtins, Normal, template!(Word), WarnFollowing),
ungated!(no_builtins, CrateLevel, template!(Word), WarnFollowing),
ungated!(target_feature, Normal, template!(List: r#"enable = "name""#), DuplicatesOk),
ungated!(track_caller, Normal, template!(Word), WarnFollowing),
gated!(