Closed
Description
# Cargo.toml
[package]
name = "repro"
version = "0.0.0"
edition = "2021"
publish = false
[dependencies]
foo = { path = "foo" }
// src/lib.rs
pub use foo::repro;
# foo/Cargo.toml
[package]
name = "foo"
version = "0.0.0"
edition = "2021"
publish = false
// foo/src/lib.rs
pub fn repro<F>()
where
F: Fn(&str),
{
unimplemented!()
}
The correct behavior is for both crates' docs to render repro
as:
However, recent versions of nightly rustdoc render foo::repro
as the above, while rendering repro::repro
incorrectly as:
I believe this is a bug because that is not valid syntax in Rust.
error[E0637]: `'_` cannot be used here
--> src/lib.rs:3:12
|
3 | F: for<'_> Fn(&str),
| ^^ `'_` is a reserved lifetime name