rust/compiler
Matthias Krüger 869529a130
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
2024-03-07 00:57:40 +01:00
..
rustc
rustc_abi Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_arena rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
rustc_ast Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_ast_ir Move visitor utils to rustc_ast_ir 2024-03-05 12:38:03 -05:00
rustc_ast_lowering Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_ast_passes Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_ast_pretty Rollup merge of #121815 - nnethercote:mv-gather_comments, r=est31 2024-03-02 10:09:36 +01:00
rustc_attr Rewrite the untranslatable_diagnostic lint. 2024-03-06 14:19:01 +11:00
rustc_baked_icu_data
rustc_borrowck Add missing #[rustc_lint_diagnostics] attributes. 2024-03-06 14:19:38 +11:00
rustc_builtin_macros Move visitor utils to rustc_ast_ir 2024-03-05 12:38:03 -05:00
rustc_codegen_cranelift only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_codegen_gcc only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_codegen_llvm only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_codegen_ssa Rollup merge of #122051 - erikdesjardins:cleanup, r=nikic 2024-03-06 22:02:48 +01:00
rustc_const_eval Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_data_structures Rollup merge of #120976 - matthiaskrgr:constify_TL_statics, r=lcnr 2024-03-04 22:16:30 +01:00
rustc_driver
rustc_driver_impl Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_error_codes Rollup merge of #120684 - carschandler:patch-1, r=nnethercote 2024-03-02 10:09:35 +01:00
rustc_error_messages Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_errors Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_expand Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_feature Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_fluent_macro Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_fs_util Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_graphviz Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_hir Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_hir_analysis Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk 2024-03-06 10:04:26 +00:00
rustc_hir_pretty Lower anonymous structs or unions to HIR 2024-02-12 12:47:23 +08:00
rustc_hir_typeck Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_incremental Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00
rustc_index doc: Add better explanation 2024-03-06 16:54:42 +01:00
rustc_index_macros Step all bootstrap cfgs forward 2024-02-08 07:44:34 -05:00
rustc_infer Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk 2024-03-06 10:04:26 +00:00
rustc_interface Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_lexer Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_lint Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_lint_defs Rename BuiltinLintDiagnostics as BuiltinLintDiag. 2024-03-05 12:15:10 +11:00
rustc_llvm Rollup merge of #122062 - workingjubilee:initialize-my-fist, r=cuviper 2024-03-07 00:57:40 +01:00
rustc_log rustc_log: expose tracing-tree "wraparound" in an env var 2024-03-03 12:33:26 +01:00
rustc_macros Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
rustc_metadata Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_middle Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnostic-lint, r=davidtwco 2024-03-06 22:02:46 +01:00
rustc_mir_build Rename SubdiagnosticMessageOp as SubdiagMessageOp. 2024-03-05 12:14:49 +11:00
rustc_mir_dataflow Return a struct from query intrinsic to be able to add another field in the next commit 2024-03-04 16:13:50 +00:00
rustc_mir_transform Auto merge of #121780 - nnethercote:diag-renaming2, r=davidtwco 2024-03-05 02:58:34 +00:00
rustc_monomorphize Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
rustc_next_trait_solver Allow a way to add constructors for rustc_type_ir types 2024-03-04 15:39:59 +00:00
rustc_parse Rename BuiltinLintDiagnostics as BuiltinLintDiag. 2024-03-05 12:15:10 +11:00
rustc_parse_format remove a couple of redundant clones 2024-02-17 12:46:18 +01:00
rustc_passes Add missing #[rustc_lint_diagnostics] attributes. 2024-03-06 14:19:38 +11:00
rustc_pattern_analysis Rollup merge of #121987 - Nadrieril:abort-on-arity-mismatch, r=compiler-errors 2024-03-05 06:40:33 +01:00
rustc_privacy Convert SpannedTypeVisitor to use VisitorResult 2024-03-05 13:30:46 -05:00
rustc_query_impl Avoid using unnecessary queries when printing the query stack in panics 2024-03-04 20:43:58 +01:00
rustc_query_system Don't panic when waiting on poisoned queries 2024-03-02 19:51:56 +01:00
rustc_resolve Rollup merge of #122038 - Alexendoo:unused-qualifications, r=petrochenkov 2024-03-06 22:02:47 +01:00
rustc_serialize Replace NonZero::<_>::new with NonZero::new. 2024-02-15 08:09:42 +01:00
rustc_session Rollup merge of #121959 - sundeep-kokkonda:patch-2, r=davidtwco 2024-03-06 22:02:47 +01:00
rustc_smir Add support to new float types 2024-03-01 11:16:35 -08:00
rustc_span only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
rustc_symbol_mangling Rollup merge of #121841 - tgross35:f16-f128-step2-intrinsics, r=compiler-errors 2024-03-02 20:13:24 +01:00
rustc_target Add a description field to target definitions 2024-03-05 15:42:10 +00:00
rustc_trait_selection Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr 2024-03-06 02:18:22 +00:00
rustc_traits Rename some normalization-related items 2024-02-20 17:30:49 +01:00
rustc_transmute Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
rustc_ty_utils Auto merge of #121679 - lcnr:opaque-wf-check-2, r=oli-obk 2024-03-06 10:04:26 +00:00
rustc_type_ir Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
stable_mir Add support to new float types 2024-03-01 11:16:35 -08:00