rust trait inheritance
trait A {}
trait B: A {}
struct S;
impl B for S {}
// Commenting this line will result in a "trait bound unsatisfied" error
impl A for S {}
fn main() {
let _x: &B = &S;
}
rust trait inheritance
trait A {}
trait B: A {}
struct S;
impl B for S {}
// Commenting this line will result in a "trait bound unsatisfied" error
impl A for S {}
fn main() {
let _x: &B = &S;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us