about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-16 17:00:44 +0100
committerGitHub <noreply@github.com>2025-01-16 17:00:44 +0100
commitfca148185e967ca166f78f63171973f8d540b339 (patch)
tree972ea7bdf00e943e4df4c38d0ac8d2d5d40a4d7d /compiler/rustc_codegen_llvm/src
parentd8a64098c9d0fb25699f657c6efff0bb418f7e18 (diff)
parentc89f0dc01d08cbc79a7bcb8a308585fb1a6544f1 (diff)
downloadrust-fca148185e967ca166f78f63171973f8d540b339.tar.gz
rust-fca148185e967ca166f78f63171973f8d540b339.zip
Rollup merge of #133720 - c410-f3r:cfg-match-foo-bar-baz, r=joshtriplett
[cfg_match] Adjust syntax

A year has passed since the creation of #115585 and the feature, as expected, is not moving forward. Let's change that.

This PR proposes changing the arm's syntax from  `cfg(SOME_CONDITION) => { ... }` to `SOME_CODITION => {}`.

```rust
match_cfg! {
   unix => {
        fn foo() { /* unix specific functionality */ }
    }
    target_pointer_width = "32" => {
        fn foo() { /* non-unix, 32-bit functionality */ }
    }
    _ => {
        fn foo() { /* fallback implementation */ }
    }
}
```

Why? Because after several manual migrations in https://github.com/rust-lang/rust/pull/116342 it became clear,  at least for me, that `cfg` prefixes are unnecessary, verbose and redundant.

Again, everything is just a proposal to move things forward. If the shown syntax isn't ideal, feel free to close this PR or suggest other alternatives.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions