File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
#![ feature( rustc_private) ]
2
+ #![ feature( str_strip) ]
2
3
3
4
extern crate rustc_middle;
4
5
extern crate rustc_driver;
@@ -208,7 +209,7 @@ fn main() {
208
209
if seed. is_some ( ) {
209
210
panic ! ( "Cannot specify -Zmiri-seed multiple times!" ) ;
210
211
}
211
- let seed_raw = hex:: decode ( arg. trim_start_matches ( "-Zmiri-seed=" ) )
212
+ let seed_raw = hex:: decode ( arg. strip_prefix ( "-Zmiri-seed=" ) . unwrap ( ) )
212
213
. unwrap_or_else ( |err| match err {
213
214
FromHexError :: InvalidHexCharacter { .. } => panic ! (
214
215
"-Zmiri-seed should only contain valid hex digits [0-9a-fA-F]"
@@ -230,10 +231,10 @@ fn main() {
230
231
}
231
232
arg if arg. starts_with ( "-Zmiri-env-exclude=" ) => {
232
233
excluded_env_vars
233
- . push ( arg. trim_start_matches ( "-Zmiri-env-exclude=" ) . to_owned ( ) ) ;
234
+ . push ( arg. strip_prefix ( "-Zmiri-env-exclude=" ) . unwrap ( ) . to_owned ( ) ) ;
234
235
}
235
236
arg if arg. starts_with ( "-Zmiri-track-pointer-tag=" ) => {
236
- let id: u64 = match arg. trim_start_matches ( "-Zmiri-track-pointer-tag=" ) . parse ( )
237
+ let id: u64 = match arg. strip_prefix ( "-Zmiri-track-pointer-tag=" ) . unwrap ( ) . parse ( )
237
238
{
238
239
Ok ( id) => id,
239
240
Err ( err) => panic ! (
@@ -248,7 +249,7 @@ fn main() {
248
249
}
249
250
}
250
251
arg if arg. starts_with ( "-Zmiri-track-alloc-id=" ) => {
251
- let id: u64 = match arg. trim_start_matches ( "-Zmiri-track-alloc-id=" ) . parse ( )
252
+ let id: u64 = match arg. strip_prefix ( "-Zmiri-track-alloc-id=" ) . unwrap ( ) . parse ( )
252
253
{
253
254
Ok ( id) => id,
254
255
Err ( err) => panic ! (
You can’t perform that action at this time.
0 commit comments