rust/compiler
Matthias Krüger f7e1ae40f5
Rollup merge of #135561 - Zalathar:link-dead-code, r=saethlin
Update docs for `-Clink-dead-code` to discourage its use

The `-Clink-dead-code` flag was originally added way back in #31368, apparently to help improve the output of some older forms of code coverage measurement, and also to address some use-cases for wanting to suppress linker flags like `-dead_strip` and `--gc-section`.

In the past it might have also been useful in conjunction with `-Cinstrument-coverage`, but subsequent improvements to coverage instrumentation have made it unnecessary there.

[It is also currently used by cargo-fuzz by default](https://github.com/rust-fuzz/cargo-fuzz/issues/391), for reasons that are possibly no longer relevant.

---

The flag currently does more than its name suggests, affecting not just linker flags, but also monomorphization decisions. It has also contributed to ICEs (e.g. #135515) that would not have occurred without link-dead-code.

---

For now, this PR just updates the documentation to be more realistic about what the flag does, and when it should be used (approximately never). In the future, it might be worth looking into properly deprecating this flag, and perhaps making it a no-op if feasible.
2025-01-16 18:46:10 +01:00
..
rustc switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0 2024-12-03 08:56:33 +00:00
rustc_abi fix ZST handling for Windows ABIs on MSVC target 2025-01-10 12:16:49 +01:00
rustc_arena Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
rustc_ast allowed_through_unstable_modules: support showing a deprecation message when the unstable module name is used 2025-01-15 09:41:33 +01:00
rustc_ast_ir Add sugar for &pin (const|mut) types 2024-10-07 11:15:04 -07:00
rustc_ast_lowering Treat safe target_feature functions as unsafe by default 2025-01-15 08:58:17 +00:00
rustc_ast_passes update cfg(bootstrap) 2025-01-08 21:26:39 +01:00
rustc_ast_pretty Rename PatKind::Lit to Expr 2025-01-08 07:34:59 +00:00
rustc_attr_data_structures allowed_through_unstable_modules: support showing a deprecation message when the unstable module name is used 2025-01-15 09:41:33 +01:00
rustc_attr_parsing allowed_through_unstable_modules: support showing a deprecation message when the unstable module name is used 2025-01-15 09:41:33 +01:00
rustc_baked_icu_data Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_borrowck Coerce safe-to-call target_feature functions to fn pointers. 2025-01-16 10:54:33 +01:00
rustc_builtin_macros Rollup merge of #134877 - DavisRayM:129966-format-string-help-message, r=estebank 2025-01-01 16:35:30 +11:00
rustc_codegen_cranelift Update compiler-builtins to 0.1.143 2025-01-15 04:02:19 +00:00
rustc_codegen_gcc Rollup merge of #134338 - tgross35:overflowing-c-safe-ret, r=bjorn3,antoyo 2025-01-15 04:08:12 -05:00
rustc_codegen_llvm Rollup merge of #133752 - klensy:cp, r=davidtwco 2025-01-13 15:56:55 +01:00
rustc_codegen_ssa Treat safe target_feature functions as unsafe by default 2025-01-15 08:58:17 +00:00
rustc_const_eval Methods of const traits are const 2025-01-15 15:57:06 +00:00
rustc_data_structures coverage: Completely overhaul counter assignment, using node-flow graphs 2025-01-16 22:07:18 +11:00
rustc_driver
rustc_driver_impl add deprecated and do nothing flag to options table 2025-01-06 15:38:02 +03:00
rustc_error_codes Implement use associated items of traits 2025-01-16 16:34:05 +08:00
rustc_error_messages Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
rustc_errors Auto merge of #135402 - matthiaskrgr:rollup-cz7hs13, r=matthiaskrgr 2025-01-12 14:43:10 +00:00
rustc_expand Rollup merge of #135247 - tgross35:stdlib-sym-list, r=oli-obk 2025-01-09 09:05:09 +01:00
rustc_feature Rollup merge of #134754 - frank-king:feature/import_trait_associated_functions, r=oli-obk 2025-01-16 18:46:08 +01:00
rustc_fluent_macro use tracked_path in rustc_fluent_macro 2024-10-19 22:32:38 +08:00
rustc_fs_util
rustc_graphviz
rustc_hir Treat safe target_feature functions as unsafe by default 2025-01-15 08:58:17 +00:00
rustc_hir_analysis Auto merge of #134353 - oli-obk:safe-target-feature-unsafe-by-default, r=wesleywiser 2025-01-15 12:06:56 +00:00
rustc_hir_pretty Treat safe target_feature functions as unsafe by default 2025-01-15 08:58:17 +00:00
rustc_hir_typeck Coerce safe-to-call target_feature functions to fn pointers. 2025-01-16 10:54:33 +01:00
rustc_incremental turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_index Add DenseBitSet::union_not 2025-01-14 23:49:10 +11:00
rustc_index_macros update rustc_index_macros feature handling 2024-12-19 20:32:12 +03:00
rustc_infer rm unnecessary OpaqueTypeDecl wrapper 2025-01-13 14:33:18 +01:00
rustc_interface Rollup merge of #134030 - folkertdev:min-fn-align, r=workingjubilee 2025-01-11 18:13:45 +01:00
rustc_lexer Add test to check unicode identifier version 2024-12-09 06:23:59 -08:00
rustc_lint Rollup merge of #135441 - compiler-errors:redundant-captures-lint, r=lqd 2025-01-13 20:43:48 -05:00
rustc_lint_defs Rollup merge of #132397 - m-ou-se:warn-missing-abi, r=Nadrieril 2025-01-15 04:08:10 -05:00
rustc_llvm llvm: Ignore error value that is always false 2025-01-07 01:02:22 +00:00
rustc_log Avoid naming variables str 2025-01-07 14:30:02 +02:00
rustc_macros Avoid naming variables str 2025-01-07 14:30:02 +02:00
rustc_metadata Mark dependencies of the standard library as private by default 2025-01-14 08:51:19 +00:00
rustc_middle Rollup merge of #135504 - veluca93:target-feature-cast-to-fn-ptr, r=oli-obk 2025-01-16 18:46:09 +01:00
rustc_mir_build Coerce safe-to-call target_feature functions to fn pointers. 2025-01-16 10:54:33 +01:00
rustc_mir_dataflow rename BitSet to DenseBitSet 2025-01-11 11:34:01 +00:00
rustc_mir_transform coverage: Make yank_to_spantree_root iterative instead of recursive 2025-01-16 22:07:18 +11:00
rustc_monomorphize Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for structs 2025-01-15 04:20:25 +00:00
rustc_next_trait_solver Prefer lower TraitUpcasting candidates 2025-01-14 17:59:54 +00:00
rustc_parse Remove allocations from case-insensitive comparison to keywords 2025-01-11 12:39:44 -05:00
rustc_parse_format add suggestion for wrongly ordered format parameters 2024-12-30 06:14:26 -08:00
rustc_passes Rollup merge of #135003 - RalfJung:deprecate-allowed-through-unstable, r=davidtwco 2025-01-15 16:30:11 +01:00
rustc_pattern_analysis rename BitSet to DenseBitSet 2025-01-11 11:34:01 +00:00
rustc_privacy turn hir::ItemKind::Fn into a named-field variant 2025-01-04 11:35:31 +01:00
rustc_query_impl don't return an Option from try_find_dep_kind 2025-01-07 21:57:00 +01:00
rustc_query_system remove code duplication when hashing query result and interning node 2025-01-13 20:25:46 +01:00
rustc_resolve Rollup merge of #134754 - frank-king:feature/import_trait_associated_functions, r=oli-obk 2025-01-16 18:46:08 +01:00
rustc_sanitizers Eliminate an unnecessary Symbol::to_string; use as_str 2025-01-07 14:24:47 +02:00
rustc_serialize Fix explicit_iter_loop in rustc_serialize 2024-10-16 15:44:16 +02:00
rustc_session Update docs for -Clink-dead-code to discourage its use 2025-01-16 15:43:29 +11:00
rustc_smir Auto merge of #134625 - compiler-errors:unsafe-binders-ty, r=oli-obk 2024-12-24 00:51:51 +00:00
rustc_span Rollup merge of #134754 - frank-king:feature/import_trait_associated_functions, r=oli-obk 2025-01-16 18:46:08 +01:00
rustc_symbol_mangling Fix legacy symbol mangling of closures 2025-01-14 16:33:03 +00:00
rustc_target on Windows, consistently pass ZST by-ref 2025-01-12 13:32:36 +01:00
rustc_trait_selection Rollup merge of #135498 - compiler-errors:dyn-upcasting-completeness, r=lcnr 2025-01-15 16:30:17 +01:00
rustc_traits Delay a bug when encountering an impl with unconstrained generics in codegen_select 2024-11-23 05:27:45 +00:00
rustc_transmute add comment explaining why ty_and_layout_field is not used 2024-12-18 11:01:54 +01:00
rustc_ty_utils Consider more erroneous layouts as LayoutError::ReferencesError to suppress spurious errors 2025-01-14 19:07:37 +00:00
rustc_type_ir Rollup merge of #135498 - compiler-errors:dyn-upcasting-completeness, r=lcnr 2025-01-15 16:30:17 +01:00
rustc_type_ir_macros do not relate Abi and Safety 2024-10-22 23:13:04 +02:00
stable_mir make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00