@@ -9,7 +9,7 @@ use crate::session::{
99 setup_cargo_command_inner,
1010} ;
1111use crate :: util;
12- use crate :: util:: args:: { CargoArg , CommandWrapper as _, KaniArg , PassTo , to_rustc_arg } ;
12+ use crate :: util:: args:: { CargoArg , CommandWrapper as _, KaniArg , PassTo , encode_as_rustc_arg } ;
1313use anyhow:: { Context , Result , bail} ;
1414use cargo_metadata:: diagnostic:: { Diagnostic , DiagnosticLevel } ;
1515use cargo_metadata:: {
@@ -81,11 +81,13 @@ crate-type = ["lib"]
8181 // In theory, these could be passed just to the local crate rather than all crates,
8282 // but the `cargo build` command we use for building `std` doesn't allow you to pass `rustc`
8383 // arguments, so we have to pass them through the environment variable instead.
84- rustc_args. push ( to_rustc_arg ( & self . kani_compiler_local_flags ( ) ) ) ;
84+ rustc_args. push ( encode_as_rustc_arg ( & self . kani_compiler_local_flags ( ) ) ) ;
8585
8686 // Ignore global assembly, since `compiler_builtins` has some.
87- rustc_args
88- . push ( to_rustc_arg ( & [ KaniArg :: from ( "--ignore-global-asm" ) , self . reachability_arg ( ) ] ) ) ;
87+ rustc_args. push ( encode_as_rustc_arg ( & [
88+ KaniArg :: from ( "--ignore-global-asm" ) ,
89+ self . reachability_arg ( ) ,
90+ ] ) ) ;
8991
9092 let mut cargo_args: Vec < CargoArg > = vec ! [ "build" . into( ) ] ;
9193 cargo_args. append ( & mut cargo_config_args ( ) ) ;
@@ -148,7 +150,7 @@ crate-type = ["lib"]
148150
149151 let lib_path = lib_folder ( ) . unwrap ( ) ;
150152 let mut rustc_args = self . kani_rustc_flags ( LibConfig :: new ( lib_path) ) ;
151- rustc_args. push ( to_rustc_arg ( & self . kani_compiler_dependency_flags ( ) ) ) ;
153+ rustc_args. push ( encode_as_rustc_arg ( & self . kani_compiler_dependency_flags ( ) ) ) ;
152154
153155 let mut cargo_args: Vec < CargoArg > = vec ! [ "rustc" . into( ) ] ;
154156 if let Some ( path) = & self . args . cargo . manifest_path {
@@ -217,7 +219,7 @@ crate-type = ["lib"]
217219 . arg ( "--" ) // Add this delimiter so we start passing args to rustc and not Cargo
218220 . env ( "RUSTC" , & self . kani_compiler )
219221 . pass_rustc_args ( & rustc_args, PassTo :: AllCrates )
220- . pass_rustc_arg ( to_rustc_arg ( & kani_pkg_args) , PassTo :: OnlyLocalCrate )
222+ . pass_rustc_arg ( encode_as_rustc_arg ( & kani_pkg_args) , PassTo :: OnlyLocalCrate )
221223 // This is only required for stable but is a no-op for nightly channels
222224 . env ( "RUSTC_BOOTSTRAP" , "1" )
223225 . env ( "CARGO_TERM_PROGRESS_WHEN" , "never" ) ;
0 commit comments