We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 544d8e9 commit 226894bCopy full SHA for 226894b
src/librustc/session/config.rs
@@ -2217,10 +2217,15 @@ pub fn build_session_options_and_crate_config(
2217
}
2218
};
2219
let debug_assertions = cg.debug_assertions.unwrap_or(opt_level == OptLevel::No);
2220
- let debuginfo = if matches.opt_present("g") {
2221
- if cg.debuginfo.is_some() {
2222
- early_error(error_format, "-g and -C debuginfo both provided");
+ let max_g = matches.opt_positions("g").into_iter().max();
+ let max_c = matches.opt_strs_pos("C").into_iter().flat_map(|(i, s)| {
+ if let Some("debuginfo") = s.splitn(2, '=').next() {
2223
+ Some(i)
2224
+ } else {
2225
+ None
2226
2227
+ }).max();
2228
+ let debuginfo = if max_g > max_c {
2229
DebugInfo::Full
2230
} else {
2231
match cg.debuginfo {
0 commit comments