Files
rust/library/core/src
Dylan DPC 9c310571a8 Rollup merge of #82682 - petrochenkov:cfgeval, r=Aaron1011
Implement built-in attribute macro `#[cfg_eval]` + some refactoring

This PR implements a built-in attribute macro `#[cfg_eval]` as it was suggested in https://github.com/rust-lang/rust/pull/79078 to avoid `#[derive()]` without arguments being abused as a way to configure input for other attributes.

The macro is used for eagerly expanding all `#[cfg]` and `#[cfg_attr]` attributes in its input ("fully configuring" the input).
The effect is identical to effect of `#[derive(Foo, Bar)]` which also fully configures its input before passing it to macros `Foo` and `Bar`, but unlike `#[derive]` `#[cfg_eval]` can be applied to any syntax nodes supporting macro attributes, not only certain items.

`cfg_eval` was the first name suggested in https://github.com/rust-lang/rust/pull/79078, but other alternatives are also possible, e.g. `cfg_expand`.

```rust
#[cfg_eval]
#[my_attr] // Receives `struct S {}` as input, the field is configured away by `#[cfg_eval]`
struct S {
    #[cfg(FALSE)]
    field: u8,
}
```

Tracking issue: https://github.com/rust-lang/rust/issues/82679
2021-03-08 13:13:23 +01:00
..
2021-02-14 17:48:51 -05:00
2021-03-06 16:59:39 +01:00
2021-03-03 11:23:29 +01:00
2021-03-04 10:05:51 +01:00
2021-01-23 16:54:56 +01:00
2021-01-13 14:51:27 +10:00
2021-02-12 13:42:42 +00:00
2020-12-09 23:13:24 +00:00
2020-11-22 13:45:14 +00:00
2021-03-03 11:23:29 +01:00
2021-02-21 17:24:19 +01:00
2021-03-03 11:22:49 +01:00
2021-01-03 19:54:54 +02:00
2020-07-27 19:51:13 -05:00
2020-09-08 22:26:44 -04:00
2021-03-04 18:07:20 +01:00
2020-07-27 19:51:13 -05:00
2020-07-27 19:51:13 -05:00
2020-07-27 19:51:13 -05:00