2021-04-13 20:03:29 +00:00
|
|
|
// compile-flags: -Zunstable-options --generate-link-to-definition
|
2021-06-12 20:08:43 +00:00
|
|
|
// aux-build:source_code.rs
|
|
|
|
// build-aux-docs
|
2021-04-13 20:03:29 +00:00
|
|
|
|
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
2021-06-12 20:08:43 +00:00
|
|
|
extern crate source_code;
|
|
|
|
|
2021-04-13 20:51:56 +00:00
|
|
|
// @has 'src/foo/check-source-code-urls-to-def.rs.html'
|
|
|
|
|
|
|
|
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
|
2021-04-13 20:03:29 +00:00
|
|
|
#[path = "auxiliary/source-code-bar.rs"]
|
|
|
|
pub mod bar;
|
|
|
|
|
|
|
|
// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5-7"]' 4
|
|
|
|
use bar::Bar;
|
|
|
|
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13-17"]' 'self'
|
|
|
|
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
|
|
|
|
use bar::sub::{self, Trait};
|
|
|
|
|
|
|
|
pub struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn hello(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn babar() {}
|
|
|
|
|
|
|
|
// @has - '//a[@href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"]' 'String'
|
2021-06-12 20:08:43 +00:00
|
|
|
// @count - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#21"]' 5
|
|
|
|
// @has - '//a[@href="../../source_code/struct.SourceCode.html"]' 'source_code::SourceCode'
|
|
|
|
pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) {
|
2021-04-13 20:03:29 +00:00
|
|
|
let x = 12;
|
|
|
|
let y: Foo = Foo;
|
|
|
|
let z: Bar = bar::Bar { field: Foo };
|
|
|
|
babar();
|
2021-06-12 20:08:43 +00:00
|
|
|
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#24"]' 'hello'
|
2021-04-13 20:03:29 +00:00
|
|
|
y.hello();
|
|
|
|
}
|
|
|
|
|
|
|
|
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait'
|
|
|
|
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
|
|
|
|
pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V) {
|
|
|
|
}
|