extern library not resolved when specifying --cfg
rust flag in [target.<cfg>]
#11166
Labels
C-bug
Category: bug
--cfg
rust flag in [target.<cfg>]
#11166
Problem
There are some APIs of tokio requiring a special
--cfg tokio_unstable
, like the tokio console with the featuretracing
. By putting this rustflag in[build]
or[target.<triple>]
session, it works well. However, when I put the flag in the[target.<cfg>]
(like[target.'cfg(all())']
),tokio
cannot compile.i.e., this works,
but this doesn't.
By comparing the
cargo check --verbose
, I found that the--extern
option fortracing
passing torustc
is missing. This caused the compiler to fail to resolve thetracing
crate.Steps
.cargo/config.toml
:cargo check --verbose
.Possible Solution(s)
No response
Notes
I've also tried to specify it in the
profile.<profile>.rustflags
, and it does not work either. :(Version
The text was updated successfully, but these errors were encountered: