mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			182 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			182 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-pass
 | |
| macro_rules! default {
 | |
|     ($($x:tt)*) => { $($x)* }
 | |
| }
 | |
| 
 | |
| default! {
 | |
|     struct A;
 | |
| }
 | |
| 
 | |
| impl A {
 | |
|     default! {
 | |
|         fn foo(&self) {}
 | |
|     }
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     A.foo();
 | |
| }
 | 
