]> git.lizzy.rs Git - rust.git/blobdiff - library/core/tests/lazy.rs
Rollup merge of #107152 - GuillaumeGomez:migrate-to-css-var, r=notriddle
[rust.git] / library / core / tests / lazy.rs
index 70fcc6d2d4bf7d9d1de717d017073ca85c9e97b1..c7c3c479b71db92af495eaa0407940efcdd622e9 100644 (file)
@@ -106,6 +106,12 @@ fn lazy_new() {
     assert_eq!(called.get(), 1);
 }
 
+// Check that we can infer `T` from closure's type.
+#[test]
+fn lazy_type_inference() {
+    let _ = LazyCell::new(|| ());
+}
+
 #[test]
 fn aliasing_in_get() {
     let x = OnceCell::new();