Skip to content

Commit 179b2a9

Browse files
Add regression test for issue 167
1 parent 4950c74 commit 179b2a9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/it.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,16 @@ mod unsync {
299299
cell.set(&s).unwrap();
300300
}
301301
}
302+
303+
#[test]
304+
fn assert_lazy_is_covariant_in_the_ctor() {
305+
#[allow(dead_code)]
306+
type AnyLazy<'f, T> = Lazy<T, Box<dyn 'f + FnOnce() -> T>>;
307+
308+
fn _for<'short, T>(it: *const (AnyLazy<'static, T>,)) -> *const (AnyLazy<'short, T>,) {
309+
it
310+
}
311+
}
302312
}
303313

304314
#[cfg(any(feature = "std", feature = "critical-section"))]

0 commit comments

Comments
 (0)