joshlf
1
If I have the following code:
trait Foo {
fn bar();
}
struct Baz;
impl Foo for Baz {
fn bar() {}
}
Is it possible to create a rustdoc link to the impl of Foo::bar
for Baz
? I've tried the following, and neither work:
/// Blah blah [`Baz::bar`] blah blah.
///
/// [`Baz::bar`]: crate::Baz::bar
/// Blah blah [`Baz::bar`] blah blah.
///
/// [`Baz::bar`]: <crate::Baz as Foo>::bar
Any ideas how I can get this to work?
cuviper
2
joshlf
3
I'm confused; aren't these sorts of links already supported? I use these sorts of links in code all the time, e.g.:
/// Implements [`Iterator`]...
cuviper
4
That only works on nightly. On stable rust, those brackets will be shown as plain text.
joshlf
5
Ah, I see. It's worked for so long that I guess I just assumed it was stable. Given that I'm on nightly, is there a way to make this work?
system
Closed
6
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.