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 11#![ feature( rustc_private) ]
2+ #![ feature( str_strip) ]
23
34extern crate rustc_middle;
45extern crate rustc_driver;
@@ -208,7 +209,7 @@ fn main() {
208209 if seed. is_some ( ) {
209210 panic ! ( "Cannot specify -Zmiri-seed multiple times!" ) ;
210211 }
211- let seed_raw = hex:: decode ( arg. trim_start_matches ( "-Zmiri-seed=" ) )
212+ let seed_raw = hex:: decode ( arg. strip_prefix ( "-Zmiri-seed=" ) . unwrap ( ) )
212213 . unwrap_or_else ( |err| match err {
213214 FromHexError :: InvalidHexCharacter { .. } => panic ! (
214215 "-Zmiri-seed should only contain valid hex digits [0-9a-fA-F]"
@@ -230,10 +231,10 @@ fn main() {
230231 }
231232 arg if arg. starts_with ( "-Zmiri-env-exclude=" ) => {
232233 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 ( ) ) ;
234235 }
235236 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 ( )
237238 {
238239 Ok ( id) => id,
239240 Err ( err) => panic ! (
@@ -248,7 +249,7 @@ fn main() {
248249 }
249250 }
250251 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 ( )
252253 {
253254 Ok ( id) => id,
254255 Err ( err) => panic ! (
You can’t perform that action at this time.
0 commit comments