Add a failing UI test for multiple loops of all kinds in a const#66096
Merged
bors merged 1 commit intorust-lang:masterfrom Nov 5, 2019
Merged
Add a failing UI test for multiple loops of all kinds in a const#66096bors merged 1 commit intorust-lang:masterfrom
const#66096bors merged 1 commit intorust-lang:masterfrom
Conversation
These errors are suboptimal, but they will be fixed by the new `check_consts` pass.
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
Centril
reviewed
Nov 5, 2019
| x += 1; | ||
| } | ||
|
|
||
| while x < 8 { |
Contributor
There was a problem hiding this comment.
Does the checker stop before reaching here?
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
|
r? @Centril |
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit c8ae281 has been approved by |
emilyalbini
added a commit
to emilyalbini/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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-
whileloops in aconst, and there were no tests with multiple loops.