From 42cf6aefd94615e3d8868eef1cd51acfebddd0c6 Mon Sep 17 00:00:00 2001 From: Daniel Henry-Mantilla Date: Fri, 2 Jun 2023 23:19:08 +0000 Subject: [PATCH] Add regression test for issue 167 --- tests/it.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/it.rs b/tests/it.rs index b696d9b..48e2725 100644 --- a/tests/it.rs +++ b/tests/it.rs @@ -299,6 +299,16 @@ mod unsync { cell.set(&s).unwrap(); } } + + #[test] + fn assert_lazy_is_covariant_in_the_ctor() { + #[allow(dead_code)] + type AnyLazy<'f, T> = Lazy T>>; + + fn _for<'short, T>(it: *const (AnyLazy<'static, T>,)) -> *const (AnyLazy<'short, T>,) { + it + } + } } #[cfg(any(feature = "std", feature = "critical-section"))]