Created
September 27, 2016 08:04
-
-
Save kellpossible/082d1979beb9b0ffcc1fc4e41cd9c8f1 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
struct A<'a> { | |
s: &'a String | |
} | |
struct B<'a> { | |
a: A<'a>, | |
s: String | |
} | |
impl<'a> B<'a> { | |
fn new() -> B<'a> { | |
let new_s = String::from("some string"); | |
let new_a = A {s: &new_s}; | |
return B {a: new_a, s: new_s}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error I'm getting (ignore the line numbers!)