-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: NLL bug? #49616
Comments
Maybe fixed by @spastorino in #49808 |
#49808 fixes this issue. The output you get is ...
|
Why is it still error with NLL ? |
@ZhangHanDong I was just paying attention to the thing not ICEing :). Seems like there's something wrong /cc @nikomatsakis |
@ZhangHanDong @nikomatsakis explained here the bug #46413 (comment) so besides from the ICE there's something else going on :) |
Why is it still error with NLL in #49808? |
@ZhangHanDong I'm inclined to believe that this is the drop check rule in action again, because if you add a semicolon right after your if-let statement, the code compiles: #![feature(nll)]
use std::cell::RefCell;
fn main() {
let s = RefCell::new(Some(10));
if let Some(n) = *(s.borrow_mut()) {
println!("num: {}", n);
};
} In other words, the |
Closing as a duplicate of #22321. |
(it is more specifically a duplicate of #21114) |
(or really, at this point I might argue its a duplicate of #46413 ...) |
I thought the code should be compiled with nll feature ,
but got the following errors:
play
the following code is good:
The text was updated successfully, but these errors were encountered: