1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Cargo flag composition; callers retain flag selection and build policy.
use env;
/// Append arguments to Cargo's effective inherited Rust flags.
///
/// `CARGO_ENCODED_RUSTFLAGS` takes precedence over `RUSTFLAGS`, including when
/// explicitly empty. Ordinary flags are split on whitespace, matching Cargo;
/// additions retain their argument boundaries through unit-separator encoding.
/// Non-Unicode environment values are treated as unavailable.
///
/// Returns `None` without reading either variable when `extra_flags` is empty:
/// leave the command's inherited flags unchanged in that case. Otherwise set
/// the returned string as `CARGO_ENCODED_RUSTFLAGS` on the Cargo command. The
/// caller chooses additions, target-specific flags and the command environment.