-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE with borrowing with Futures #45437
Comments
mersinvald
changed the title
ICE with mutable borrowing with Futures
ICE with borrowing with Futures
Oct 21, 2017
Looks like an #![feature(conservative_impl_trait)]
extern crate futures;
use futures::Future;
use futures::future::FutureResult;
use futures::future::ok;
fn future1(data: &i32) -> FutureResult<&i32, ()> {
ok(data)
}
fn main() {
future1(&1).wait().unwrap();
} |
Also, the code with explicit lifetimes compiles well. #![feature(conservative_impl_trait)]
extern crate futures;
use futures::Future;
use futures::future::ok;
fn future1<'a>(data: &'a i32) -> impl Future<Item=&'a i32, Error=()> + 'a {
ok(data)
}
fn main() {
future1(&1).wait().unwrap();
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler ICEd on the code with mutable borrowing inside futures
I tried this code:
https://play.rust-lang.org/?gist=62c4c9c732f500dab053d57fcd83fc11&version=nightly
I expected to see this happen:
Borrowing error saying me that I can't use anonymous lifetimes within futures
Instead, this happened:
ICE
Meta
rustc --version --verbose
:Backtrace:
The text was updated successfully, but these errors were encountered: