From a48ae40800dee30bd49ddff5b104e69c4029e4e1 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"))]