Guest User

Untitled

a guest
Jan 23rd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. use std::io::{Read, Write};
  2. use std::fs::File;
  3. use std::path::Path;
  4.  
  5. // Comment this out... and everything will work fine
  6. use thisdoesntexistyolo::haha;
  7.  
  8. struct Something<T: Read + Write> {
  9. thing: T,
  10. }
  11.  
  12. impl<'a, T: 'a + Read + Write> Something<T>
  13. where &'a T: Read
  14. {
  15. fn new(thing: T) -> Something<T> {
  16. Something { thing }
  17. }
  18. }
  19.  
  20. fn main() {
  21. let file = File::open(Path::new("doesntmatter.txt")).unwrap();
  22. let mut st: Something<File> = Something::new(file);
  23. }
Add Comment
Please, Sign In to add comment