Skip to content
Merged
Prev Previous commit
Next Next commit
Add regression tests
(cherry picked from commit 20363f4)
  • Loading branch information
oli-obk authored and cuviper committed Oct 21, 2023
commit dbbf3773689fdd78351af12f81e17082b0c94d62
19 changes: 19 additions & 0 deletions tests/rustdoc/const-fn-effects.rs
Original file line number Diff line number Diff line change
@@ -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)
}
}