@@ -1119,22 +1119,25 @@ fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
1119
1119
while let Some ( arg) = args. next ( ) {
1120
1120
if let Some ( a) = ICE_REPORT_COMPILER_FLAGS . iter ( ) . find ( |a| arg. starts_with ( * a) ) {
1121
1121
let content = if arg. len ( ) == a. len ( ) {
1122
+ // A space-separated option, like `-C incremental=foo` or `--crate-type rlib`
1122
1123
match args. next ( ) {
1123
1124
Some ( arg) => arg. to_string ( ) ,
1124
1125
None => continue ,
1125
1126
}
1126
1127
} else if arg. get ( a. len ( ) ..a. len ( ) + 1 ) == Some ( "=" ) {
1128
+ // An equals option, like `--crate-type=rlib`
1127
1129
arg[ a. len ( ) + 1 ..] . to_string ( )
1128
1130
} else {
1131
+ // A non-space option, like `-Cincremental=foo`
1129
1132
arg[ a. len ( ) ..] . to_string ( )
1130
1133
} ;
1131
- if ICE_REPORT_COMPILER_FLAGS_EXCLUDE . iter ( ) . any ( |exc| content. starts_with ( exc) ) {
1134
+ let option = content. split_once ( '=' ) . map ( |s| s. 0 ) . unwrap_or ( & content) ;
1135
+ if ICE_REPORT_COMPILER_FLAGS_EXCLUDE . iter ( ) . any ( |exc| option == * exc) {
1132
1136
excluded_cargo_defaults = true ;
1133
1137
} else {
1134
1138
result. push ( a. to_string ( ) ) ;
1135
- match ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE . iter ( ) . find ( |s| content. starts_with ( * s) )
1136
- {
1137
- Some ( s) => result. push ( s. to_string ( ) ) ,
1139
+ match ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE . iter ( ) . find ( |s| option == * * s) {
1140
+ Some ( s) => result. push ( format ! ( "{}=[REDACTED]" , s) ) ,
1138
1141
None => result. push ( content) ,
1139
1142
}
1140
1143
}
0 commit comments