cargo-public-api
cargo-public-api copied to clipboard
Output is e.g. `&mut Write` instead of `&mut dyn Write`
Our integration test for bat contains this line:
pub fn bat::controller::Controller::run_with_error_handler(&self, inputs: Vec<Input<'_>>, handle_error: impl Fn(&Error, &mut Write)) -> Result<bool>
but it should be
pub fn bat::controller::Controller::run_with_error_handler(&self, inputs: Vec<Input<'_>>, handle_error: impl Fn(&Error, &mut dyn Write)) -> Result<bool>
which is what docs.rs displays.
Maybe JSON should have a DynTrait object too? Like in https://github.com/rust-lang/rust/commit/4ea27484c9582389cded2301d1f0dd4f421c8c35
I'm pretty sure we can't solve this in a reasonable way without changes to rustdoc JSON, but I would say that is blocked by https://github.com/Enselic/public-api/issues/88, including the upstream fix. Because HRTB seems highly related to dyn traits, as indicated by that HRTB tests contains lots of dyn traits: https://github.com/rust-lang/rust/blob/508e0584e384556b7e66f57b62e4feeba864b6da/src/test/rustdoc/higher-ranked-trait-bounds.rs
Labelling as "waiting-on-upstream" for now.
Right now upstream does not even know of this problem, so I am removing "waiting-on-upstream" for now. I plan on working on this in the near future.
Filed upstream as https://github.com/rust-lang/rust/issues/99118. I will create a PR for upstream in the near future, unless someone else beats me to it.