-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Handle divergence in type inference for blocks #1945
Conversation
I think we also need to consider cases like |
The |
I'm not sure how to check. |
I think it's also |
49f8799
to
f491567
Compare
Yeah, but in a more roundabout way: If the block diverges, rustc does not treat the missing tail expression as In general, I think we do need to track divergence separately from the type of the expression, similar to rustc, because e.g. for bors r+ |
Build succeeded |
That actually works because the code is only checking for |
Well yeah, it still works, but we should actually be checking for divergence inside expressions. For example this type checks: fn test() -> i128 {
foo(unimplemented!());
}
fn bar() -> i128 {
Struct { field: unimplemented!() };
} So we do need to recognize that |
Fixes #1944.
The
infer_basics
test is failing, not sure what to do about it.