rust/tests/rustdoc-html/final-trait-method.rs
mu001999 f0a019bf90 Render final associated functions correctly in rustdoc
Co-authored-by: Michael Goulet <michael@errs.io>
2026-02-12 15:18:15 +08:00

22 lines
679 B
Rust

#![feature(final_associated_functions)]
//@ has final_trait_method/trait.Item.html
pub trait Item {
//@ has - '//*[@id="method.foo"]' 'final fn foo()'
//@ !has - '//*[@id="method.foo"]' 'default fn foo()'
final fn foo() {}
//@ has - '//*[@id="method.bar"]' 'fn bar()'
//@ !has - '//*[@id="method.bar"]' 'default fn bar()'
//@ !has - '//*[@id="method.bar"]' 'final fn bar()'
fn bar() {}
}
//@ has final_trait_method/struct.Foo.html
pub struct Foo;
impl Item for Foo {
//@ has - '//*[@id="method.bar"]' 'fn bar()'
//@ !has - '//*[@id="method.bar"]' 'final fn bar()'
//@ !has - '//*[@id="method.bar"]' 'default fn bar()'
fn bar() {}
}