daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top