Skip to content

Instantly share code, notes, and snippets.

Created October 1, 2015 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/59c6f269351efe805bcc to your computer and use it in GitHub Desktop.
Save anonymous/59c6f269351efe805bcc to your computer and use it in GitHub Desktop.
Shared via Rust Playground
use std::slice;
type Iter<'a> = Iterator<Item=&'a i32>;
struct Struct<'a> { _phantom: std::marker::PhantomData<&'a i32> }
impl<'a> Struct<'a> {
fn direct<'b>(i: &'b slice::Iter<'a, i32>) -> &'b Iterator<Item=&'a i32>
{ i }
fn aliased<'b>(i: &'b slice::Iter<'a, i32>) -> &'b Iter<'a>
{ i }
}
fn main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment