diff options
| author | bors <bors@rust-lang.org> | 2018-05-19 14:52:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-05-19 14:52:30 +0000 |
| commit | 1b240dad0648dc45e50fd0421a29390343ad5808 (patch) | |
| tree | 32a9591c9cd4f961182958e1d238f6065c826928 /src/rustllvm/RustWrapper.cpp | |
| parent | ef8ee647749ad2f0acf235aaf18debacb974a048 (diff) | |
| parent | 6da64a7666e89b39b99d728aaa3a40c124f31563 (diff) | |
| download | rust-1b240dad0648dc45e50fd0421a29390343ad5808.tar.gz rust-1b240dad0648dc45e50fd0421a29390343ad5808.zip | |
Auto merge of #50763 - KyleStach1678:unused-loop-label, r=petrochenkov
Add lint checks for unused loop labels
Previously no warning was generated when a loop label was written out but never used (i.e. in a `break` or `continue` statement):
```rust
fn main() {
'unused_label: loop {}
}
```
would compile without complaint.
This fix introduces `-W unused_loop_label`, which generates the following warning message for the above snippet:
```
warning: unused loop label
--> main.rs:2:5
|
2 | 'unused_label: loop {}
| ^^^^^^^^^^^^^
|
= note: #[warn(unused_loop_label)] on by default
```
Fixes: #50751.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
