2014-08-14 04:55:47 -05:00
|
|
|
// Copyright 2013-2014 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.
|
|
|
|
|
|
|
|
// aux-build:macro_crate_test.rs
|
|
|
|
// ignore-stage1
|
|
|
|
|
|
|
|
// Issue #15750: a macro that internally parses its input and then
|
|
|
|
// uses `quote_expr!` to rearrange it should be hygiene-preserving.
|
|
|
|
|
2014-12-31 22:43:46 -06:00
|
|
|
#![feature(plugin)]
|
2015-02-06 15:56:38 -06:00
|
|
|
#![plugin(macro_crate_test)]
|
2014-08-14 04:55:47 -05:00
|
|
|
|
|
|
|
fn main() {
|
2015-01-25 15:05:03 -06:00
|
|
|
let x = 3;
|
2014-08-14 04:55:47 -05:00
|
|
|
assert_eq!(3, identity!(x));
|
|
|
|
assert_eq!(6, identity!(x+x));
|
2015-01-25 15:05:03 -06:00
|
|
|
let x = 4;
|
2014-08-14 04:55:47 -05:00
|
|
|
assert_eq!(4, identity!(x));
|
|
|
|
}
|