Skip to content

Commit fbc46b7

Browse files
committed
Auto merge of #69513 - tmiasko:revert-checked-unused, r=petrochenkov
Revert "Mark attributes consumed by `check_mod_attrs` as normal" This reverts commit d78b22f. Those changes were incompatible with incremental compilation since the effect `check_mod_attrs` has with respect to marking the attributes as used is neither persisted nor recomputed.
2 parents 6d69cab + 34f8394 commit fbc46b7

File tree

3 files changed

+6
-63
lines changed

3 files changed

+6
-63
lines changed

src/librustc_feature/builtin_attrs.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
234234
ungated!(export_name, Whitelisted, template!(NameValueStr: "name")),
235235
ungated!(link_section, Whitelisted, template!(NameValueStr: "name")),
236236
ungated!(no_mangle, Whitelisted, template!(Word)),
237-
ungated!(used, Normal, template!(Word)),
237+
ungated!(used, Whitelisted, template!(Word)),
238238

239239
// Limits:
240240
ungated!(recursion_limit, CrateLevel, template!(NameValueStr: "N")),
@@ -250,17 +250,17 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
250250
ungated!(path, Normal, template!(NameValueStr: "file")),
251251
ungated!(no_std, CrateLevel, template!(Word)),
252252
ungated!(no_implicit_prelude, Normal, template!(Word)),
253-
ungated!(non_exhaustive, Normal, template!(Word)),
253+
ungated!(non_exhaustive, Whitelisted, template!(Word)),
254254

255255
// Runtime
256256
ungated!(windows_subsystem, Whitelisted, template!(NameValueStr: "windows|console")),
257257
ungated!(panic_handler, Normal, template!(Word)), // RFC 2070
258258

259259
// Code generation:
260-
ungated!(inline, Normal, template!(Word, List: "always|never")),
260+
ungated!(inline, Whitelisted, template!(Word, List: "always|never")),
261261
ungated!(cold, Whitelisted, template!(Word)),
262262
ungated!(no_builtins, Whitelisted, template!(Word)),
263-
ungated!(target_feature, Normal, template!(List: r#"enable = "name""#)),
263+
ungated!(target_feature, Whitelisted, template!(List: r#"enable = "name""#)),
264264
gated!(
265265
no_sanitize, Whitelisted,
266266
template!(List: "address, memory, thread"),
@@ -275,7 +275,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
275275
// ==========================================================================
276276

277277
// Linking:
278-
gated!(naked, Normal, template!(Word), naked_functions, experimental!(naked)),
278+
gated!(naked, Whitelisted, template!(Word), naked_functions, experimental!(naked)),
279279
gated!(
280280
link_args, Normal, template!(NameValueStr: "args"),
281281
"the `link_args` attribute is experimental and not portable across platforms, \
@@ -332,7 +332,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
332332
),
333333

334334
gated!(ffi_returns_twice, Whitelisted, template!(Word), experimental!(ffi_returns_twice)),
335-
gated!(track_caller, Normal, template!(Word), experimental!(track_caller)),
335+
gated!(track_caller, Whitelisted, template!(Word), experimental!(track_caller)),
336336
gated!(
337337
register_attr, CrateLevel, template!(List: "attr1, attr2, ..."),
338338
experimental!(register_attr),

src/test/ui/unused/unused-attr-crate.rs

-13
This file was deleted.

src/test/ui/unused/unused-attr-crate.stderr

-44
This file was deleted.

0 commit comments

Comments
 (0)