about summary refs log tree commit diff
path: root/tests/rustdoc/const-fn-effects.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc/const-fn-effects.rs')
-rw-r--r--tests/rustdoc/const-fn-effects.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/rustdoc/const-fn-effects.rs b/tests/rustdoc/const-fn-effects.rs
new file mode 100644
index 00000000000..49b4cd874e6
--- /dev/null
+++ b/tests/rustdoc/const-fn-effects.rs
@@ -0,0 +1,19 @@
+#![crate_name = "foo"]
+#![feature(effects)]
+
+// @has foo/fn.bar.html
+// @has - '//pre[@class="rust item-decl"]' 'pub const fn bar<const host: bool = true>() -> '
+/// foo
+pub const fn bar() -> usize {
+    2
+}
+
+// @has foo/struct.Foo.html
+// @has - '//*[@class="method"]' 'const fn new<const host: bool = true>()'
+pub struct Foo(usize);
+
+impl Foo {
+    pub const fn new() -> Foo {
+        Foo(0)
+    }
+}