mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			393 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			393 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// compile-flags:--test
 | 
						|
 | 
						|
struct A {}
 | 
						|
 | 
						|
impl A {
 | 
						|
    #[test]
 | 
						|
    //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
 | 
						|
    fn new() -> A {
 | 
						|
        A {}
 | 
						|
    }
 | 
						|
    #[test]
 | 
						|
    //~^ ERROR the `#[test]` attribute may only be used on a non-associated function
 | 
						|
    fn recovery_witness() -> A {
 | 
						|
        A {}
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
#[test]
 | 
						|
fn test() {
 | 
						|
    let _ = A::new();
 | 
						|
}
 | 
						|
 | 
						|
fn main() {}
 |