5989400e2e
Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
49 lines
1.2 KiB
Rust
49 lines
1.2 KiB
Rust
// aux-build:macro_rules.rs
|
|
// aux-build:macro_use_helper.rs
|
|
// aux-build:proc_macro_derive.rs
|
|
// run-rustfix
|
|
// ignore-32bit
|
|
|
|
#![feature(lint_reasons)]
|
|
#![allow(unused_imports, unreachable_code, unused_variables, dead_code, unused_attributes)]
|
|
#![allow(clippy::single_component_path_imports)]
|
|
#![warn(clippy::macro_use_imports)]
|
|
|
|
#[macro_use]
|
|
extern crate macro_use_helper as mac;
|
|
|
|
#[macro_use]
|
|
extern crate proc_macro_derive as mini_mac;
|
|
|
|
mod a {
|
|
use mac::{pub_macro, inner_mod_macro, function_macro, ty_macro, pub_in_private_macro};
|
|
use mac;
|
|
use mini_mac::ClippyMiniMacroTest;
|
|
use mini_mac;
|
|
use mac::{inner::mut_mut, inner::try_err};
|
|
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!();
|
|
inner::mut_mut!();
|
|
nested::string_add!();
|
|
}
|
|
}
|
|
|
|
// issue #7015, ICE due to calling `module_children` with local `DefId`
|
|
#[macro_use]
|
|
use a as b;
|
|
|
|
fn main() {}
|