rustfmt changes return type of loop and causes code to not compile
Open
@carsonRadtke is already working on this.
Since Jun 23, 2022.
C-bug
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
Most basic example:
fn main() {
loop {
break false
};
}
This just runs and does nothing.
If you run rustfmt it yields
fn main() {
loop {
break false;
}
}
This now fails to compile
Compiling playground v0.0.1 (/playground)
error[[E0308]](https://doc.rust-lang.org/stable/error-index.html#E0308): mismatched types
--> src/main.rs:3:15
|
3 | break false;
| ^^^^^ expected `()`, found `bool`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` due to previous error
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.