rust/tests/ui/dst/issue-90528-unsizing-suggestion-4.stderr
Esteban Küber eeadffd926 When more than a single impl and less than 4 could apply, point at them
```
error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
  --> $DIR/issue-67185-2.rs:21:6
   |
LL | impl Foo for FooImpl {}
   |      ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
   |
help: the following other types implement trait `Bar`
  --> $DIR/issue-67185-2.rs:9:1
   |
LL | impl Bar for [u16; 4] {}
   | ^^^^^^^^^^^^^^^^^^^^^ `[u16; 4]`
LL | impl Bar for [[u16; 3]; 3] {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `[[u16; 3]; 3]`
note: required by a bound in `Foo`
  --> $DIR/issue-67185-2.rs:14:30
   |
LL | trait Foo
   |       --- required by a bound in this trait
LL | where
LL |     [<u8 as Baz>::Quaks; 2]: Bar,
   |                              ^^^ required by this bound in `Foo`
```
2025-10-31 20:44:01 +00:00

95 lines
3.3 KiB
Text

error[E0277]: the trait bound `[u8; 1]: Write` is not satisfied
--> $DIR/issue-90528-unsizing-suggestion-4.rs:14:17
|
LL | wants_write(x);
| ----------- ^ the trait `Write` is not implemented for `[u8; 1]`
| |
| required by a bound introduced by this call
|
help: the trait `Write` is implemented for `&mut [u8]`
--> $DIR/issue-90528-unsizing-suggestion-4.rs:8:1
|
LL | impl Write for &mut [u8] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `wants_write`
--> $DIR/issue-90528-unsizing-suggestion-4.rs:10:24
|
LL | fn wants_write(_: impl Write) {}
| ^^^^^ required by this bound in `wants_write`
help: convert the array to a `&mut [u8]` slice instead
|
LL | wants_write(&mut x[..]);
| ++++ ++++
error[E0277]: the trait bound `&mut [u8; 1]: Write` is not satisfied
--> $DIR/issue-90528-unsizing-suggestion-4.rs:16:17
|
LL | wants_write(&mut x);
| ----------- ^^^^^^ the trait `Write` is not implemented for `&mut [u8; 1]`
| |
| required by a bound introduced by this call
|
help: the trait `Write` is implemented for `&mut [u8]`
--> $DIR/issue-90528-unsizing-suggestion-4.rs:8:1
|
LL | impl Write for &mut [u8] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `wants_write`
--> $DIR/issue-90528-unsizing-suggestion-4.rs:10:24
|
LL | fn wants_write(_: impl Write) {}
| ^^^^^ required by this bound in `wants_write`
help: convert the array to a `&mut [u8]` slice instead
|
LL | wants_write(&mut x[..]);
| ++++
error[E0277]: the trait bound `&mut [u8; 1]: Write` is not satisfied
--> $DIR/issue-90528-unsizing-suggestion-4.rs:21:17
|
LL | wants_write(x);
| ----------- ^ the trait `Write` is not implemented for `&mut [u8; 1]`
| |
| required by a bound introduced by this call
|
help: the trait `Write` is implemented for `&mut [u8]`
--> $DIR/issue-90528-unsizing-suggestion-4.rs:8:1
|
LL | impl Write for &mut [u8] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `wants_write`
--> $DIR/issue-90528-unsizing-suggestion-4.rs:10:24
|
LL | fn wants_write(_: impl Write) {}
| ^^^^^ required by this bound in `wants_write`
help: convert the array to a `&mut [u8]` slice instead
|
LL | wants_write(&mut x[..]);
| ++++ ++++
error[E0277]: the trait bound `[u8; 1]: Write` is not satisfied
--> $DIR/issue-90528-unsizing-suggestion-4.rs:23:17
|
LL | wants_write(*x);
| ----------- ^^ the trait `Write` is not implemented for `[u8; 1]`
| |
| required by a bound introduced by this call
|
help: the trait `Write` is implemented for `&mut [u8]`
--> $DIR/issue-90528-unsizing-suggestion-4.rs:8:1
|
LL | impl Write for &mut [u8] {}
| ^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `wants_write`
--> $DIR/issue-90528-unsizing-suggestion-4.rs:10:24
|
LL | fn wants_write(_: impl Write) {}
| ^^^^^ required by this bound in `wants_write`
help: convert the array to a `&mut [u8]` slice instead
|
LL | wants_write(&mut *x[..]);
| ++++ ++++
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0277`.