Rust: Wrong 'unexpected close delimiter' (not clear why)

Created on 10 Dec 2017  ·  1Comment  ·  Source: rust-lang/rust

The following code returns an error about 'unexpected close delimiter' even though all braces and parentheses are matched correctly:

#![feature(conservative_impl_trait)]

extern crate futures;
extern crate tokio_core;
use futures::future::{self};
use futures::future::*;
use tokio_core::reactor::Core;

fn main() {
    let mut core = Core::new().expect("Failed to initialize tokio_core reactor!");

    let f = create_future();

    core.run(f).unwrap();
}

fn create_future() -> Result<()>
    return future::ok(());
}

Most helpful comment

Something is missing after Result<()>, an opening {.

>All comments

Something is missing after Result<()>, an opening {.

Was this page helpful?
0 / 5 - 0 ratings