mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
27 lines
515 B
Rust
27 lines
515 B
Rust
//! This test checks that we currently need to implement
|
|
//! members, even if their where bounds don't hold for the impl type.
|
|
|
|
trait Foo {
|
|
fn foo()
|
|
where
|
|
Self: Sized;
|
|
}
|
|
|
|
impl Foo for () {
|
|
fn foo() {}
|
|
}
|
|
|
|
// Must not be allowed
|
|
impl Foo for i32 {}
|
|
//~^ ERROR: not all trait items implemented, missing: `foo`
|
|
|
|
// Should be allowed
|
|
impl Foo for dyn std::fmt::Debug {}
|
|
//~^ ERROR: not all trait items implemented, missing: `foo`
|
|
|
|
impl Foo for dyn std::fmt::Display {
|
|
fn foo() {}
|
|
}
|
|
|
|
fn main() {}
|