mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			602 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			602 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ check-pass
 | |
| //@ compile-flags:--test --test-args=--test-threads=1
 | |
| //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
 | |
| //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
 | |
| 
 | |
| // This test ensures that crate imports are placed outside of the `main` function
 | |
| // so they work all the time (even in 2015 edition).
 | |
| 
 | |
| /// ```rust
 | |
| /// #![feature(test)]
 | |
| ///
 | |
| /// extern crate test;
 | |
| /// use test::Bencher;
 | |
| ///
 | |
| /// #[bench]
 | |
| /// fn bench_xor_1000_ints(b: &mut Bencher) {
 | |
| ///     b.iter(|| {
 | |
| ///         (0..1000).fold(0, |old, new| old ^ new);
 | |
| ///     });
 | |
| /// }
 | |
| /// ```
 | |
| ///
 | |
| pub fn foo() {}
 | 
