rustdoc: change .src-line-numbers > span to .src-line-numbers > a
This allows people to treat them like real links, such as right-click to copy URL, and makes the line numbers in a scraped example work at all, when before this commit was added, they had the clickable pointer cursor but did not actually do anything when clicked.
This commit is contained in:
@@ -10,14 +10,14 @@ extern crate source_code;
|
||||
|
||||
// @has 'src/foo/check-source-code-urls-to-def.rs.html'
|
||||
|
||||
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
|
||||
#[path = "auxiliary/source-code-bar.rs"]
|
||||
pub mod bar;
|
||||
|
||||
// @count - '//a[@href="auxiliary/source-code-bar.rs.html#5"]' 4
|
||||
// @count - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#5"]' 4
|
||||
use bar::Bar;
|
||||
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#13"]' 'self'
|
||||
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#13"]' 'self'
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
|
||||
use bar::sub::{self, Trait};
|
||||
|
||||
pub struct Foo;
|
||||
@@ -28,29 +28,29 @@ impl Foo {
|
||||
|
||||
fn babar() {}
|
||||
|
||||
// @has - '//a/@href' '/struct.String.html'
|
||||
// @has - '//a/@href' '/primitive.u32.html'
|
||||
// @has - '//a/@href' '/primitive.str.html'
|
||||
// @count - '//a[@href="#23"]' 5
|
||||
// @has - '//a[@href="../../source_code/struct.SourceCode.html"]' 'source_code::SourceCode'
|
||||
// @has - '//pre[@class="rust"]//a/@href' '/struct.String.html'
|
||||
// @has - '//pre[@class="rust"]//a/@href' '/primitive.u32.html'
|
||||
// @has - '//pre[@class="rust"]//a/@href' '/primitive.str.html'
|
||||
// @count - '//pre[@class="rust"]//a[@href="#23"]' 5
|
||||
// @has - '//pre[@class="rust"]//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) {
|
||||
let x = 12;
|
||||
let y: Foo = Foo;
|
||||
let z: Bar = bar::Bar { field: Foo };
|
||||
babar();
|
||||
// @has - '//a[@href="#26"]' 'hello'
|
||||
// @has - '//pre[@class="rust"]//a[@href="#26"]' 'hello'
|
||||
y.hello();
|
||||
}
|
||||
|
||||
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
|
||||
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
|
||||
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
|
||||
pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {}
|
||||
|
||||
pub trait AnotherTrait {}
|
||||
pub trait WhyNot {}
|
||||
|
||||
// @has - '//a[@href="#49"]' 'AnotherTrait'
|
||||
// @has - '//a[@href="#50"]' 'WhyNot'
|
||||
// @has - '//pre[@class="rust"]//a[@href="#49"]' 'AnotherTrait'
|
||||
// @has - '//pre[@class="rust"]//a[@href="#50"]' 'WhyNot'
|
||||
pub fn foo3<T, V>(t: &T, v: &V)
|
||||
where
|
||||
T: AnotherTrait,
|
||||
@@ -59,11 +59,11 @@ where
|
||||
|
||||
pub trait AnotherTrait2 {}
|
||||
|
||||
// @has - '//a[@href="#60"]' 'AnotherTrait2'
|
||||
// @has - '//pre[@class="rust"]//a[@href="#60"]' 'AnotherTrait2'
|
||||
pub fn foo4() {
|
||||
let x: Vec<AnotherTrait2> = Vec::new();
|
||||
}
|
||||
|
||||
// @has - '//a[@href="../../foo/primitive.bool.html"]' 'bool'
|
||||
// @has - '//pre[@class="rust"]//a[@href="../../foo/primitive.bool.html"]' 'bool'
|
||||
#[doc(primitive = "bool")]
|
||||
mod whatever {}
|
||||
|
||||
Reference in New Issue
Block a user