mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-03 22:49:17 +00:00 
			
		
		
		
	Remove the "which is required by `{root_obligation}`" post-script in
"the trait `X` is not implemented for `Y`" explanation in E0277. This
information is already conveyed in the notes explaining requirements,
making it redundant while making the text (particularly in labels)
harder to read.
```
error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
  --> $DIR/wf-static-type.rs:10:13
   |
LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
   |             ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
   |
   = note: required for `Option<NotCopy>` to implement `Copy`
note: required by a bound in `IsCopy`
  --> $DIR/wf-static-type.rs:7:17
   |
LL | struct IsCopy<T:Copy> { t: T }
   |                 ^^^^ required by this bound in `IsCopy`
```
vs the prior
```
error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
  --> $DIR/wf-static-type.rs:10:13
   |
LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
   |             ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy`
   |
   = note: required for `Option<NotCopy>` to implement `Copy`
note: required by a bound in `IsCopy`
  --> $DIR/wf-static-type.rs:7:17
   |
LL | struct IsCopy<T:Copy> { t: T }
   |                 ^^^^ required by this bound in `IsCopy`
```
		
	
			
		
			
				
	
	
		
			32 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
error[E0277]: the size for values of type `str` cannot be known at compilation time
 | 
						|
  --> $DIR/unsized-ret.rs:10:11
 | 
						|
   |
 | 
						|
LL |     foo::<fn() -> str, _>(None, ());
 | 
						|
   |           ^^^^^^^^^^^ doesn't have a size known at compile-time
 | 
						|
   |
 | 
						|
   = help: within `fn() -> str`, the trait `Sized` is not implemented for `str`
 | 
						|
   = note: required because it appears within the type `fn() -> str`
 | 
						|
note: required by a bound in `foo`
 | 
						|
  --> $DIR/unsized-ret.rs:5:11
 | 
						|
   |
 | 
						|
LL | fn foo<F: Fn<T>, T:std::marker::Tuple>(f: Option<F>, t: T) {
 | 
						|
   |           ^^^^^ required by this bound in `foo`
 | 
						|
 | 
						|
error[E0277]: the size for values of type `(dyn std::fmt::Display + 'a)` cannot be known at compilation time
 | 
						|
  --> $DIR/unsized-ret.rs:13:11
 | 
						|
   |
 | 
						|
LL |     foo::<for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&(),));
 | 
						|
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
 | 
						|
   |
 | 
						|
   = help: within `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`, the trait `for<'a> Sized` is not implemented for `(dyn std::fmt::Display + 'a)`
 | 
						|
   = note: required because it appears within the type `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`
 | 
						|
note: required by a bound in `foo`
 | 
						|
  --> $DIR/unsized-ret.rs:5:11
 | 
						|
   |
 | 
						|
LL | fn foo<F: Fn<T>, T:std::marker::Tuple>(f: Option<F>, t: T) {
 | 
						|
   |           ^^^^^ required by this bound in `foo`
 | 
						|
 | 
						|
error: aborting due to 2 previous errors
 | 
						|
 | 
						|
For more information about this error, try `rustc --explain E0277`.
 |