Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
d3ec92e16e7e78c273c0f996cad5122ce5a6cdd6
rust/tests/rustdoc/link-assoc-const.rs

17 lines
374 B
Rust
Raw Normal View History

Fix impl assoc constant link not working
2018-03-24 16:38:16 +01:00
#![crate_name = "foo"]
rustdoc: use more precise relative URLS Instead of using a depth counter and adding "../" to get to the top, this commit makes rustdoc actually compare the path of what it's linking from to the path that it's linking to. This makes the resulting HTML shorter. Here's a comparison of one of the largest (non-source) files in the Rust standard library docs (about 4% improvement before gzipping). $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html 2387389 struct.Wrapping.old.html 2298538 struct.Wrapping.new.html Most if it can be efficiently gzipped away. $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz 70679 struct.Wrapping.old.html.gz 70050 struct.Wrapping.new.html.gz But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.
2021-03-17 11:41:01 -07:00
// @has foo/index.html '//a[@href="foo/constant.FIRSTCONST.html"]' 'foo::FIRSTCONST'
// @has foo/index.html '//a[@href="struct.Bar.html#associatedconstant.CONST"]' 'Bar::CONST'
Fix impl assoc constant link not working
2018-03-24 16:38:16 +01:00
//! We have here [`foo::FIRSTCONST`] and [`Bar::CONST`].
pub mod foo {
pub const FIRSTCONST: u32 = 42;
}
pub struct Bar;
impl Bar {
pub const CONST: u32 = 42;
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 936ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API