2021-11-26 17:03:16 -06:00
|
|
|
#![feature(min_specialization)]
|
2019-04-14 17:53:51 -05:00
|
|
|
|
|
|
|
// @has default_trait_method/trait.Item.html
|
|
|
|
pub trait Item {
|
2023-06-22 21:28:29 -05:00
|
|
|
// @has - '//*[@id="tymethod.foo"]' 'fn foo()'
|
|
|
|
// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()'
|
2019-04-14 17:53:51 -05:00
|
|
|
fn foo();
|
2023-06-22 21:28:29 -05:00
|
|
|
|
|
|
|
// @has - '//*[@id="tymethod.bar"]' 'fn bar()'
|
|
|
|
// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()'
|
2019-04-14 17:53:51 -05:00
|
|
|
fn bar();
|
2023-06-22 21:28:29 -05:00
|
|
|
|
|
|
|
// @has - '//*[@id="tymethod.baz"]' 'unsafe fn baz()'
|
|
|
|
// @!has - '//*[@id="tymethod.baz"]' 'default unsafe fn baz()'
|
|
|
|
unsafe fn baz();
|
|
|
|
|
|
|
|
// @has - '//*[@id="tymethod.quux"]' 'unsafe fn quux()'
|
|
|
|
// @!has - '//*[@id="tymethod.quux"]' 'default unsafe fn quux()'
|
|
|
|
unsafe fn quux();
|
|
|
|
|
|
|
|
// @has - '//*[@id="method.xyzzy"]' 'fn xyzzy()'
|
|
|
|
// @!has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()'
|
|
|
|
fn xyzzy() {}
|
2019-04-14 17:53:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// @has default_trait_method/struct.Foo.html
|
|
|
|
pub struct Foo;
|
|
|
|
impl Item for Foo {
|
2023-06-22 21:28:29 -05:00
|
|
|
// @has - '//*[@id="method.foo"]' 'default fn foo()'
|
2019-04-14 17:53:51 -05:00
|
|
|
default fn foo() {}
|
2023-06-22 21:28:29 -05:00
|
|
|
|
|
|
|
// @has - '//*[@id="method.bar"]' 'fn bar()'
|
|
|
|
// @!has - '//*[@id="method.bar"]' 'default fn bar()'
|
2019-04-14 17:53:51 -05:00
|
|
|
fn bar() {}
|
2023-06-22 21:28:29 -05:00
|
|
|
|
|
|
|
// @has - '//*[@id="method.baz"]' 'default unsafe fn baz()'
|
|
|
|
default unsafe fn baz() {}
|
|
|
|
|
|
|
|
// @has - '//*[@id="method.quux"]' 'unsafe fn quux()'
|
|
|
|
// @!has - '//*[@id="method.quux"]' 'default unsafe fn quux()'
|
|
|
|
unsafe fn quux() {}
|
|
|
|
|
|
|
|
// @has - '//*[@id="method.xyzzy"]' 'fn xyzzy()'
|
|
|
|
// @!has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()'
|
2019-04-14 17:53:51 -05:00
|
|
|
}
|