Skip to content

Fix ICE comparing ExprRange equality #2439

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

Merged
merged 1 commit into from
Feb 6, 2018
Merged

Conversation

gnieto
Copy link
Contributor

@gnieto gnieto commented Feb 6, 2018

This should fix: #2423

eq_expr on hir::utils was throwing an ICE due to an invalid LateContext being used. I've added a method to be able to create a ConstEvalLateContext with a custom TypeckTables.
There was a comment on the issue pointing that it should be create also from a specific param_env, but it seems that is not need on this specific case. I've took a look and I didn't find any way of extracting the param_env.

`eq_expr` on hir::utils was throwing an ICE due to an invalid
LateContext being used. Due to this missusage, it was generating an ICE
with the code on the following issue:
rust-lang#2423
}
}

pub struct ConstEvalLateContext<'a, 'tcx: 'a> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not feel ok to make this public. Even that, I saw other public functions on this lint that are being used on hir_utils.

Should this be moved to the utils module?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine. I'm planning a big refactor anyway

@oli-obk oli-obk merged commit c322a74 into rust-lang:master Feb 6, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Feb 6, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic during check
2 participants