Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Test<'a> {
- fn get<'b: 'a>(&'b self) -> &'a i32;
- }
- struct TestStruct<'a> {
- t: Test<'a>,
- }
- struct Foo(i32);
- impl<'a> Test<'a> for Foo {
- fn get<'b: 'a>(&'b self) -> &'a i32 {
- return &self.0;
- }
- }
- fn main() {
- let ts = TestStruct {t: Foo(0)};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement