File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,38 @@ windows
794
794
. run ( ) ;
795
795
}
796
796
797
+ #[ cargo_test]
798
+ fn rustc_with_print_cfg_config_toml_env ( ) {
799
+ let p = project ( )
800
+ . file ( "Cargo.toml" , & basic_bin_manifest ( "foo" ) )
801
+ . file (
802
+ "targets/best-target.json" ,
803
+ r#"{
804
+ "llvm-target": "x86_64-unknown-none",
805
+ "target-pointer-width": "64",
806
+ "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
807
+ "arch": "x86_64"
808
+ }"# ,
809
+ )
810
+ . file (
811
+ ".cargo/config.toml" ,
812
+ r#"
813
+ [build]
814
+ target = "best-target"
815
+ [env]
816
+ RUST_TARGET_PATH = { value = "./targets", relative = true }
817
+ "# ,
818
+ )
819
+ . file ( "src/main.rs" , r#"fn main() {} "# )
820
+ . build ( ) ;
821
+
822
+ p. cargo ( "rustc -Z unstable-options --print cfg" )
823
+ . masquerade_as_nightly_cargo ( & [ "print" ] )
824
+ . with_status ( 101 )
825
+ . with_stdout_data ( str![ "..." ] . unordered ( ) )
826
+ . run ( ) ;
827
+ }
828
+
797
829
#[ cargo_test]
798
830
fn precedence ( ) {
799
831
// Ensure that the precedence of cargo-rustc is only lower than RUSTFLAGS,
You can’t perform that action at this time.
0 commit comments