mirror of https://github.com/rust-lang/rust
18 lines
382 B
Rust
18 lines
382 B
Rust
pub trait Insertable {
|
|
type Values;
|
|
|
|
fn values(&self) -> Self::Values;
|
|
}
|
|
|
|
impl<T> Insertable for Option<T> {
|
|
type Values = ();
|
|
|
|
fn values(self) -> Self::Values {
|
|
//~^ ERROR method `values` has an incompatible type for trait
|
|
self.map(Insertable::values).unwrap_or_default()
|
|
//~^ ERROR type mismatch in function arguments
|
|
}
|
|
}
|
|
|
|
fn main() {}
|