File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -2224,8 +2224,8 @@ impl BuildTargetConfig {
2224
2224
let values = match & self . inner . val {
2225
2225
BuildTargetConfigInner :: One ( s) => vec ! [ map( s) ] ,
2226
2226
BuildTargetConfigInner :: Many ( v) => {
2227
- if v . len ( ) > 1 && !config. cli_unstable ( ) . multitarget {
2228
- bail ! ( "specifying multiple `target` in `build.target` config value requires `-Zmultitarget`" )
2227
+ if !config. cli_unstable ( ) . multitarget {
2228
+ bail ! ( "specifying an array in `build.target` config value requires `-Zmultitarget`" )
2229
2229
} else {
2230
2230
v. iter ( ) . map ( map) . collect ( )
2231
2231
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ fn double_target_rejected() {
16
16
}
17
17
18
18
#[ cargo_test]
19
- fn double_target_rejected_with_config ( ) {
19
+ fn array_of_target_rejected_with_config ( ) {
20
20
let p = project ( )
21
21
. file ( "Cargo.toml" , & basic_manifest ( "foo" , "1.0.0" ) )
22
22
. file ( "src/main.rs" , "fn main() {}" )
@@ -30,7 +30,24 @@ fn double_target_rejected_with_config() {
30
30
. build ( ) ;
31
31
32
32
p. cargo ( "build" )
33
- . with_stderr ( "[ERROR] specifying multiple `target` in `build.target` config value requires `-Zmultitarget`" )
33
+ . with_stderr (
34
+ "[ERROR] specifying an array in `build.target` config value requires `-Zmultitarget`" ,
35
+ )
36
+ . with_status ( 101 )
37
+ . run ( ) ;
38
+
39
+ p. change_file (
40
+ ".cargo/config.toml" ,
41
+ r#"
42
+ [build]
43
+ target = ["a"]
44
+ "# ,
45
+ ) ;
46
+
47
+ p. cargo ( "build" )
48
+ . with_stderr (
49
+ "[ERROR] specifying an array in `build.target` config value requires `-Zmultitarget`" ,
50
+ )
34
51
. with_status ( 101 )
35
52
. run ( ) ;
36
53
}
You can’t perform that action at this time.
0 commit comments