mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			408 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			408 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![feature(coverage_attribute)]
 | |
| // Checks that `#[coverage(..)]` in a trait method is not inherited in an
 | |
| // implementation.
 | |
| //@ edition: 2021
 | |
| //@ reference: attributes.coverage.trait-impl-inherit
 | |
| 
 | |
| trait T {
 | |
|     #[coverage(off)]
 | |
|     fn f(&self) {
 | |
|         println!("default");
 | |
|     }
 | |
| }
 | |
| 
 | |
| struct S;
 | |
| 
 | |
| impl T for S {
 | |
|     fn f(&self) {
 | |
|         println!("impl S");
 | |
|     }
 | |
| }
 | |
| 
 | |
| #[coverage(off)]
 | |
| fn main() {
 | |
|     S.f();
 | |
| }
 | 
