SHARE
TWEET

Untitled

a guest Dec 11th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #![feature(type_ascription)]
  2. #![allow(dead_code)]
  3.  
  4. // SUMMARY OF BEHAVIOR
  5. //
  6. // EDITION        WILD      VAR       EXPR      ARG
  7. // -----------    ------    ------    ------    ------
  8. // 2015/AST       accept    accept    reject    accept
  9. // 2018/AST       accept    accept    reject    accept
  10. // #55748 hack    reject    accept    reject    accept
  11.  
  12. #[derive(Copy, Clone)]
  13. struct Covariant<'a> {
  14.     f: extern "Rust" fn(&'a isize)
  15. }
  16.  
  17. fn co_arg(_co_s: Covariant<'static>) { }
  18.  
  19. #[cfg(not_now)]
  20. fn ascribe_wild<'a>(co: Covariant<'a>) {
  21.     let _: Covariant<'static> = co;     // (ascribe on) WILD(card)
  22. }
  23.  
  24. #[cfg(not_now)]
  25. fn ascribe_var<'a>(co: Covariant<'a>) {
  26.     let _c: Covariant<'static> = co; // (ascribe on) VAR
  27. }
  28.  
  29. #[cfg(not_now)]
  30. fn ascribe_expr<'a>(co: Covariant<'a>) {
  31.     let _ = co: Covariant<'static>;  // (ascribe on) EXPR
  32. }
  33.  
  34. // #[cfg(not_now)]
  35. fn pass_actual_arg<'a>(co: Covariant<'a>) {
  36.     co_arg(co);                      // (actual )ARG(ument)
  37. }
  38.  
  39. pub fn main() {}
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