]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unwrap_or_else_default.rs
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / unwrap_or_else_default.rs
index 82b727a039ed44fd18d5738c24a5cc2e3ec30c73..1735bd5808e5a94713e2593874ff8305a73f6cb1 100644 (file)
@@ -66,6 +66,12 @@ fn make<T, V>(_: V) -> T {
 
     let with_default_type = Some(1);
     with_default_type.unwrap_or_else(u64::default);
+
+    let with_default_type: Option<Vec<u64>> = None;
+    with_default_type.unwrap_or_else(Vec::new);
+
+    let empty_string = None::<String>;
+    empty_string.unwrap_or_else(|| "".to_string());
 }
 
 fn main() {}