about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-19 14:52:30 +0000
committerbors <bors@rust-lang.org>2018-05-19 14:52:30 +0000
commit1b240dad0648dc45e50fd0421a29390343ad5808 (patch)
tree32a9591c9cd4f961182958e1d238f6065c826928 /src/rustllvm/RustWrapper.cpp
parentef8ee647749ad2f0acf235aaf18debacb974a048 (diff)
parent6da64a7666e89b39b99d728aaa3a40c124f31563 (diff)
downloadrust-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