rust/compiler
bors b5cdb9631f Auto merge of #117827 - Zalathar:bogus-macro-name-span, r=davidtwco
coverage: Avoid creating malformed macro name spans

This is a workaround for #117788. It detects a particular scenario where we would create malformed coverage spans that might cause `llvm-cov` to immediately exit with an error, preventing the user from processing coverage reports.

The patch has been kept as simple as possible so that it's trivial to backport to beta (or stable) if desired.

---

The `maybe_push_macro_name_span` method is trying to detect macro invocations, so that it can split a span into two parts just after the `!` of the invocation.

Under some circumstances (probably involving nested macros), it gets confused and produces a span that is larger than the original span, and possibly extends outside its enclosing function and even into an adjacent file.

In extreme cases, that can result in malformed coverage mappings that cause `llvm-cov` to fail. For now, we at least want to detect these egregious cases and avoid them, so that coverage reports can still be produced.
2023-11-13 06:16:27 +00:00
..
rustc Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_abi Make the randomize feature of rustc_abi additive 2023-11-05 21:51:47 +03:30
rustc_arena Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_ast Add the vis.visit_capture_by() in noop_visit_expr 2023-11-04 21:11:03 +01:00
rustc_ast_lowering Fix remaining uses of CaptureBy::Value 2023-11-04 19:48:44 +01:00
rustc_ast_passes Auto merge of #117817 - fmease:deny-more-tilde-const, r=fee1-dead 2023-11-12 04:40:44 +00:00
rustc_ast_pretty Clarify space_between. 2023-11-08 14:39:59 +11:00
rustc_attr Auto merge of #117377 - dtolnay:deprecatedsince, r=cjgillot 2023-10-31 10:42:24 +00:00
rustc_baked_icu_data Update ICU4X 2023-11-06 13:42:20 +00:00
rustc_borrowck Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_builtin_macros Emit #[inline] on derive(Debug) 2023-11-09 10:40:55 -05:00
rustc_codegen_cranelift Merge commit 'c84d1871dc4456539b7b578830268ab3539915d0' into sync_cg_clif-2023-11-10 2023-11-10 11:30:51 +00:00
rustc_codegen_gcc Remove libc dependency in cg_gcc alloc_system example 2023-11-02 21:03:27 +01:00
rustc_codegen_llvm warn when using an unstable feature with -Ctarget-feature 2023-11-06 09:44:00 +01:00
rustc_codegen_ssa Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_const_eval Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_data_structures Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkov 2023-11-09 00:39:02 +00:00
rustc_driver Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_driver_impl Use the actual computed crate name for -Zprint-vtable-sizes 2023-11-05 16:29:15 +00:00
rustc_error_codes Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillot 2023-11-05 13:44:59 +00:00
rustc_error_messages Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_errors rustc: minor changes suggested by clippy perf lints. 2023-11-08 08:57:57 +11:00
rustc_expand Replace two create_default_session_if_not_set_then uses. 2023-11-02 19:35:04 +11:00
rustc_feature Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillot 2023-11-05 13:44:59 +00:00
rustc_fluent_macro Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_fs_util Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_graphviz Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_hir Add suggestion to THIR unsafe_op_in_unsafe_fn lint 2023-11-06 16:23:09 +00:00
rustc_hir_analysis Only use normalize_param_env when normalizing predicate in check_item_bounds 2023-11-08 02:35:25 +00:00
rustc_hir_pretty Fix remaining uses of CaptureBy::Value 2023-11-04 19:48:44 +01:00
rustc_hir_typeck Recurse over the method chain and maintain a stack to peek at previous receiver to align spans 2023-11-10 13:00:27 -08:00
rustc_incremental Remove unused LoadResult::DecodeIncrCache variant 2023-11-04 20:16:03 +00:00
rustc_index Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_infer fallback for construct_generic_bound_failure 2023-11-04 22:15:22 +08:00
rustc_interface Add -Zcross-crate-inline-threshold=yes 2023-11-07 18:45:11 -05:00
rustc_lexer Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_lint Remove support for compiler plugins. 2023-11-04 08:50:46 +11:00
rustc_lint_defs Auto merge of #116930 - RalfJung:raw-ptr-match, r=davidtwco 2023-11-08 20:42:32 +00:00
rustc_llvm llvm-wrapper: Remove include of non-existant Vectorize.h 2023-11-07 16:40:35 +01:00
rustc_log Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_macros Derive TyEncodable/TyDecodable implementations that are parameterized over interner 2023-11-04 16:44:42 +00:00
rustc_metadata Rollup merge of #115485 - DaniPopes:rustdoc-macro-consts, r=jackh726,fmease 2023-11-07 19:29:56 +01:00
rustc_middle Auto merge of #115694 - clarfonthey:std-hash-private, r=dtolnay 2023-11-11 21:12:20 +00:00
rustc_mir_build Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_mir_dataflow rename BorrowKind::Shallow to Fake 2023-11-08 22:55:28 +01:00
rustc_mir_transform coverage: Avoid creating malformed macro name spans 2023-11-12 18:33:11 +11:00
rustc_monomorphize Minimize pub usage in source_map.rs. 2023-11-02 19:35:00 +11:00
rustc_parse Auto merge of #117770 - sjwang05:issue-117766, r=estebank,TaKO8Ki 2023-11-13 01:57:59 +00:00
rustc_parse_format Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_passes Remove support for compiler plugins. 2023-11-04 08:50:46 +11:00
rustc_privacy Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_query_impl Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_query_system Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_resolve rustc: minor changes suggested by clippy perf lints. 2023-11-08 08:57:57 +11:00
rustc_serialize Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_session Auto merge of #115694 - clarfonthey:std-hash-private, r=dtolnay 2023-11-11 21:12:20 +00:00
rustc_smir Rollup merge of #117741 - eltociear:patch-23, r=compiler-errors 2023-11-10 01:50:25 +01:00
rustc_span Rollup merge of #117694 - jmillikin:core-io-borrowed-buf, r=m-ou-se 2023-11-09 11:36:52 +09:00
rustc_symbol_mangling Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_target Auto merge of #115694 - clarfonthey:std-hash-private, r=dtolnay 2023-11-11 21:12:20 +00:00
rustc_trait_selection Auto merge of #117712 - lcnr:expand-coroutine, r=jackh726 2023-11-09 14:23:45 +00:00
rustc_traits Auto merge of #117507 - nnethercote:rustc_span, r=Nilstrieb 2023-11-03 14:57:40 +00:00
rustc_transmute Clean up rustc_*/Cargo.toml. 2023-10-30 08:46:02 +11:00
rustc_ty_utils review + add tests 2023-11-02 18:16:37 +01:00
rustc_type_ir Auto merge of #117578 - compiler-errors:derive-encode-in-rustc_type_ir, r=davidtwco 2023-11-06 10:10:52 +00:00
stable_mir rename BorrowKind::Shallow to Fake 2023-11-08 22:55:28 +01:00