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

Add a failing UI test for multiple loops of all kinds in a const #66096

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

ecstatic-morse
Copy link
Contributor

@ecstatic-morse ecstatic-morse commented Nov 4, 2019

This simply demonstrates the current behavior and ensures we don't allow anything by accident.

The new const checker will be able to improve the diagnostics here. While working on it, I didn't see very many tests with non-while loops in a const, and there were no tests with multiple loops.

These errors are suboptimal, but they will be fixed by the new
`check_consts` pass.
@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 4, 2019
x += 1;
}

while x < 8 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the checker stop before reaching here?

Copy link
Contributor Author

@ecstatic-morse ecstatic-morse Nov 5, 2019

Choose a reason for hiding this comment

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

Yes. The current one does. The new one can give much better errors on code like this but enabling it is blocked on #65949.

For background, I was using this file as a test case while working on improving diagnostics for the new checker, and figured it could be merged upstream separately.

@Centril
Copy link
Contributor

Centril commented Nov 5, 2019

r? @Centril

@rust-highfive rust-highfive assigned Centril and unassigned alexcrichton Nov 5, 2019
@Centril
Copy link
Contributor

Centril commented Nov 5, 2019

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 5, 2019

📌 Commit c8ae281 has been approved by Centril

@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 Nov 5, 2019
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 5, 2019
…entril

Add a failing UI test for multiple loops of all kinds in a `const`

This simply demonstrates the current behavior and ensures we don't allow anything by accident.

The new const checker will be able to improve the diagnostics here. While working on it, I didn't see very many tests with non-`while` loops in a `const`, and there were no tests with multiple loops.
bors added a commit that referenced this pull request Nov 5, 2019
Rollup of 10 pull requests

Successful merges:

 - #65136 (Update codegen option documentation.)
 - #65574 (docs: improve disclaimer regarding LinkedList)
 - #65720 (Add FFI bindings for LLVM's Module::getInstructionCount())
 - #65905 ([doc] fixes for unix/vxworks `OpenOptionsExt::mode`)
 - #65962 (Fix logic in example.)
 - #66019 (Improved std::iter::Chain documentation)
 - #66038 (doc(str): show example of chars().count() under len())
 - #66042 (Suggest correct code when encountering an incorrect trait bound referencing the current trait)
 - #66073 (Do not needlessly write-lock)
 - #66096 (Add a failing UI test for multiple loops of all kinds in a `const`)

Failed merges:

r? @ghost
@bors bors merged commit c8ae281 into rust-lang:master Nov 5, 2019
@ecstatic-morse ecstatic-morse deleted the const-loop-test branch November 5, 2019 16:52
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants