about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/Linker.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-07 00:57:40 +0100
committerGitHub <noreply@github.com>2024-03-07 00:57:40 +0100
commit869529a13085da190f9870d544fd9018bda2e487 (patch)
tree33b1c2221e663435e98e2aacbe4e2742cf4b9526 /compiler/rustc_llvm/llvm-wrapper/Linker.cpp
parent8dc49e1b8ef4f6e67db9b5c97546df6b8319e398 (diff)
parent23623a08d6a181864a7b8609682eee27534b12f4 (diff)
downloadrust-869529a13085da190f9870d544fd9018bda2e487.tar.gz
rust-869529a13085da190f9870d544fd9018bda2e487.zip
Rollup merge of #122062 - workingjubilee:initialize-my-fist, r=cuviper
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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions