about summary refs log tree commit diff
path: root/src/test/run-pass/generator
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-09-06 14:36:26 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-09-06 14:36:26 +0200
commit76ceeddb2b6fd4589cf8292d8dafa65a91ace019 (patch)
tree11106836a5a37fc73a209a905786431ea0f10117 /src/test/run-pass/generator
parent20ca02569ae3e1dc29962e92739fbab632abf241 (diff)
downloadrust-76ceeddb2b6fd4589cf8292d8dafa65a91ace019.tar.gz
rust-76ceeddb2b6fd4589cf8292d8dafa65a91ace019.zip
Migrated remaining `src/test/run-pass/` subdirectories to `src/test/ui/run-pass/`.
Diffstat (limited to 'src/test/run-pass/generator')
-rw-r--r--src/test/run-pass/generator/auxiliary/xcrate-reachable.rs24
-rw-r--r--src/test/run-pass/generator/auxiliary/xcrate.rs27
-rw-r--r--src/test/run-pass/generator/borrow-in-tail-expr.rs19
-rw-r--r--src/test/run-pass/generator/conditional-drop.rs65
-rw-r--r--src/test/run-pass/generator/control-flow.rs56
-rw-r--r--src/test/run-pass/generator/drop-env.rs70
-rw-r--r--src/test/run-pass/generator/issue-44197.rs42
-rw-r--r--src/test/run-pass/generator/issue-52398.rs35
-rw-r--r--src/test/run-pass/generator/iterator-count.rs50
-rw-r--r--src/test/run-pass/generator/live-upvar-across-yield.rs21
-rw-r--r--src/test/run-pass/generator/match-bindings.rs30
-rw-r--r--src/test/run-pass/generator/nested_generators.rs30
-rw-r--r--src/test/run-pass/generator/panic-drops.rs64
-rw-r--r--src/test/run-pass/generator/panic-safe.rs37
-rw-r--r--src/test/run-pass/generator/reborrow-mut-upvar.rs24
-rw-r--r--src/test/run-pass/generator/resume-after-return.rs35
-rw-r--r--src/test/run-pass/generator/smoke.rs181
-rw-r--r--src/test/run-pass/generator/static-generators.rs26
-rw-r--r--src/test/run-pass/generator/too-live-local-in-immovable-gen.rs28
-rw-r--r--src/test/run-pass/generator/xcrate-reachable.rs21
-rw-r--r--src/test/run-pass/generator/xcrate.rs37
-rw-r--r--src/test/run-pass/generator/yield-in-args-rev.rs26
-rw-r--r--src/test/run-pass/generator/yield-in-box.rs26
-rw-r--r--src/test/run-pass/generator/yield-in-initializer.rs25
-rw-r--r--src/test/run-pass/generator/yield-subtype.rs27
25 files changed, 0 insertions, 1026 deletions
diff --git a/src/test/run-pass/generator/auxiliary/xcrate-reachable.rs b/src/test/run-pass/generator/auxiliary/xcrate-reachable.rs
deleted file mode 100644
index 91e43537cc2..00000000000
--- a/src/test/run-pass/generator/auxiliary/xcrate-reachable.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::Generator;
-
-fn msg() -> u32 {
-    0
-}
-
-pub fn foo() -> impl Generator<Yield=(), Return=u32> {
-    || {
-        yield;
-        return msg();
-    }
-}
diff --git a/src/test/run-pass/generator/auxiliary/xcrate.rs b/src/test/run-pass/generator/auxiliary/xcrate.rs
deleted file mode 100644
index fcfe0b754b6..00000000000
--- a/src/test/run-pass/generator/auxiliary/xcrate.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::Generator;
-
-pub fn foo() -> impl Generator<Yield = (), Return = ()> {
-    || {
-        if false {
-            yield;
-        }
-    }
-}
-
-pub fn bar<T: 'static>(t: T) -> Box<Generator<Yield = T, Return = ()>> {
-    Box::new(|| {
-        yield t;
-    })
-}
diff --git a/src/test/run-pass/generator/borrow-in-tail-expr.rs b/src/test/run-pass/generator/borrow-in-tail-expr.rs
deleted file mode 100644
index 486fe3c900d..00000000000
--- a/src/test/run-pass/generator/borrow-in-tail-expr.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators)]
-
-fn main() {
-    let _a = || {
-        yield;
-        let a = String::new();
-        a.len()
-    };
-}
diff --git a/src/test/run-pass/generator/conditional-drop.rs b/src/test/run-pass/generator/conditional-drop.rs
deleted file mode 100644
index 3d39c46186b..00000000000
--- a/src/test/run-pass/generator/conditional-drop.rs
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::Generator;
-use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
-
-static A: AtomicUsize = ATOMIC_USIZE_INIT;
-
-struct B;
-
-impl Drop for B {
-    fn drop(&mut self) {
-        A.fetch_add(1, Ordering::SeqCst);
-    }
-}
-
-
-fn test() -> bool { true }
-fn test2() -> bool { false }
-
-fn main() {
-    t1();
-    t2();
-}
-
-fn t1() {
-    let mut a = || {
-        let b = B;
-        if test() {
-            drop(b);
-        }
-        yield;
-    };
-
-    let n = A.load(Ordering::SeqCst);
-    unsafe { a.resume() };
-    assert_eq!(A.load(Ordering::SeqCst), n + 1);
-    unsafe { a.resume() };
-    assert_eq!(A.load(Ordering::SeqCst), n + 1);
-}
-
-fn t2() {
-    let mut a = || {
-        let b = B;
-        if test2() {
-            drop(b);
-        }
-        yield;
-    };
-
-    let n = A.load(Ordering::SeqCst);
-    unsafe { a.resume() };
-    assert_eq!(A.load(Ordering::SeqCst), n);
-    unsafe { a.resume() };
-    assert_eq!(A.load(Ordering::SeqCst), n + 1);
-}
diff --git a/src/test/run-pass/generator/control-flow.rs b/src/test/run-pass/generator/control-flow.rs
deleted file mode 100644
index 09971410e55..00000000000
--- a/src/test/run-pass/generator/control-flow.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::{GeneratorState, Generator};
-
-fn finish<T>(mut amt: usize, mut t: T) -> T::Return
-    where T: Generator<Yield = ()>
-{
-    loop {
-        match unsafe { t.resume() } {
-            GeneratorState::Yielded(()) => amt = amt.checked_sub(1).unwrap(),
-            GeneratorState::Complete(ret) => {
-                assert_eq!(amt, 0);
-                return ret
-            }
-        }
-    }
-
-}
-
-fn main() {
-    finish(1, || yield);
-    finish(8, || {
-        for _ in 0..8 {
-            yield;
-        }
-    });
-    finish(1, || {
-        if true {
-            yield;
-        } else {
-        }
-    });
-    finish(1, || {
-        if false {
-        } else {
-            yield;
-        }
-    });
-    finish(2, || {
-        if { yield; false } {
-            yield;
-            panic!()
-        }
-        yield
-    });
-}
diff --git a/src/test/run-pass/generator/drop-env.rs b/src/test/run-pass/generator/drop-env.rs
deleted file mode 100644
index ef4dc24472e..00000000000
--- a/src/test/run-pass/generator/drop-env.rs
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::Generator;
-use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
-
-static A: AtomicUsize = ATOMIC_USIZE_INIT;
-
-struct B;
-
-impl Drop for B {
-    fn drop(&mut self) {
-        A.fetch_add(1, Ordering::SeqCst);
-    }
-}
-
-fn main() {
-    t1();
-    t2();
-    t3();
-}
-
-fn t1() {
-    let b = B;
-    let mut foo = || {
-        yield;
-        drop(b);
-    };
-
-    let n = A.load(Ordering::SeqCst);
-    drop(unsafe { foo.resume() });
-    assert_eq!(A.load(Ordering::SeqCst), n);
-    drop(foo);
-    assert_eq!(A.load(Ordering::SeqCst), n + 1);
-}
-
-fn t2() {
-    let b = B;
-    let mut foo = || {
-        yield b;
-    };
-
-    let n = A.load(Ordering::SeqCst);
-    drop(unsafe { foo.resume() });
-    assert_eq!(A.load(Ordering::SeqCst), n + 1);
-    drop(foo);
-    assert_eq!(A.load(Ordering::SeqCst), n + 1);
-}
-
-fn t3() {
-    let b = B;
-    let foo = || {
-        yield;
-        drop(b);
-    };
-
-    let n = A.load(Ordering::SeqCst);
-    assert_eq!(A.load(Ordering::SeqCst), n);
-    drop(foo);
-    assert_eq!(A.load(Ordering::SeqCst), n + 1);
-}
diff --git a/src/test/run-pass/generator/issue-44197.rs b/src/test/run-pass/generator/issue-44197.rs
deleted file mode 100644
index 272b7eb7bfd..00000000000
--- a/src/test/run-pass/generator/issue-44197.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::{ Generator, GeneratorState };
-
-fn foo(_: &str) -> String {
-    String::new()
-}
-
-fn bar(baz: String) -> impl Generator<Yield = String, Return = ()> {
-    move || {
-        yield foo(&baz);
-    }
-}
-
-fn foo2(_: &str) -> Result<String, ()> {
-    Err(())
-}
-
-fn bar2(baz: String) -> impl Generator<Yield = String, Return = ()> {
-    move || {
-        if let Ok(quux) = foo2(&baz) {
-            yield quux;
-        }
-    }
-}
-
-fn main() {
-    unsafe {
-        assert_eq!(bar(String::new()).resume(), GeneratorState::Yielded(String::new()));
-        assert_eq!(bar2(String::new()).resume(), GeneratorState::Complete(()));
-    }
-}
diff --git a/src/test/run-pass/generator/issue-52398.rs b/src/test/run-pass/generator/issue-52398.rs
deleted file mode 100644
index 0fb8f277ea9..00000000000
--- a/src/test/run-pass/generator/issue-52398.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators)]
-
-use std::cell::RefCell;
-
-struct A;
-
-impl A {
-    fn test(&self, a: ()) {}
-}
-
-fn main() {
-    // Test that the MIR local with type &A created for the auto-borrow adjustment
-    // is caught by typeck
-    move || {
-        A.test(yield);
-    };
-
-    // Test that the std::cell::Ref temporary returned from the `borrow` call
-    // is caught by typeck
-    let y = RefCell::new(true);
-    static move || {
-        yield *y.borrow();
-        return "Done";
-    };
-}
diff --git a/src/test/run-pass/generator/iterator-count.rs b/src/test/run-pass/generator/iterator-count.rs
deleted file mode 100644
index 3564ddaa806..00000000000
--- a/src/test/run-pass/generator/iterator-count.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::{GeneratorState, Generator};
-
-struct W<T>(T);
-
-// This impl isn't safe in general, but the generator used in this test is movable
-// so it won't cause problems.
-impl<T: Generator<Return = ()>> Iterator for W<T> {
-    type Item = T::Yield;
-
-    fn next(&mut self) -> Option<Self::Item> {
-        match unsafe { self.0.resume() } {
-            GeneratorState::Complete(..) => None,
-            GeneratorState::Yielded(v) => Some(v),
-        }
-    }
-}
-
-fn test() -> impl Generator<Return=(), Yield=u8> {
-    || {
-        for i in 1..6 {
-            yield i
-        }
-    }
-}
-
-fn main() {
-    let end = 11;
-
-    let closure_test = |start| {
-        move || {
-            for i in start..end {
-                yield i
-            }
-        }
-    };
-
-    assert!(W(test()).chain(W(closure_test(6))).eq(1..11));
-}
diff --git a/src/test/run-pass/generator/live-upvar-across-yield.rs b/src/test/run-pass/generator/live-upvar-across-yield.rs
deleted file mode 100644
index 28e7da232ce..00000000000
--- a/src/test/run-pass/generator/live-upvar-across-yield.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::Generator;
-
-fn main() {
-    let b = |_| 3;
-    let mut a = || {
-        b(yield);
-    };
-    unsafe { a.resume() };
-}
diff --git a/src/test/run-pass/generator/match-bindings.rs b/src/test/run-pass/generator/match-bindings.rs
deleted file mode 100644
index 231aa1b42f0..00000000000
--- a/src/test/run-pass/generator/match-bindings.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators)]
-
-enum Enum {
-    A(String),
-    B
-}
-
-fn main() {
-    || {
-        loop {
-            if let true = true {
-                match Enum::A(String::new()) {
-                    Enum::A(_var) => {}
-                    Enum::B => {}
-                }
-            }
-            yield;
-        }
-    };
-}
diff --git a/src/test/run-pass/generator/nested_generators.rs b/src/test/run-pass/generator/nested_generators.rs
deleted file mode 100644
index 29808da85a7..00000000000
--- a/src/test/run-pass/generator/nested_generators.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators)]
-#![feature(generator_trait)]
-
-use std::ops::Generator;
-use std::ops::GeneratorState;
-
-fn main() {
-    let _generator = || {
-        let mut sub_generator = || {
-            yield 2;
-        };
-
-        match unsafe { sub_generator.resume() } {
-            GeneratorState::Yielded(x) => {
-                yield x;
-            }
-            _ => panic!(),
-        };
-    };
-}
diff --git a/src/test/run-pass/generator/panic-drops.rs b/src/test/run-pass/generator/panic-drops.rs
deleted file mode 100644
index 3d7b60ab6b9..00000000000
--- a/src/test/run-pass/generator/panic-drops.rs
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-wasm32-bare compiled as panic=abort by default
-
-#![feature(generators, generator_trait)]
-
-use std::ops::Generator;
-use std::panic;
-use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
-
-static A: AtomicUsize = ATOMIC_USIZE_INIT;
-
-struct B;
-
-impl Drop for B {
-    fn drop(&mut self) {
-        A.fetch_add(1, Ordering::SeqCst);
-    }
-}
-
-fn bool_true() -> bool {
-    true
-}
-
-fn main() {
-    let b = B;
-    let mut foo = || {
-        if bool_true() {
-            panic!();
-        }
-        drop(b);
-        yield;
-    };
-
-    assert_eq!(A.load(Ordering::SeqCst), 0);
-    let res = panic::catch_unwind(panic::AssertUnwindSafe(|| {
-        unsafe { foo.resume() }
-    }));
-    assert!(res.is_err());
-    assert_eq!(A.load(Ordering::SeqCst), 1);
-
-    let mut foo = || {
-        if bool_true() {
-            panic!();
-        }
-        drop(B);
-        yield;
-    };
-
-    assert_eq!(A.load(Ordering::SeqCst), 1);
-    let res = panic::catch_unwind(panic::AssertUnwindSafe(|| {
-        unsafe { foo.resume() }
-    }));
-    assert!(res.is_err());
-    assert_eq!(A.load(Ordering::SeqCst), 1);
-}
diff --git a/src/test/run-pass/generator/panic-safe.rs b/src/test/run-pass/generator/panic-safe.rs
deleted file mode 100644
index ace5cdde51d..00000000000
--- a/src/test/run-pass/generator/panic-safe.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-wasm32-bare compiled with panic=abort by default
-
-#![feature(generators, generator_trait)]
-
-use std::ops::Generator;
-use std::panic;
-
-fn main() {
-    let mut foo = || {
-        if true {
-            panic!();
-        }
-        yield;
-    };
-
-    let res = panic::catch_unwind(panic::AssertUnwindSafe(|| {
-        unsafe { foo.resume() }
-    }));
-    assert!(res.is_err());
-
-    for _ in 0..10 {
-        let res = panic::catch_unwind(panic::AssertUnwindSafe(|| {
-            unsafe { foo.resume() }
-        }));
-        assert!(res.is_err());
-    }
-}
diff --git a/src/test/run-pass/generator/reborrow-mut-upvar.rs b/src/test/run-pass/generator/reborrow-mut-upvar.rs
deleted file mode 100644
index 8353066bfbe..00000000000
--- a/src/test/run-pass/generator/reborrow-mut-upvar.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators)]
-
-fn _run(bar: &mut i32) {
-    || {
-        {
-            let _baz = &*bar;
-            yield;
-        }
-
-        *bar = 2;
-    };
-}
-
-fn main() {}
diff --git a/src/test/run-pass/generator/resume-after-return.rs b/src/test/run-pass/generator/resume-after-return.rs
deleted file mode 100644
index 06e7615d261..00000000000
--- a/src/test/run-pass/generator/resume-after-return.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-wasm32-bare compiled with panic=abort by default
-
-#![feature(generators, generator_trait)]
-
-use std::ops::{GeneratorState, Generator};
-use std::panic;
-
-fn main() {
-    let mut foo = || {
-        if true {
-            return
-        }
-        yield;
-    };
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(()) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-
-    match panic::catch_unwind(move || unsafe { foo.resume() }) {
-        Ok(_) => panic!("generator successfully resumed"),
-        Err(_) => {}
-    }
-}
diff --git a/src/test/run-pass/generator/smoke.rs b/src/test/run-pass/generator/smoke.rs
deleted file mode 100644
index 7395c8484c1..00000000000
--- a/src/test/run-pass/generator/smoke.rs
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-emscripten no threads support
-// compile-flags: --test
-
-#![feature(generators, generator_trait)]
-
-use std::ops::{GeneratorState, Generator};
-use std::thread;
-
-#[test]
-fn simple() {
-    let mut foo = || {
-        if false {
-            yield;
-        }
-    };
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(()) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-}
-
-#[test]
-fn return_capture() {
-    let a = String::from("foo");
-    let mut foo = || {
-        if false {
-            yield;
-        }
-        a
-    };
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(ref s) if *s == "foo" => {}
-        s => panic!("bad state: {:?}", s),
-    }
-}
-
-#[test]
-fn simple_yield() {
-    let mut foo = || {
-        yield;
-    };
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Yielded(()) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(()) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-}
-
-#[test]
-fn yield_capture() {
-    let b = String::from("foo");
-    let mut foo = || {
-        yield b;
-    };
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Yielded(ref s) if *s == "foo" => {}
-        s => panic!("bad state: {:?}", s),
-    }
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(()) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-}
-
-#[test]
-fn simple_yield_value() {
-    let mut foo = || {
-        yield String::from("bar");
-        return String::from("foo")
-    };
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Yielded(ref s) if *s == "bar" => {}
-        s => panic!("bad state: {:?}", s),
-    }
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(ref s) if *s == "foo" => {}
-        s => panic!("bad state: {:?}", s),
-    }
-}
-
-#[test]
-fn return_after_yield() {
-    let a = String::from("foo");
-    let mut foo = || {
-        yield;
-        return a
-    };
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Yielded(()) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(ref s) if *s == "foo" => {}
-        s => panic!("bad state: {:?}", s),
-    }
-}
-
-#[test]
-fn send_and_sync() {
-    assert_send_sync(|| {
-        yield
-    });
-    assert_send_sync(|| {
-        yield String::from("foo");
-    });
-    assert_send_sync(|| {
-        yield;
-        return String::from("foo");
-    });
-    let a = 3;
-    assert_send_sync(|| {
-        yield a;
-        return
-    });
-    let a = 3;
-    assert_send_sync(move || {
-        yield a;
-        return
-    });
-    let a = String::from("a");
-    assert_send_sync(|| {
-        yield ;
-        drop(a);
-        return
-    });
-    let a = String::from("a");
-    assert_send_sync(move || {
-        yield ;
-        drop(a);
-        return
-    });
-
-    fn assert_send_sync<T: Send + Sync>(_: T) {}
-}
-
-#[test]
-fn send_over_threads() {
-    let mut foo = || { yield };
-    thread::spawn(move || {
-        match unsafe { foo.resume() } {
-            GeneratorState::Yielded(()) => {}
-            s => panic!("bad state: {:?}", s),
-        }
-        match unsafe { foo.resume() } {
-            GeneratorState::Complete(()) => {}
-            s => panic!("bad state: {:?}", s),
-        }
-    }).join().unwrap();
-
-    let a = String::from("a");
-    let mut foo = || { yield a };
-    thread::spawn(move || {
-        match unsafe { foo.resume() } {
-            GeneratorState::Yielded(ref s) if *s == "a" => {}
-            s => panic!("bad state: {:?}", s),
-        }
-        match unsafe { foo.resume() } {
-            GeneratorState::Complete(()) => {}
-            s => panic!("bad state: {:?}", s),
-        }
-    }).join().unwrap();
-}
diff --git a/src/test/run-pass/generator/static-generators.rs b/src/test/run-pass/generator/static-generators.rs
deleted file mode 100644
index ebc070eee09..00000000000
--- a/src/test/run-pass/generator/static-generators.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators, generator_trait)]
-
-use std::ops::{Generator, GeneratorState};
-
-fn main() {
-    let mut generator = static || {
-        let a = true;
-        let b = &a;
-        yield;
-        assert_eq!(b as *const _, &a as *const _);
-    };
-    unsafe {
-        assert_eq!(generator.resume(), GeneratorState::Yielded(()));
-        assert_eq!(generator.resume(), GeneratorState::Complete(()));
-    }
-}
diff --git a/src/test/run-pass/generator/too-live-local-in-immovable-gen.rs b/src/test/run-pass/generator/too-live-local-in-immovable-gen.rs
deleted file mode 100644
index 2314533a681..00000000000
--- a/src/test/run-pass/generator/too-live-local-in-immovable-gen.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators)]
-
-fn main() {
-    unsafe {
-        static move || {
-            // Tests that the generator transformation finds out that `a` is not live
-            // during the yield expression. Type checking will also compute liveness
-            // and it should also find out that `a` is not live.
-            // The compiler will panic if the generator transformation finds that
-            // `a` is live and type checking finds it dead.
-            let a = {
-                yield ();
-                4i32
-            };
-            &a;
-        };
-    }
-}
diff --git a/src/test/run-pass/generator/xcrate-reachable.rs b/src/test/run-pass/generator/xcrate-reachable.rs
deleted file mode 100644
index 2fc39ba1869..00000000000
--- a/src/test/run-pass/generator/xcrate-reachable.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:xcrate-reachable.rs
-
-#![feature(generator_trait)]
-
-extern crate xcrate_reachable as foo;
-
-use std::ops::Generator;
-
-fn main() {
-    unsafe { foo::foo().resume(); }
-}
diff --git a/src/test/run-pass/generator/xcrate.rs b/src/test/run-pass/generator/xcrate.rs
deleted file mode 100644
index 04791d51356..00000000000
--- a/src/test/run-pass/generator/xcrate.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:xcrate.rs
-
-#![feature(generators, generator_trait)]
-
-extern crate xcrate;
-
-use std::ops::{GeneratorState, Generator};
-
-fn main() {
-    let mut foo = xcrate::foo();
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(()) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-
-    let mut foo = xcrate::bar(3);
-
-    match unsafe { foo.resume() } {
-        GeneratorState::Yielded(3) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-    match unsafe { foo.resume() } {
-        GeneratorState::Complete(()) => {}
-        s => panic!("bad state: {:?}", s),
-    }
-}
diff --git a/src/test/run-pass/generator/yield-in-args-rev.rs b/src/test/run-pass/generator/yield-in-args-rev.rs
deleted file mode 100644
index df00329799e..00000000000
--- a/src/test/run-pass/generator/yield-in-args-rev.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that a borrow that occurs after a yield in the same
-// argument list is not treated as live across the yield by
-// type-checking.
-
-#![feature(generators)]
-
-fn foo(_a: (), _b: &bool) {}
-
-fn bar() {
-    || {
-        let b = true;
-        foo(yield, &b);
-    };
-}
-
-fn main() { }
diff --git a/src/test/run-pass/generator/yield-in-box.rs b/src/test/run-pass/generator/yield-in-box.rs
deleted file mode 100644
index d68007be05c..00000000000
--- a/src/test/run-pass/generator/yield-in-box.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that box-statements with yields in them work.
-
-#![feature(generators, box_syntax)]
-
-fn main() {
-    let x = 0i32;
-    || {
-        let y = 2u32;
-        {
-            let _t = box (&x, yield 0, &y);
-        }
-        match box (&x, yield 0, &y) {
-            _t => {}
-        }
-    };
-}
diff --git a/src/test/run-pass/generator/yield-in-initializer.rs b/src/test/run-pass/generator/yield-in-initializer.rs
deleted file mode 100644
index 3042061226b..00000000000
--- a/src/test/run-pass/generator/yield-in-initializer.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(generators)]
-
-fn main() {
-    static || {
-        loop {
-            // Test that `opt` is not live across the yield, even when borrowed in a loop
-            // See https://github.com/rust-lang/rust/issues/52792
-            let opt = {
-                yield;
-                true
-            };
-            &opt;
-        }
-    };
-}
diff --git a/src/test/run-pass/generator/yield-subtype.rs b/src/test/run-pass/generator/yield-subtype.rs
deleted file mode 100644
index c4134169044..00000000000
--- a/src/test/run-pass/generator/yield-subtype.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// revisions:lexical nll
-//[nll]compile-flags: -Z disable-nll-user-type-assert
-#![cfg_attr(nll, feature(nll))]
-
-#![feature(generators)]
-
-fn bar<'a>() {
-    let a: &'static str = "hi";
-    let b: &'a str = a;
-
-    || {
-        yield a;
-        yield b;
-    };
-}
-
-fn main() {}