]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/const-fn.rs
Rollup merge of #107819 - clubby789:x-py-root, r=jyn514
[rust.git] / tests / rustdoc / const-fn.rs
1 #![crate_name = "foo"]
2
3 // @has foo/fn.bar.html
4 // @has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> '
5 /// foo
6 pub const fn bar() -> usize {
7     2
8 }
9
10 // @has foo/struct.Foo.html
11 // @has - '//*[@class="method"]' 'const fn new()'
12 pub struct Foo(usize);
13
14 impl Foo {
15     pub const fn new() -> Foo { Foo(0) }
16 }