rust/compiler/rustc_parse/src/parser
bors e9182f195b Auto merge of #143461 - folkertdev:cfg-select-builtin-macro, r=petrochenkov
make `cfg_select` a builtin macro

tracking issue: https://github.com/rust-lang/rust/issues/115585

This parses mostly the same as the `macro cfg_select` version, except:

1. wrapping in double brackets is no longer supported (or needed): `cfg_select {{ /* ... */ }}` is now rejected.
2. in an expression context, the rhs is no longer wrapped in a block, so that this now works:
  ```rust
  fn main() {
      println!(cfg_select! {
          unix => { "foo" }
          _ => { "bar" }
      });
  }
  ```
3. a single wildcard rule is now supported: `cfg_select { _ => 1 }` now works

I've also added an error if none of the rules evaluate to true, and warnings for any arms that follow the `_` wildcard rule.

cc `@traviscross` if I'm missing any feature that should/should not be included
r? `@petrochenkov` for the macro logic details
2025-07-13 18:34:13 +00:00
..
tokenstream remove eq_unspanned from TokenStream 2025-05-26 17:02:51 +08:00
asm.rs move asm parsing code into rustc_parse 2025-05-27 09:44:10 +02:00
attr.rs Move various token stream things from rustc_parse to rustc_ast. 2025-04-29 12:14:27 +10:00
attr_wrapper.rs Use ThinVec to shrink LazyAttrTokenStreamInner. 2025-04-30 07:12:09 +10:00
cfg_select.rs make cfg_select a builtin macro 2025-07-13 14:34:40 +02:00
diagnostics.rs compiler: rename {ast,hir}::BareFn* to FnPtr* 2025-07-06 15:03:08 -07:00
expr.rs Remove let_chains feature 2025-06-30 07:49:20 -05:00
generics.rs Replace kw_span by full span. 2025-07-03 14:59:27 +00:00
item.rs Remove uncessary parens in closure body with unused lint 2025-07-10 09:25:56 +08:00
mod.rs Auto merge of #143461 - folkertdev:cfg-select-builtin-macro, r=petrochenkov 2025-07-13 18:34:13 +00:00
nonterminal.rs Remove token::{Open,Close}Delim. 2025-04-21 07:35:56 +10:00
pat.rs avoid &mut P<T> in visit_expr etc methods 2025-06-12 17:36:03 +08:00
path.rs Add Ident::is_non_reserved_ident 2025-06-26 18:11:14 +00:00
stmt.rs Add Ident::is_non_reserved_ident 2025-06-26 18:11:14 +00:00
tests.rs Extract Translator struct 2025-06-19 13:02:04 -05:00
token_type.rs Remove token::{Open,Close}Delim. 2025-04-21 07:35:56 +10:00
ty.rs compiler: rename {ast,hir}::BareFn* to FnPtr* 2025-07-06 15:03:08 -07:00