Cargo concatenates rustflags
from .cargo/configs
s in reversed order
#8128
Labels
A-configuration
Area: cargo config files and env vars
A-rustflags
Area: rustflags
C-bug
Category: bug
Consider this setup:
Less specific
outer/.cargo/config
containsMore specific
outer/inner/.cargo/config
containsThe compiler's command line in this case is
rustc --crate-name inner --edition=2018 'src\main.rs' ... -Ccodegen-units=2 -Ccodegen-units=1
rustc
like many other tools prefers the last specified value for the given option to support hierarchical build systems.With Cargo's flag concatenation behavior this means that less specific flags override more specific flags, which is not a correct behavior.
cc rust-lang/rust#70729 (comment)
The text was updated successfully, but these errors were encountered: