rust/tests/ui/consts/value-suggestion-ice-123906.stderr
Guillaume Gomez 4764dceb0f
Rollup merge of #124000 - compiler-errors:sugg-tweaks, r=wesleywiser
Use `/* value */` as a placeholder

The expression `value` isn't a valid suggestion; let's use `/* value */` as a placeholder (which is also invalid) since it more clearly signals to the user that they need to fill it in with something meaningful. This parallels the suggestions we have in a couple other places, like arguments.

We could also print the type name instead of `/* value */`, especially if it's suggestable, but I don't care strongly about that.
2024-04-17 00:00:23 +02:00

19 lines
606 B
Plaintext

error[E0308]: mismatched types
--> $DIR/value-suggestion-ice-123906.rs:3:9
|
LL | fn as_chunks<const N: usize>() -> [u8; N] {
| ------- expected `[u8; N]` because of this return type
LL | loop {
| ---- this loop is expected to be of type `[u8; N]`
LL | break;
| ^^^^^ expected `[u8; N]`, found `()`
|
help: give the `break` a value of the expected type
|
LL | break /* value */;
| +++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.