Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created December 5, 2019 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/32334b782179f02056721b84d1f2835f to your computer and use it in GitHub Desktop.
Save rust-play/32334b782179f02056721b84d1f2835f to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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