@@ -174,9 +174,14 @@ impl LLVM {
174174
175175impl Backend for LLVM {
176176 fn compile ( & self , source : & Source , target : & Path ) -> ProcessOutput {
177- let mut command = Command :: new ( "rustc" ) ;
178-
179- command. arg ( format ! ( "+{}" , self . toolchain) ) ;
177+ let mut command = if let Ok ( path) = std:: env:: var ( "RUSTLANTIS_RUSTC_PATH" ) {
178+ debug ! ( "Compiling with rustc from RUSTLANTIS_RUSTC_PATH" ) ;
179+ Command :: new ( path)
180+ } else {
181+ let mut command = Command :: new ( "rustc" ) ;
182+ command. arg ( format ! ( "+{}" , self . toolchain) ) ;
183+ command
184+ } ;
180185
181186 command
182187 . args ( [ "-o" , target. to_str ( ) . unwrap ( ) ] )
@@ -307,13 +312,18 @@ impl Miri {
307312
308313impl Backend for Miri {
309314 fn execute ( & self , source : & Source , _: & Path ) -> ExecResult {
310- debug ! ( "Executing with Miri {source}" ) ;
311- let mut command = match & self . miri {
312- BackendSource :: Path ( binary) => Command :: new ( binary) ,
313- BackendSource :: Rustup ( toolchain) => {
314- let mut cmd = Command :: new ( "rustup" ) ;
315- cmd. args ( [ "run" , & toolchain, "miri" ] ) ;
316- cmd
315+ let mut command = if let Ok ( path) = std:: env:: var ( "RUSTLANTIS_MIRI_PATH" ) {
316+ debug ! ( "Executing with Miri from RUSTLANTIS_MIRI_PATH" ) ;
317+ Command :: new ( path)
318+ } else {
319+ debug ! ( "Executing with Miri {source}" ) ;
320+ match & self . miri {
321+ BackendSource :: Path ( binary) => Command :: new ( binary) ,
322+ BackendSource :: Rustup ( toolchain) => {
323+ let mut cmd = Command :: new ( "rustup" ) ;
324+ cmd. args ( [ "run" , & toolchain, "miri" ] ) ;
325+ cmd
326+ }
317327 }
318328 } ;
319329 command. args ( self . flags . clone ( ) ) ;
0 commit comments