mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Gleaning rustdocflags from target.cfg(…)
is not supported
The bug was `rustflags_from_target` trying to learn rustdocflags from `target.cfg(…).rustflags`, which is definitely wrong. As of this writing, either `target.cfg(…).rustdocflags` or `target.<triple>.rustdocflags` is not supported.
This commit is contained in:
parent
f8d1b30ad3
commit
a4d2e29e21
@ -749,9 +749,15 @@ fn rustflags_from_target(
|
||||
.target_cfgs()?
|
||||
.iter()
|
||||
.filter_map(|(key, cfg)| {
|
||||
cfg.rustflags
|
||||
match flag {
|
||||
Flags::Rust => cfg
|
||||
.rustflags
|
||||
.as_ref()
|
||||
.map(|rustflags| (key, &rustflags.val))
|
||||
.map(|rustflags| (key, &rustflags.val)),
|
||||
// `target.cfg(…).rustdocflags` is currently not supported.
|
||||
// In fact, neither is `target.<triple>.rustdocflags`.
|
||||
Flags::Rustdoc => None,
|
||||
}
|
||||
})
|
||||
.filter(|(key, _rustflags)| CfgExpr::matches_key(key, target_cfg))
|
||||
.for_each(|(_key, cfg_rustflags)| {
|
||||
|
@ -148,9 +148,8 @@ fn not_affected_by_target_rustflags() {
|
||||
.with_stderr_contains("[RUNNING] `rustc [..] -D missing-docs[..]`")
|
||||
.run();
|
||||
|
||||
// This is wrong behaviour. `cargo doc` shouldn't fail.
|
||||
// `cargo doc` shouldn't fail.
|
||||
p.cargo("doc -v")
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[RUNNING] `rustdoc [..] -D missing-docs[..]`")
|
||||
.with_stderr_contains("[RUNNING] `rustdoc [..] --cfg foo[..]`")
|
||||
.run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user