mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	 87c2f9a5be
			
		
	
	
		87c2f9a5be
		
	
	
	
	
		
			
			This reverts commit 1d35638dc38dbfbf1cc2a9823135dfcf3c650169, reversing changes made to f23a80a4c2fbca593b64e70f5970368824b4c5e9.
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
|    LL|       |#![feature(coverage_attribute)]
 | |
|    LL|       |//@ edition: 2021
 | |
|    LL|       |//@ reference: attributes.coverage.nesting
 | |
|    LL|       |
 | |
|    LL|       |// Checks that `#[coverage(..)]` can be applied to impl and impl-trait blocks,
 | |
|    LL|       |// and is inherited by any enclosed functions.
 | |
|    LL|       |
 | |
|    LL|       |struct MyStruct;
 | |
|    LL|       |
 | |
|    LL|       |#[coverage(off)]
 | |
|    LL|       |impl MyStruct {
 | |
|    LL|       |    fn off_inherit() {}
 | |
|    LL|       |
 | |
|    LL|       |    #[coverage(on)]
 | |
|    LL|      0|    fn off_on() {}
 | |
|    LL|       |
 | |
|    LL|       |    #[coverage(off)]
 | |
|    LL|       |    fn off_off() {}
 | |
|    LL|       |}
 | |
|    LL|       |
 | |
|    LL|       |#[coverage(on)]
 | |
|    LL|       |impl MyStruct {
 | |
|    LL|      0|    fn on_inherit() {}
 | |
|    LL|       |
 | |
|    LL|       |    #[coverage(on)]
 | |
|    LL|      0|    fn on_on() {}
 | |
|    LL|       |
 | |
|    LL|       |    #[coverage(off)]
 | |
|    LL|       |    fn on_off() {}
 | |
|    LL|       |}
 | |
|    LL|       |
 | |
|    LL|       |trait MyTrait {
 | |
|    LL|       |    fn method();
 | |
|    LL|       |}
 | |
|    LL|       |
 | |
|    LL|       |#[coverage(off)]
 | |
|    LL|       |impl MyTrait for MyStruct {
 | |
|    LL|       |    fn method() {}
 | |
|    LL|       |}
 | |
|    LL|       |
 | |
|    LL|       |#[coverage(off)]
 | |
|    LL|       |fn main() {}
 | |
| 
 |