1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // compile-flags: -Z borrowck=compare
13 #![recursion_limit = "128"]
18 // Just a grab bag of stuff that you wouldn't want to actually write.
20 fn strange() -> bool { let _x: bool = return true; }
28 fn the(x: &Cell<bool>) {
29 return while !x.get() { x.set(true); };
31 let i = &Cell::new(false);
32 let dont = {||the(i)};
55 if (return) { break; }
61 let mut _y = (_x = 0) == (_x = 0);
62 let mut _z = (_x = 0) < (_x = 0);
63 let _a = (_x += 0) == (_x = 0);
64 let _b = swap(&mut _y, &mut _z) == swap(&mut _y, &mut _z);
67 fn canttouchthis() -> usize {
68 fn p() -> bool { true }
69 let _a = (assert!((true)) == (assert!(p())));
70 let _c = (assert!((p())) == ());
71 let _b: bool = (println!("{}", 0) == (return 0));
77 loop { i += 1; if i == 1 { match (continue) { 1 => { }, _ => panic!("wat") } }
81 fn evil_lincoln() { let _evil = println!("lincoln"); }
84 assert_eq!(String::from(".................................................."),
85 format!("{:?}", .. .. .. .. .. .. .. .. .. .. .. .. ..
86 .. .. .. .. .. .. .. .. .. .. .. ..));
95 pub fn u8<'u8: 'u8 + 'u8>(u8: &'u8 u8) -> &'u8 u8 {
104 let &u8: &u8 = u8::u8(&8u8);
112 assert_eq!(String::from("><>"),
113 String::<>::from::<>("><>").chars::<>().rev::<>().collect::<String>());
117 union union<'union> { union: &'union union<'union>, }
120 fn special_characters() {
121 let val = !((|(..):(_,_),__@_|__)((&*"\\",'🤔')/**/,{})=={&[..=..][..];})//
126 fn punch_card() -> impl std::fmt::Debug {
127 ..=..=.. .. .. .. .. .. .. .. .. .. .. ..=.. ..
128 ..=.. ..=.. .. .. .. .. .. .. .. .. ..=..=..=..
129 ..=.. ..=.. ..=.. ..=.. .. ..=..=.. .. ..=.. ..
130 ..=..=.. .. ..=.. ..=.. ..=.. .. .. .. ..=.. ..
131 ..=.. ..=.. ..=.. ..=.. .. ..=.. .. .. ..=.. ..
132 ..=.. ..=.. ..=.. ..=.. .. .. ..=.. .. ..=.. ..
133 ..=.. ..=.. .. ..=..=.. ..=..=.. .. .. ..=.. ..
149 special_characters();