]> git.lizzy.rs Git - rust.git/commitdiff
add hygiene test, add copyright to another
authorJohn Clements <clements@racket-lang.org>
Fri, 26 Jul 2013 20:30:05 +0000 (16:30 -0400)
committerJohn Clements <clements@racket-lang.org>
Fri, 6 Sep 2013 20:35:14 +0000 (13:35 -0700)
src/test/run-pass/hygiene-dodging-1.rs
src/test/run-pass/let-var-hygiene.rs [new file with mode: 0644]

index 20ffa74e6877576005024bc833c2fb45c9f4a429..55e15cc02dd392199d741b5b3cdfcc5a1a539c94 100644 (file)
@@ -1,3 +1,13 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 mod x {
     pub fn g() -> uint {14}
 }
diff --git a/src/test/run-pass/let-var-hygiene.rs b/src/test/run-pass/let-var-hygiene.rs
new file mode 100644 (file)
index 0000000..1e29d2e
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// shouldn't affect evaluation of $ex:
+macro_rules! bad_macro (($ex:expr) => ({let _x = 9; $ex}))
+fn main() {
+    let _x = 8;
+    assert_eq!(bad_macro!(_x),8)
+}