add hygiene test, add copyright to another
This commit is contained in:
parent
d8c77e082b
commit
114b1a7e97
@ -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}
|
||||
}
|
||||
|
16
src/test/run-pass/let-var-hygiene.rs
Normal file
16
src/test/run-pass/let-var-hygiene.rs
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user