-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
crash: compile-time typeck/check.rs failure #3668
Comments
Updated test case: struct P { child: Option<@mut P> }
trait PTrait {
fn getChildOption() -> Option<@P>;
}
impl P: PTrait {
fn getChildOption() -> Option<@P> {
let opt: Option<@P> = None; if self.child.is_some() { const childVal: @P = self.child.get();
opt = Some(childVal);
}
opt
}
} |
I'll take a look while waiting for snapshots to finish... |
An even smaller program that exhibits the same bug:
The problem is that this isn't an acceptable RHS for a constant, as in your example as well. But, constant checking happens after typechecking. The typechecker, though, assumes constants don't refer to things like |
This seems like a resolve bug. Resolve should understand the scoping for constant declarations. |
…f_checked_ops, r=RalfJung Use strict ops instead of checked ops ## What Replace `checked_add(...).unwrap()` with `strict_add(...)`, etc. Resolves rust-lang#3668.
Result of attempted compilation:
The text was updated successfully, but these errors were encountered: