Skip to content

rustup https://github.com/rust-lang/rust/pull/66877 #4943

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

Closed
wants to merge 1 commit into from

Conversation

matthiaskrgr
Copy link
Member

changelog: none

@@ -345,7 +345,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
promoted: None,
};

let result = self.lcx.tcx.const_eval(self.param_env.and(gid)).ok()?;
let result = self.lcx.tcx.const_eval_validated(self.param_env.and(gid)).ok()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Use self.lcx.tcx.const_eval_resolve(self.param_env, def_id, substs, None)

@JohnTitor
Copy link
Member

I think we should use const_eval_resolve and const_eval_poly instead so that we can reduce code and avoid using const_eval_validated (documentation says "Do not use this directly"), opened #4944 for an alternative.

@@ -56,7 +56,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
instance,
promoted: None,
};
let constant = cx.tcx.const_eval(param_env.and(c_id)).ok();
let constant = cx.tcx.const_eval_validated(param_env.and(c_id)).ok();
Copy link
Contributor

Choose a reason for hiding this comment

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

use cx.tcx.const_eval_poly(def_id)

@oli-obk
Copy link
Contributor

oli-obk commented Dec 23, 2019

closing in favour of #4944

@oli-obk oli-obk closed this Dec 23, 2019
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.

3 participants