2022-08-07 00:47:32 -05:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
|
|
|
// Check that default trait items that are impossible to satisfy
|
|
|
|
|
|
|
|
pub trait Foo {
|
|
|
|
fn needs_sized(&self)
|
|
|
|
where
|
|
|
|
Self: Sized,
|
|
|
|
{}
|
|
|
|
|
|
|
|
fn no_needs_sized(&self) {}
|
|
|
|
}
|
|
|
|
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ !has foo/struct.Bar.html '//*[@id="method.needs_sized"]//h4[@class="code-header"]' \
|
2022-08-07 00:47:32 -05:00
|
|
|
// "fn needs_sized"
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has foo/struct.Bar.html '//*[@id="method.no_needs_sized"]//h4[@class="code-header"]' \
|
2022-08-07 00:47:32 -05:00
|
|
|
// "fn no_needs_sized"
|
|
|
|
pub struct Bar([u8]);
|
|
|
|
|
|
|
|
impl Foo for Bar {}
|
2024-10-17 11:31:48 -05:00
|
|
|
|
|
|
|
//@ has foo/struct.Generic.html '//*[@id="method.needs_sized"]//h4[@class="code-header"]' \
|
|
|
|
// "fn needs_sized"
|
|
|
|
//@ has foo/struct.Generic.html '//*[@id="method.no_needs_sized"]//h4[@class="code-header"]' \
|
|
|
|
// "fn no_needs_sized"
|
|
|
|
pub struct Generic<T: ?Sized>(T);
|
|
|
|
|
|
|
|
impl<T: ?Sized> Foo for Generic<T> {}
|