println!("This should not happen either!");
}
- let z: &TraitsToo = &y;
+ let z: &dyn TraitsToo = &y;
if z.len() > 0 {
// No error; `TraitsToo` has no `.is_empty()` method.
println!("Nor should this!");
}
assert!(!has_is_empty.is_empty());
- let with_is_empty: &WithIsEmpty = &Wither;
+ let with_is_empty: &dyn WithIsEmpty = &Wither;
if with_is_empty.is_empty() {
println!("Or this!");
}