summary refs log tree commit diff
path: root/tests/pretty/postfix-match/precedence.pp
blob: 2052b445a2b30e3527cc4ec7794a4b29df6bf4ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#![feature(prelude_import)]
#![no_std]
#![feature(postfix_match)]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;

use std::ops::Add;

//@ pretty-mode:expanded
//@ pp-exact:precedence.pp

macro_rules! repro { ($e:expr) => { $e.match { _ => {} } }; }

struct Struct {}

impl Add<Struct> for usize {
    type Output = ();
    fn add(self, _: Struct) -> () { () }
}
pub fn main() {
    let a;
    (
        { 1 } + 1).match {
        _ => {}
    };
    (4 as usize).match { _ => {} };
    return.match { _ => {} };
    (a = 42).match { _ => {} };
    (|| {}).match { _ => {} };
    (42..101).match { _ => {} };
    (1 + Struct {}).match { _ => {} };
}