Skip to content

Add tests for lint on type dependent on consts #97105

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 25, 2022

Conversation

JulianKnodt
Copy link
Contributor

r? @lcnr

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 17, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 17, 2022
@JulianKnodt JulianKnodt force-pushed the const_dep_gen_const_expr branch 2 times, most recently from e9d3f7b to ba8835e Compare May 17, 2022 06:19
@JulianKnodt JulianKnodt changed the title Add tests for lint on type dependent on consts. Add tests for lint on type dependent on consts May 17, 2022
@JulianKnodt JulianKnodt force-pushed the const_dep_gen_const_expr branch 2 times, most recently from 96ae797 to c03b357 Compare May 17, 2022 06:35
@JulianKnodt JulianKnodt force-pushed the const_dep_gen_const_expr branch from c03b357 to edae6ed Compare May 17, 2022 06:40
@JulianKnodt JulianKnodt marked this pull request as ready for review May 17, 2022 15:51
@rust-log-analyzer

This comment has been minimized.

@JulianKnodt JulianKnodt force-pushed the const_dep_gen_const_expr branch from 2fb723c to 814f18c Compare May 20, 2022 18:41
Comment on lines 100 to 108
Err(ErrorHandled::TooGeneric) => Err(if uv.has_infer_types_or_consts() {
NotConstEvaluatable::MentionsInfer
} else {
NotConstEvaluatable::MentionsParam
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

should be unreachable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm I tried it with unreachable!() and this branch actually gets hit

Copy link
Contributor

Choose a reason for hiding this comment

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

ah alright, can you because infcx.const_eval_resolve returns TooGeneric even if the inference vars are unused. Please change this to

            Err(ErrorHandled::TooGeneric) => {
                assert!(uv.has_infer_types_or_consts(), "unexpected `TooGeneric` for {:?}", uv);
                NotConstEvaluatable::MentionsInfer
            }

@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented May 23, 2022

@bors delegate+

please fix my last nit and squash your commits, then r=me 👍

@bors
Copy link
Collaborator

bors commented May 23, 2022

✌️ @JulianKnodt can now approve this pull request

@JulianKnodt JulianKnodt force-pushed the const_dep_gen_const_expr branch from 335b2ac to dd64482 Compare May 23, 2022 16:05
@rust-log-analyzer

This comment has been minimized.

@JulianKnodt JulianKnodt force-pushed the const_dep_gen_const_expr branch 2 times, most recently from cc9d5c3 to 031f4f4 Compare May 23, 2022 16:34
@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented May 23, 2022

uh that's just a bug with inconsistent where-clauses xx maybe change the assert to an if with a delay_span_bug for now? 😢

@JulianKnodt JulianKnodt force-pushed the const_dep_gen_const_expr branch from 031f4f4 to ed89b85 Compare May 24, 2022 03:27
Move a bunch of branches together into one if block, for easier reading.

Resolve comments

Attempt to make some branches unreachable [tmp]

Revert unreachable branches
@JulianKnodt JulianKnodt force-pushed the const_dep_gen_const_expr branch from ed89b85 to ee8efc5 Compare May 24, 2022 05:33
@JulianKnodt
Copy link
Contributor Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented May 25, 2022

📌 Commit ee8efc5 has been approved by lcnr

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2022
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#93604 (Make llvm-libunwind a per-target option)
 - rust-lang#97026 (Change orderings of `Debug` for the Atomic types to `Relaxed`.)
 - rust-lang#97105 (Add tests for lint on type dependent on consts)
 - rust-lang#97323 (Introduce stricter checks for might_permit_raw_init under a debug flag )
 - rust-lang#97379 (Add aliases for `current_dir`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 89bdbd0 into rust-lang:master May 25, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 25, 2022
@JulianKnodt JulianKnodt deleted the const_dep_gen_const_expr branch May 26, 2022 04:44
# for free to join this conversation on GitHub. Already have an account? # 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.

6 participants