Last active
April 13, 2018 16:11
-
-
Save mctigger/f7daeb9df3da6558ffded11135f3b47b to your computer and use it in GitHub Desktop.
This file contains 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
trait T {} | |
struct A {} | |
struct B {} | |
impl T for A {} | |
impl T for B {} | |
fn main() { | |
println!("Hello, world!"); | |
get(); | |
} | |
fn get() -> [Option<(i32, Box<T>, i32)>; 2] { | |
// let l: [Option<(i32, Box<T>, i32)>; 2] = [None; 2]; within `(i32, std::boxed::Box<T>, i32)`, the trait `std::marker::Copy` is not implemented for `std::boxed::Box<T>` | |
let a: Box<(T)> = Box::new(A{}); | |
let b: Box<(T)> = Box::new(B{}); | |
let ta: Option<(i32, Box<T>, i32)> = Some((2, a, 3)); | |
let tb: Option<(i32, Box<T>, i32)> = Some((2, b, 3)); | |
[ta, tb] // use l instead | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment