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 e6da57f commit e8e43c9Copy full SHA for e8e43c9
src/librustc/session/config.rs
@@ -2214,10 +2214,15 @@ pub fn build_session_options_and_crate_config(
2214
}
2215
};
2216
let debug_assertions = cg.debug_assertions.unwrap_or(opt_level == OptLevel::No);
2217
- let debuginfo = if matches.opt_present("g") {
2218
- if cg.debuginfo.is_some() {
2219
- 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() {
2220
+ Some(i)
2221
+ } else {
2222
+ None
2223
2224
+ }).max();
2225
+ let debuginfo = if max_g > max_c {
2226
DebugInfo::Full
2227
} else {
2228
match cg.debuginfo {
0 commit comments