Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
a65404aba42fde1063d3f11f8cb4db0b8c20fce3
rust/tests/ui/loops/issue-1962.rs

11 lines
201 B
Rust
Raw Normal View History

[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives
2024-02-16 20:02:50 +00:00
//@ compile-flags: -D while-true
//@ run-rustfix
Audit uses of `span_suggestion_short`
2020-07-02 14:32:12 +09:00
Add a lint pass to check for while true { ... } loops And suggest changing them to loop { ... }. Had to fix the few remaining while true loops (in core::io). Closes #1962.
2012-04-19 18:04:41 -07:00
fn main() {
Audit uses of `span_suggestion_short`
2020-07-02 14:32:12 +09:00
let mut i = 0;
Account for labels when suggesting `loop` instead of `while true`
2021-01-19 15:51:51 -08:00
'a: while true { //~ ERROR denote infinite loops with `loop
Audit uses of `span_suggestion_short`
2020-07-02 14:32:12 +09:00
i += 1;
Account for labels when suggesting `loop` instead of `while true`
2021-01-19 15:51:51 -08:00
if i == 5 { break 'a; }
Audit uses of `span_suggestion_short`
2020-07-02 14:32:12 +09:00
}
Add a lint pass to check for while true { ... } loops And suggest changing them to loop { ... }. Had to fix the few remaining while true loops (in core::io). Closes #1962.
2012-04-19 18:04:41 -07:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 4865ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API