mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 15:05:30 +00:00 
			
		
		
		
	Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
		
			
				
	
	
		
			28 lines
		
	
	
		
			649 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			649 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
trait Marker {}
 | 
						|
impl Marker for u32 {}
 | 
						|
 | 
						|
trait MyTrait {
 | 
						|
    fn foo(&self) -> impl Marker;
 | 
						|
}
 | 
						|
 | 
						|
struct Outer;
 | 
						|
 | 
						|
impl MyTrait for Outer {
 | 
						|
    fn foo(&self) -> impl Marker {
 | 
						|
        42
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
impl dyn MyTrait {
 | 
						|
    //~^ ERROR the trait `MyTrait` cannot be made into an object
 | 
						|
    fn other(&self) -> impl Marker {
 | 
						|
        //~^ ERROR the trait `MyTrait` cannot be made into an object
 | 
						|
        MyTrait::foo(&self)
 | 
						|
        //~^ ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
 | 
						|
        //~| ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
 | 
						|
        //~| ERROR the trait `MyTrait` cannot be made into an object
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
fn main() {}
 |