mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			474 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			474 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// run-rustfix
 | 
						|
 | 
						|
#[allow(unused)]
 | 
						|
use std::fmt::Debug;
 | 
						|
// Rustfix should add this, or use `std::fmt::Debug` instead.
 | 
						|
 | 
						|
#[allow(dead_code)]
 | 
						|
struct ConstrainedStruct<X: Copy> {
 | 
						|
    x: X
 | 
						|
}
 | 
						|
 | 
						|
#[allow(dead_code)]
 | 
						|
trait InsufficientlyConstrainedGeneric<X=()> where X: std::marker::Copy {
 | 
						|
    fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
 | 
						|
        //~^ ERROR the trait bound `X: Copy` is not satisfied
 | 
						|
        ConstrainedStruct { x }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
pub fn main() { }
 |