Created
December 5, 2019 20:17
-
-
Save rust-play/32334b782179f02056721b84d1f2835f to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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 MyStruct<TCollection> | |
where | |
for<'a> &'a TCollection: IntoIterator<Item = &'a ()>, | |
{ | |
references: TCollection, | |
} | |
impl<TCollection> Drop for MyStruct<TCollection> | |
where | |
for<'b> &'b TCollection: IntoIterator<Item = &'b ()>, | |
{ | |
fn drop(&mut self) { | |
for reference in &self.references {} | |
} | |
} | |
fn main() { | |
let _ = MyStruct { | |
references: Vec::new(), | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment