diff options
Diffstat (limited to 'tests/rustdoc/const-fn.rs')
-rw-r--r-- | tests/rustdoc/const-fn.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/rustdoc/const-fn.rs b/tests/rustdoc/const-fn.rs new file mode 100644 index 000000000..4366ad4d0 --- /dev/null +++ b/tests/rustdoc/const-fn.rs @@ -0,0 +1,16 @@ +#![crate_name = "foo"] + +// @has foo/fn.bar.html +// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'pub const fn bar() -> ' +/// foo +pub const fn bar() -> usize { + 2 +} + +// @has foo/struct.Foo.html +// @has - '//*[@class="method has-srclink"]' 'const fn new()' +pub struct Foo(usize); + +impl Foo { + pub const fn new() -> Foo { Foo(0) } +} |