summaryrefslogtreecommitdiffstats
path: root/tests/ui/generator/partial-drop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generator/partial-drop.rs')
-rw-r--r--tests/ui/generator/partial-drop.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/ui/generator/partial-drop.rs b/tests/ui/generator/partial-drop.rs
index 1d3ae075d..868f36adc 100644
--- a/tests/ui/generator/partial-drop.rs
+++ b/tests/ui/generator/partial-drop.rs
@@ -1,8 +1,4 @@
-// revisions: no_drop_tracking drop_tracking drop_tracking_mir
-// [drop_tracking] compile-flags: -Zdrop-tracking
-// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
-// [drop_tracking_mir] check-pass
-
+// check-pass
#![feature(negative_impls, generators)]
struct Foo;
@@ -15,14 +11,19 @@ struct Bar {
fn main() {
assert_send(|| {
- //[no_drop_tracking,drop_tracking]~^ ERROR generator cannot be sent between threads safely
let guard = Bar { foo: Foo, x: 42 };
drop(guard.foo);
yield;
});
assert_send(|| {
- //[no_drop_tracking,drop_tracking]~^ ERROR generator cannot be sent between threads safely
+ let mut guard = Bar { foo: Foo, x: 42 };
+ drop(guard);
+ guard = Bar { foo: Foo, x: 23 };
+ yield;
+ });
+
+ assert_send(|| {
let guard = Bar { foo: Foo, x: 42 };
let Bar { foo, x } = guard;
drop(foo);