mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			236 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			236 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // run-pass
 | |
| 
 | |
| pub fn increment(x: usize) -> usize {
 | |
|     x + 1
 | |
| }
 | |
| 
 | |
| #[macro_export]
 | |
| macro_rules! increment {
 | |
|     ($x:expr) => ({
 | |
|         use $crate::increment;
 | |
|         increment($x)
 | |
|     })
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     assert_eq!(increment!(3), 4);
 | |
| }
 | 
