Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. // xfail-pretty
  2. // Just a grab bug of stuff that you wouldn't want to actualy write
  3.  
  4. fn strange() -> bool {
  5. let _x = ret true;
  6. }
  7.  
  8. fn funny() {
  9. fn f(_x: ()) {}
  10. f(ret);
  11. }
  12.  
  13. fn odd() {
  14. // FIXME: This doesn't compile
  15. // log ret;
  16. }
  17.  
  18. fn what() {
  19. fn the(x: @mutable bool){
  20. ret while !*x { *x = true };
  21. }
  22. let i = @mutable false;
  23. let dont = bind the(i);
  24. dont();
  25. assert *i;
  26. }
  27.  
  28. fn zombiejesus() {
  29. do { while (ret) { if (ret) {
  30. alt (ret) { _ {
  31. ret ? ret : ret
  32. }}
  33. }}} while ret;
  34. }
  35.  
  36. fn notsure() {
  37. let _x;
  38. let _y = (_x = 0) == (_x = 0);
  39. let _z = (_x <- 0) < (_x = 0);
  40. let _a = (_x += 0) == (_x = 0);
  41. let _b = (_y <-> _z) == (_y <-> _z);
  42. }
  43.  
  44. fn hammertime() -> int {
  45. // FIXME: Doesn't compile
  46. //let _x = log true == (ret 0);
  47. ret 0;
  48. }
  49.  
  50. fn canttouchthis() -> uint {
  51. pred p() -> bool { true }
  52. let _a = (assert true) == (check p());
  53. let _c = (check p()) == ();
  54. let _b = (log 0) == (ret 0u);
  55. }
  56.  
  57. fn angrydome() {
  58. while true {
  59. if (break) { }
  60. }
  61. let i = 0;
  62. do {
  63. i += 1;
  64. if i == 1 {
  65. alt cont { _ { } }
  66. }
  67. } while false;
  68. }
  69.  
  70. fn evil_lincoln() {
  71. let evil <- log "lincoln";
  72. }
  73.  
  74. fn main() {
  75. strange();
  76. funny();
  77. odd();
  78. what();
  79. zombiejesus();
  80. notsure();
  81. hammertime();
  82. canttouchthis();
  83. angrydome();
  84. evil_lincoln();
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement