rust/compiler/rustc_builtin_macros/src
Matthias Krüger 783778c631
Rollup merge of #121619 - RossSmyth:pfix_match, r=petrochenkov
Experimental feature postfix match

This has a basic experimental implementation for the RFC postfix match (rust-lang/rfcs#3295, #121618). [Liaison is](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Postfix.20Match.20Liaison/near/423301844) ```@scottmcm``` with the lang team's [experimental feature gate process](https://github.com/rust-lang/lang-team/blob/master/src/how_to/experiment.md).

This feature has had an RFC for a while, and there has been discussion on it for a while. It would probably be valuable to see it out in the field rather than continue discussing it. This feature also allows to see how popular postfix expressions like this are for the postfix macros RFC, as those will take more time to implement.

It is entirely implemented in the parser, so it should be relatively easy to remove if needed.

This PR is split in to 5 commits to ease review.

1. The implementation of the feature & gating.
2. Add a MatchKind field, fix uses, fix pretty.
3. Basic rustfmt impl, as rustfmt crashes upon seeing this syntax without a fix.
4. Add new MatchSource to HIR for Clippy & other HIR consumers
2024-03-22 11:36:58 +01:00
..
assert Add MatchKind member to the Match expr for pretty printing & fmt 2024-03-06 00:35:19 -05:00
deriving Rollup merge of #121619 - RossSmyth:pfix_match, r=petrochenkov 2024-03-22 11:36:58 +01:00
format_foreign Use as_deref in compiler (but only where it makes sense) 2022-11-16 21:58:58 +00:00
alloc_error_handler.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
asm.rs Make unexpected always "return" PResult<()> & add unexpected_any 2024-03-15 11:36:21 +00:00
assert.rs Make unexpected always "return" PResult<()> & add unexpected_any 2024-03-15 11:36:21 +00:00
cfg_accessible.rs Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
cfg_eval.rs Use ControlFlow in AST visitors. 2024-03-05 19:03:20 -05:00
cfg.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
cmdline_attrs.rs Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
compile_error.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
concat_bytes.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
concat_idents.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
concat.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
derive.rs Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
edition_panic.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
env.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
errors.rs Rename AddToDiagnostic as Subdiagnostic. 2024-03-11 10:04:49 +11:00
format_foreign.rs unwrap return Option value, as it always returns Some for some fns 2023-11-28 14:52:21 +03:00
format.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
global_allocator.rs Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11:00
lib.rs Make type_ascribe! not a built-in 2024-03-20 22:28:56 -04:00
log_syntax.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
proc_macro_harness.rs Rename consuming chaining methods on DiagnosticBuilder. 2024-01-10 07:40:00 +11:00
source_util.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
standard_library_imports.rs Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
test_harness.rs Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
test.rs Rename DiagnosticBuilder as Diag. 2024-02-28 08:55:35 +11:00
trace_macros.rs delay expand macro bang when there has indeterminate path 2024-03-13 16:11:16 +08:00
util.rs Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00