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

17 lines
345 B
Rust
Raw Normal View History

Fix rendering of const keyword for functions
2017-09-01 23:09:11 +02:00
#![crate_name = "foo"]
// @has foo/fn.bar.html
rustdoc: remove redundant item kind class from `.item-decl > pre` This class originated in the very first commit of `rustdoc_ng`, and was used to add a color border around the item decl based on its kind. https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L102-L106 The item decl no longer has a border, and there aren't any kind-specific styles in modern rustdoc's rendering of this UI item. Most of this commit is updating test cases so that they use `item-decl` to find the `<pre>` tag instead of relying on the fact that the class name had `rust {kind}` in it while other `<pre>` tags only had class `rust`.
2023-01-14 10:58:55 -07:00
// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub const fn bar() -> '
Fix rendering of const keyword for functions
2017-09-01 23:09:11 +02:00
/// foo
pub const fn bar() -> usize {
2
}
// @has foo/struct.Foo.html
Update rustdoc tests
2021-06-02 10:59:10 +02:00
// @has - '//*[@class="method has-srclink"]' 'const fn new()'
Fix rendering of const keyword for functions
2017-09-01 23:09:11 +02:00
pub struct Foo(usize);
impl Foo {
pub const fn new() -> Foo { Foo(0) }
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 778ms Template: 3ms
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