Created
October 29, 2017 20:02
-
-
Save nikomatsakis/a516dbc1c89010ce8557a290b5619934 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This program: | |
#![feature(conservative_impl_trait)] | |
use std::fmt::Debug; | |
#[derive(Debug)] | |
struct Foo<'a> { x: &'a i32 } | |
unsafe impl Send for Foo<'static> { } | |
fn foo<'a>(x: &'a i32) -> impl Debug + 'a { | |
Foo { x } | |
} | |
fn bar() { | |
let mut x = 5; | |
x += 5; | |
let y = || foo(&x); | |
is_send(y()); | |
} | |
fn is_send<T: Send>(_t: T) { } | |
fn main() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment