Skip to content

Commit

Permalink
Add a test to ensure Fuse stays covariant
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Jun 2, 2020
1 parent d3cba25 commit a3344d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test/ui/variance-iterators-in-libcore.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// run-pass

#![allow(warnings)]
#![allow(dead_code)]

use std::iter::Zip;
use std::iter::{Fuse, Zip};

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

fn main() { }

0 comments on commit a3344d1

Please sign in to comment.