Rollup merge of #86334 - LeSeulArtichaut:86120-links-type-aliases, r=jyn514

Resolve type aliases to the type they point to in intra-doc links

This feels a bit sketchy, but I think it's better than just rejecting the link.
Helps with #86120, r? ``@jyn514``
This commit is contained in:
Yuki Okushi 2021-06-22 07:37:49 +09:00 committed by GitHub
commit 83d9b1bb02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 65 additions and 5 deletions

View file

@ -0,0 +1,19 @@
// Regression test for issue #86120.
#![deny(broken_intra_doc_links)]
#![crate_name = "foo"]
pub struct Foo;
/// You should really try [`Self::bar`]!
pub type Bar = Foo;
impl Bar {
pub fn bar() {}
}
/// The minimum is [`Self::MIN`].
pub type Int = i32;
// @has foo/type.Bar.html '//a[@href="struct.Foo.html#method.bar"]' 'Self::bar'
// @has foo/type.Int.html '//a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MIN"]' 'Self::MIN'