about summary refs log tree commit diff
path: root/tests/rustdoc/intra-doc/type-alias-primitive.rs
blob: 7504166cbcce236d23db92afb8ba7f457714c78c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Ensure that no warning is emitted if the disambiguator is used for type alias.
// Regression test for <https://github.com/rust-lang/rust/issues/146855>.

#![crate_name = "foo"]
#![deny(rustdoc::broken_intra_doc_links)]

pub struct Foo;

#[allow(non_camel_case_types)]
pub type f32 = Foo;

/// This function returns [`tyalias@f32`] and not [bla][`prim@f32`].
//@ has 'foo/fn.my_fn.html'
//@ has - '//a[@href="type.f32.html"]' "f32"
//@ has - '//a[@href="{{channel}}/std/primitive.f32.html"]' "bla"
pub fn my_fn() -> f32 { 0. }

/// This function returns [`typealias@f32`].
//@ has 'foo/fn.my_other_fn.html'
//@ has - '//a[@href="type.f32.html"]' "f32"
pub fn my_other_fn() -> f32 { 0. }