Skip to content

Conversation

@matthiaskrgr
Copy link
Member

changelog: 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.

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