Skip to content

Commit 0050b88

Browse files
authored
Rollup merge of #72902 - cuviper:fuse-covariant, r=nikomatsakis
Add a test to ensure Fuse stays covariant When #70502 attempted to specialize the data types in `Fuse`, one of the problems we found was that it broke variance. This was also realized when `Fuse` was first added, #35656 (diff), but now this PR adds a test so we don't forget again.
2 parents 69a1ac3 + a3344d1 commit 0050b88

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// run-pass
22

3-
#![allow(warnings)]
3+
#![allow(dead_code)]
44

5-
use std::iter::Zip;
5+
use std::iter::{Fuse, Zip};
66

7+
fn fuse_covariant<'a, I>(iter: Fuse<&'static I>) -> Fuse<&'a I> { iter }
78
fn zip_covariant<'a, A, B>(iter: Zip<&'static A, &'static B>) -> Zip<&'a A, &'a B> { iter }
89

910
fn main() { }

0 commit comments

Comments
 (0)