]> git.proxmox.com Git - rustc.git/blame - src/test/ui/run-pass/macros/parse-complex-macro-invoc-op.rs
New upstream version 1.30.0+dfsg1
[rustc.git] / src / test / ui / run-pass / macros / parse-complex-macro-invoc-op.rs
CommitLineData
1a4d82fc
JJ
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
b7449926
XL
11// run-pass
12#![allow(stable_features)]
13
1a4d82fc
JJ
14// Test parsing binary operators after macro invocations.
15
c34b1796
AL
16// pretty-expanded FIXME #23616
17
1a4d82fc
JJ
18#![feature(macro_rules)]
19
20macro_rules! id {
21 ($e: expr) => { $e }
22}
23
24fn foo() {
85aaf69f
SL
25 id!(1) + 1;
26 id![1] - 1;
27 id!(1) * 1;
28 id![1] / 1;
29 id!(1) % 1;
1a4d82fc 30
85aaf69f
SL
31 id!(1) & 1;
32 id![1] | 1;
33 id!(1) ^ 1;
1a4d82fc 34
85aaf69f 35 let mut x = 1;
1a4d82fc
JJ
36 id![x] = 2;
37 id!(x) += 1;
38
39 id!(1f64).clone();
40
85aaf69f
SL
41 id!([1, 2, 3])[1];
42 id![drop](1);
1a4d82fc
JJ
43
44 id!(true) && true;
45 id![true] || true;
46}
47
48fn main() {}