
- Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.
28 lines
565 B
Rust
28 lines
565 B
Rust
// run-pass
|
|
// compile-flags: -g
|
|
// ignore-asmjs wasm2js does not support source maps yet
|
|
|
|
#![feature(generators, generator_trait)]
|
|
|
|
use std::ops::Generator;
|
|
|
|
struct Database;
|
|
|
|
impl Database {
|
|
fn get_connection(&self) -> impl Iterator<Item = ()> {
|
|
Some(()).into_iter()
|
|
}
|
|
|
|
fn check_connection(&self) -> impl Generator<Yield = (), Return = ()> + '_ {
|
|
move || {
|
|
let iter = self.get_connection();
|
|
for i in iter {
|
|
yield i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
Database.check_connection();
|
|
}
|