]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/len_zero.rs
iterate List by value
[rust.git] / tests / ui / len_zero.rs
index 0a77f1194621db3101fd0ed16416749349f6576f..7fba971cfd8876ebb0e2713cdd09e492586b473c 100644 (file)
@@ -70,7 +70,7 @@ fn main() {
         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!");
@@ -125,7 +125,7 @@ fn main() {
     }
     assert!(!has_is_empty.is_empty());
 
-    let with_is_empty: &WithIsEmpty = &Wither;
+    let with_is_empty: &dyn WithIsEmpty = &Wither;
     if with_is_empty.len() == 0 {
         println!("Or this!");
     }