Skip to content
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 consts with param/infer in const_eval_resolve better #99618

Merged
merged 2 commits into from
Jul 26, 2022

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jul 22, 2022

This PR addresses this thread here. Was this the change you were looking for @lcnr?

Interestingly, one test has begun to pass. Was that expected?

r? @lcnr

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 22, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jul 22, 2022

Some changes occurred in const_evaluatable.rs

cc @lcnr

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 22, 2022
@lcnr
Copy link
Contributor

lcnr commented Jul 25, 2022

2 nits, then r=me

thanks ❤️

@compiler-errors
Copy link
Member Author

@lcnr can you take one last look at this?

addressed the nits in the last commit, but I didn't know what to do when we had a ty::GenericArgKind::Const whose ty references params or infer -- do we want to replace that with a placeholder too? that's what I did, but idk if it's necessarily correct. 🤔

if ct.has_infer_types_or_consts() || ct.has_param_types_or_consts() =>
{
let mut ty = ct.ty();
// If the type references param or infer, replace that too...
Copy link
Contributor

@lcnr lcnr Jul 26, 2022

Choose a reason for hiding this comment

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

that should be unreachable, so you should be able to bug! there

inference variables in the type of ty::Const is something we can't deal with right now, so if we encounter them either:

  • something went wrong and we should ICE
  • my understanding of const generics is flawed, so i also want to know about that

Copy link
Member Author

Choose a reason for hiding this comment

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

mkay

@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Jul 26, 2022

📌 Commit b248647 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 26, 2022
handle consts with param/infer in `const_eval_resolve` better

This PR addresses [this thread here](rust-lang#99449 (comment)). Was this the change you were looking for `@lcnr?`

Interestingly, one test has begun to pass. Was that expected?

r? `@lcnr`
This was referenced Jul 26, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 26, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#99618 (handle consts with param/infer in `const_eval_resolve` better)
 - rust-lang#99666 (Restore `Opaque` behavior to coherence check)
 - rust-lang#99692 (interpret, ptr_offset_from: refactor and test too-far-apart check)
 - rust-lang#99739 (Remove erroneous E0133 code from an error message.)
 - rust-lang#99748 (Use full type name instead of just saying `impl Trait` in "captures lifetime" error)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a39c00e into rust-lang:master Jul 26, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 26, 2022
@compiler-errors compiler-errors deleted the uhh-idk branch August 11, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants