]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/parse-complex-macro-invoc-op.rs
rustdoc: Replace no-pretty-expanded with pretty-expanded
[rust.git] / src / test / run-pass / parse-complex-macro-invoc-op.rs
1 // Copyright 2014 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.
4 //
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.
10
11 // Test parsing binary operators after macro invocations.
12
13 // pretty-expanded FIXME #23616
14
15 #![feature(macro_rules)]
16
17 macro_rules! id {
18     ($e: expr) => { $e }
19 }
20
21 fn foo() {
22     id!(1) + 1;
23     id![1] - 1;
24     id!(1) * 1;
25     id![1] / 1;
26     id!(1) % 1;
27
28     id!(1) & 1;
29     id![1] | 1;
30     id!(1) ^ 1;
31
32     let mut x = 1;
33     id![x] = 2;
34     id!(x) += 1;
35
36     id!(1f64).clone();
37
38     id!([1, 2, 3])[1];
39     id![drop](1);
40
41     id!(true) && true;
42     id![true] || true;
43 }
44
45 fn main() {}