add hygiene test, add copyright to another

This commit is contained in:
John Clements 2013-07-26 16:30:05 -04:00
parent d8c77e082b
commit 114b1a7e97
2 changed files with 26 additions and 0 deletions

View 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}
}

View File

@ -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)
}