Skip to content

Commit fa7c5b1

Browse files
author
Jon Gjengset
committed
Use a more standard linker flag
1 parent fb0d41f commit fa7c5b1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/testsuite/build_script.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,16 @@ fn custom_build_env_var_rustflags() {
196196
}
197197

198198
#[cargo_test]
199-
fn custom_build_env_var_rustflags_escape() {
199+
fn custom_build_env_var_encoded_rustflags() {
200+
// NOTE: We use "-Clink-arg=-B nope" here rather than, say, "-A missing_docs", since for the
201+
// latter it won't matter if the whitespace accidentally gets split, as rustc will do the right
202+
// thing either way.
200203
let p = project()
201204
.file(
202205
".cargo/config",
203206
r#"
204207
[build]
205-
rustflags = ["-Clink-arg=-add_empty_section text foobar", "--cfg=foo"]
208+
rustflags = ["-Clink-arg=-B nope", "--cfg=foo"]
206209
"#,
207210
)
208211
.file(
@@ -211,7 +214,7 @@ fn custom_build_env_var_rustflags_escape() {
211214
use std::env;
212215
213216
fn main() {{
214-
assert_eq!(env::var("CARGO_ENCODED_RUSTFLAGS").unwrap(), "-Clink-arg=-add_empty_section text foobar\x1f--cfg=foo");
217+
assert_eq!(env::var("CARGO_ENCODED_RUSTFLAGS").unwrap(), "-Clink-arg=-B nope\x1f--cfg=foo");
215218
}}
216219
"#,
217220
)

0 commit comments

Comments
 (0)