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.
1 parent d4c3643 commit 125326eCopy full SHA for 125326e
src/test/ui/generator/drop-track-addassign-yield.rs
@@ -0,0 +1,41 @@
1
+// run-pass
2
+// compile-flags: -Zdrop-tracking
3
+
4
+// Based on addassign-yield.rs, but with drop tracking enabled. Originally we did not implement
5
+// the fake_read callback on ExprUseVisitor which caused this case to break.
6
7
+#![feature(generators)]
8
9
+fn foo() {
10
+ let _y = static || {
11
+ let x = &mut 0;
12
+ *{
13
+ yield;
14
+ x
15
+ } += match String::new() {
16
+ _ => 0,
17
+ };
18
19
20
+ // Please don't ever actually write something like this
21
+ let _z = static || {
22
23
24
+ let inner = &mut 1;
25
26
+ yield ();
27
+ inner
28
29
+ _ => 1,
30
31
32
33
34
+ _ => 2,
35
36
37
+}
38
39
+fn main() {
40
+ foo()
41
0 commit comments