mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-03 22:49:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			451 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			451 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
//@ check-pass
 | 
						|
//@ edition:2021
 | 
						|
//@ proc-macro: test-macros.rs
 | 
						|
 | 
						|
#![no_std] // Don't load unnecessary hygiene information from std
 | 
						|
extern crate std;
 | 
						|
 | 
						|
#[macro_use]
 | 
						|
extern crate test_macros;
 | 
						|
 | 
						|
macro_rules! foo {
 | 
						|
    ($($path:ident)::*) => (
 | 
						|
        test_macros::recollect!(
 | 
						|
            $($path)::*
 | 
						|
        )
 | 
						|
    )
 | 
						|
}
 | 
						|
 | 
						|
macro_rules! baz {
 | 
						|
    () => (
 | 
						|
        foo!($crate::BAR)
 | 
						|
    )
 | 
						|
}
 | 
						|
 | 
						|
pub const BAR: u32 = 19;
 | 
						|
 | 
						|
fn main(){
 | 
						|
    std::println!("{}", baz!());
 | 
						|
}
 |