statiolake / proconio-rs

Apache License 2.0
125 stars 6 forks source link

`#[fastout]` does not replace macros in `match` arms #8

Closed qryxip closed 4 years ago

qryxip commented 4 years ago
use proconio::fastout;

use std::thread;

#[fastout]
fn main() {
    match () {
        () => println!("hi"),
    }

    // It **does** compile
    thread::Builder::new()
        .stack_size(1024usize.pow(3))
        .spawn(|| match () {
            () => println!("hi"),
        })
        .unwrap();
}

#![feature(prelude_import)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
use proconio::fastout;
use std::thread;
fn main() {
    let __proconio_stdout = ::std::io::stdout();
    let mut __proconio_stdout = ::std::io::BufWriter::new(__proconio_stdout.lock());
    let __proconio_res = {
        match () {
            () => {
                ::std::io::_print(::core::fmt::Arguments::new_v1(
                    &["hi\n"],
                    &match () {
                        () => [],
                    },
                ));
            }
        }
        thread::Builder::new()
            .stack_size(1024usize.pow(3))
            .spawn(|| match () {
                () => {
                    ::std::io::_print(::core::fmt::Arguments::new_v1(
                        &["hi\n"],
                        &match () {
                            () => [],
                        },
                    ));
                }
            })
            .unwrap();
    };
    <::std::io::BufWriter<::std::io::StdoutLock> as ::std::io::Write>::flush(
        &mut __proconio_stdout,
    )
    .unwrap();
    return __proconio_res;
}