1 // compile-flags: -Zunstable-options --generate-link-to-definition
2 // aux-build:source_code.rs
5 #![feature(rustdoc_internals)]
9 extern crate source_code;
11 // @has 'src/foo/check-source-code-urls-to-def.rs.html'
13 // @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
14 #[path = "auxiliary/source-code-bar.rs"]
17 // @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5-7"]' 4
19 // @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13-17"]' 'self'
20 // @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
21 use bar::sub::{self, Trait};
31 // @has - '//a/@href' '/struct.String.html'
32 // @has - '//a/@href' '/primitive.u32.html'
33 // @has - '//a/@href' '/primitive.str.html'
34 // @count - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#23"]' 5
35 // @has - '//a[@href="../../source_code/struct.SourceCode.html"]' 'source_code::SourceCode'
36 pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) {
39 let z: Bar = bar::Bar { field: Foo };
41 // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#26"]' 'hello'
45 // @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait'
46 // @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
47 pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {}
49 pub trait AnotherTrait {}
52 // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#49"]' 'AnotherTrait'
53 // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#50"]' 'WhyNot'
54 pub fn foo3<T, V>(t: &T, v: &V)
60 pub trait AnotherTrait2 {}
62 // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#60"]' 'AnotherTrait2'
64 let x: Vec<AnotherTrait2> = Vec::new();
67 // @has - '//a[@href="../../foo/primitive.bool.html"]' 'bool'
68 #[doc(primitive = "bool")]