2023-04-20 14:37:15 +00:00
|
|
|
//@aux-build:macro_rules.rs
|
|
|
|
//@aux-build:macro_use_helper.rs
|
2023-07-27 13:23:04 +00:00
|
|
|
//@aux-build:proc_macro_derive.rs
|
2023-07-27 11:40:22 +00:00
|
|
|
|
2023-04-20 14:37:15 +00:00
|
|
|
//@ignore-32bit
|
2020-06-23 15:05:22 +00:00
|
|
|
|
2022-06-30 08:50:09 +00:00
|
|
|
#![feature(lint_reasons)]
|
2021-04-22 09:31:13 +00:00
|
|
|
#![allow(unused_imports, unreachable_code, unused_variables, dead_code, unused_attributes)]
|
2020-06-23 15:05:22 +00:00
|
|
|
#![allow(clippy::single_component_path_imports)]
|
|
|
|
#![warn(clippy::macro_use_imports)]
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate macro_use_helper as mac;
|
|
|
|
|
|
|
|
#[macro_use]
|
2021-06-03 06:41:37 +00:00
|
|
|
extern crate proc_macro_derive as mini_mac;
|
2020-06-23 15:05:22 +00:00
|
|
|
|
|
|
|
mod a {
|
2023-04-10 16:07:57 +00:00
|
|
|
use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};
|
2020-06-23 15:05:22 +00:00
|
|
|
use mac;
|
|
|
|
use mini_mac::ClippyMiniMacroTest;
|
|
|
|
use mini_mac;
|
2023-03-24 13:04:35 +00:00
|
|
|
use mac::{inner::mut_mut, inner::try_err};
|
2020-06-23 15:05:22 +00:00
|
|
|
use mac::inner;
|
|
|
|
use mac::inner::nested::string_add;
|
|
|
|
use mac::inner::nested;
|
|
|
|
|
|
|
|
#[derive(ClippyMiniMacroTest)]
|
|
|
|
struct Test;
|
|
|
|
|
|
|
|
fn test() {
|
|
|
|
pub_macro!();
|
|
|
|
inner_mod_macro!();
|
|
|
|
pub_in_private_macro!(_var);
|
|
|
|
function_macro!();
|
|
|
|
let v: ty_macro!() = Vec::default();
|
|
|
|
|
|
|
|
inner::try_err!();
|
2023-03-24 13:04:35 +00:00
|
|
|
inner::mut_mut!();
|
2020-06-23 15:05:22 +00:00
|
|
|
nested::string_add!();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-23 08:12:34 +00:00
|
|
|
// issue #7015, ICE due to calling `module_children` with local `DefId`
|
2021-04-22 09:31:13 +00:00
|
|
|
#[macro_use]
|
|
|
|
use a as b;
|
|
|
|
|
2020-06-23 15:05:22 +00:00
|
|
|
fn main() {}
|