1
Fork 0
Commit graph

6 commits

Author SHA1 Message Date
Nicholas Nethercote
c9ae38c71e Avoid unnecessary MetaItem/Attribute conversions.
`check_builtin_attribute` calls `parse_meta` to convert an `Attribute`
to a `MetaItem`, which it then checks. However, many callers of
`check_builtin_attribute` start with a `MetaItem`, and then convert it
to an `Attribute` by calling `cx.attribute(meta_item)`. This `MetaItem`
to `Attribute` to `MetaItem` conversion is silly.

This commit adds a new function `check_builtin_meta_item`, which can be
called instead from these call sites. `check_builtin_attribute` also now
calls it. The commit also renames `check_meta` as `check_attr` to better
match its arguments.
2022-11-29 12:08:57 +11:00
Deadbeef
a052f2cce1 Add the #[derive_const] attribute 2022-09-20 11:57:58 +00:00
Jacob Pratt
49c82f31a8
Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
est31
2ef8af6619 Adopt let else in more places 2022-02-19 17:27:43 +01:00
Vadim Petrochenkov
b49fbc9432 expand: Tell built-in macros whether we are currently in forced expansion mode 2020-11-19 19:25:20 +03:00
mark
9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
Renamed from src/librustc_builtin_macros/cfg_accessible.rs (Browse further)