Skip to content

Commit cf78d93

Browse files
committed
Disable inlining without a warining when coverage is enabled
1 parent b7e28e3 commit cf78d93

File tree

3 files changed

+0
-40
lines changed

3 files changed

+0
-40
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,23 +1827,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
18271827
}
18281828
Some(SymbolManglingVersion::V0) => {}
18291829
}
1830-
1831-
if debugging_opts.mir_opt_level > 1 {
1832-
// Functions inlined during MIR transform can, at best, make it impossible to
1833-
// effectively cover inlined functions, and, at worst, break coverage map generation
1834-
// during LLVM codegen. For example, function counter IDs are only unique within a
1835-
// function. Inlining after these counters are injected can produce duplicate counters,
1836-
// resulting in an invalid coverage map (and ICE); so this option combination is not
1837-
// allowed.
1838-
early_warn(
1839-
error_format,
1840-
&format!(
1841-
"`-Z mir-opt-level={}` (or any level > 1) enables function inlining, which \
1842-
is incompatible with `-Z instrument-coverage`. Inlining will be disabled.",
1843-
debugging_opts.mir_opt_level,
1844-
),
1845-
);
1846-
}
18471830
}
18481831

18491832
if let Ok(graphviz_font) = std::env::var("RUSTC_GRAPHVIZ_FONT") {

src/test/ui/mir/mir-inlining/inline-instrument-coverage-fail.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/test/ui/mir/mir-inlining/inline-instrument-coverage-fail.stderr

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)