cuviper / autocfg

Automatic cfg for Rust compiler features
Apache License 2.0
95 stars 24 forks source link

Consider adding `--cap-lints=warn` to probe `rustc` invocations #41

Open Xiphoseer opened 2 years ago

Xiphoseer commented 2 years ago

As mentioned in bluss/indexmap#144, the rust-server openapi-generator generates a local .cargo/config with -W missing_docs and -D warnings. This causes

warning: autocfg could not probe for `std`
error: missing documentation for the crate
 --> <anon>:1:1
  |
1 | extern crate std as probe;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `-D missing-docs` implied by `-D warnings`

error: aborting due to previous error

which causes indexmap to expose the wrong API and breaks the compilation of an older version of h2.

As far as I can tell, this is exactly what --cap-lints has been introduced to solve, so it might make sense to pass this flag to probe invocations of rustc.