We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
while let
1 parent 697bd0c commit 61924f5Copy full SHA for 61924f5
src/destructors.md
@@ -222,6 +222,7 @@ r[destructors.scope.temporary.edition2024]
222
Some examples:
223
224
```rust
225
+# #![allow(irrefutable_let_patterns)]
226
# struct PrintOnDrop(&'static str);
227
# impl Drop for PrintOnDrop {
228
# fn drop(&mut self) {
@@ -248,6 +249,13 @@ else {
248
249
// `if let else` dropped here
250
};
251
252
+while let x = PrintOnDrop("while let scrutinee").0 {
253
+ PrintOnDrop("while let loop body").0;
254
+ break;
255
+ // `while let loop body` dropped here.
256
+ // `while let scrutinee` dropped here.
257
+}
258
+
259
// Dropped before the first ||
260
(PrintOnDrop("first operand").0 == ""
261
// Dropped before the )
0 commit comments