rust/tests/ui/const-generics/kind_mismatch.stderr
Esteban Küber 5b54286640 Remove detail from label/note that is already available in other note
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`
```
2024-10-29 16:26:57 +00:00

40 lines
1.5 KiB
Plaintext

error[E0747]: type provided when a constant was expected
--> $DIR/kind_mismatch.rs:11:38
|
LL | impl<K> ContainsKey<K> for KeyHolder<K> {}
| - ^
| |
| help: consider changing this type parameter to a const parameter: `const K: u8`
error[E0747]: type provided when a constant was expected
--> $DIR/kind_mismatch.rs:11:21
|
LL | impl<K> ContainsKey<K> for KeyHolder<K> {}
| - ^
| |
| help: consider changing this type parameter to a const parameter: `const K: u8`
error[E0277]: the trait bound `KeyHolder<0>: SubsetExcept<_>` is not satisfied
--> $DIR/kind_mismatch.rs:22:45
|
LL | let map: KeyHolder<0> = remove_key::<_, _>();
| ^ the trait `ContainsKey<0>` is not implemented for `KeyHolder<0>`
|
note: required for `KeyHolder<0>` to implement `SubsetExcept<_>`
--> $DIR/kind_mismatch.rs:15:28
|
LL | impl<P, T: ContainsKey<0>> SubsetExcept<P> for T {}
| -------------- ^^^^^^^^^^^^^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `remove_key`
--> $DIR/kind_mismatch.rs:17:25
|
LL | pub fn remove_key<K, S: SubsetExcept<K>>() -> S {
| ^^^^^^^^^^^^^^^ required by this bound in `remove_key`
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0277, E0747.
For more information about an error, try `rustc --explain E0277`.