2017-02-06 05:44:38 -06:00
|
|
|
// Copyright 2016 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:derive-foo.rs
|
|
|
|
// aux-build:derive-clona.rs
|
|
|
|
// aux-build:attr_proc_macro.rs
|
2017-02-27 14:03:19 -06:00
|
|
|
// aux-build:bang_proc_macro.rs
|
2017-02-06 05:44:38 -06:00
|
|
|
|
|
|
|
#![feature(proc_macro)]
|
2017-05-12 02:53:58 -05:00
|
|
|
#![allow(unused_macros)]
|
2017-02-06 05:44:38 -06:00
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate derive_foo;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate derive_clona;
|
|
|
|
extern crate attr_proc_macro;
|
2017-02-27 14:03:19 -06:00
|
|
|
extern crate bang_proc_macro;
|
2017-02-06 05:44:38 -06:00
|
|
|
|
|
|
|
use attr_proc_macro::attr_proc_macro;
|
2017-02-27 14:03:19 -06:00
|
|
|
use bang_proc_macro::bang_proc_macro;
|
2017-02-06 05:44:38 -06:00
|
|
|
|
2017-02-23 03:48:20 -06:00
|
|
|
macro_rules! FooWithLongNam {
|
|
|
|
() => {}
|
|
|
|
}
|
|
|
|
|
2017-02-27 14:03:19 -06:00
|
|
|
macro_rules! attr_proc_mac {
|
|
|
|
() => {}
|
|
|
|
}
|
|
|
|
|
2017-02-23 03:48:20 -06:00
|
|
|
#[derive(FooWithLongNan)]
|
2017-02-06 05:44:38 -06:00
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
#[attr_proc_macra]
|
|
|
|
struct Bar;
|
|
|
|
|
2017-02-23 03:48:20 -06:00
|
|
|
#[FooWithLongNan]
|
|
|
|
struct Asdf;
|
|
|
|
|
2017-02-06 05:44:38 -06:00
|
|
|
#[derive(Dlone)]
|
|
|
|
struct A;
|
|
|
|
|
|
|
|
#[derive(Dlona)]
|
|
|
|
struct B;
|
|
|
|
|
2017-02-23 03:48:20 -06:00
|
|
|
#[derive(attr_proc_macra)]
|
|
|
|
struct C;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
FooWithLongNama!();
|
|
|
|
|
|
|
|
attr_proc_macra!();
|
|
|
|
|
|
|
|
Dlona!();
|
2017-02-27 14:03:19 -06:00
|
|
|
|
|
|
|
bang_proc_macrp!();
|
2017-02-23 03:48:20 -06:00
|
|
|
}
|