rust/compiler/rustc_llvm
Jubilee Young 23623a08d6 Explicitly assign constructed C++ classes
C++ style guides I am aware of recommend specifically preferring = syntax
for any classes with fairly obvious constructors[^0] that do not perform
any complicated logic in their constructor. I contend that all constructors
that the `rustc_llvm` code uses qualify. This has only become more common
since C++ 17 guaranteed many cases of copy initialization elision.

The other detail is that I tried to ask another contributor with
infinitely more C++ experience than me (i.e. any) what this constructor
syntax was, and they thought it was a macro. I know of no other language
that has adopted this same syntax. As the rustc codebase features many
contributors experienced in many other languages, using a less...
unique... style has many other benefits in making this code more
lucid and maintainable, which is something it direly needs.

[^0]: e.g. https://abseil.io/tips/88
2024-03-05 21:15:56 -08:00
..
llvm-wrapper Explicitly assign constructed C++ classes 2024-03-05 21:15:56 -08:00
src Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
build.rs Use new check-cfg syntax in rustc_llvm build script 2023-12-05 13:25:11 +01:00
Cargo.toml Pin cc version 2024-02-13 21:13:06 +00:00