ast_validation: forbid "nonstandard" literal patterns#43844
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 14, 2017
Merged
ast_validation: forbid "nonstandard" literal patterns#43844bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Member
|
@bors r+ |
Collaborator
|
📌 Commit 3dfc8a6 has been approved by |
kennytm
reviewed
Aug 13, 2017
src/test/compile-fail/issue-43250.rs
Outdated
Member
There was a problem hiding this comment.
🙅 Tabs found by tidy.
[00:04:00] tidy error: /checkout/src/test/compile-fail/issue-43250.rs:15: tab character
[00:04:00] tidy error: /checkout/src/test/compile-fail/issue-43250.rs:16: tab character
[00:04:00] tidy error: /checkout/src/test/compile-fail/issue-43250.rs:17: tab character
[00:04:00] tidy error: /checkout/src/librustc_passes/ast_validation.rs:106: tab character
[00:04:00] tidy error: /checkout/src/librustc_passes/ast_validation.rs:107: tab character
[00:04:00] tidy error: /checkout/src/librustc_passes/ast_validation.rs:108: tab character
[00:04:00] some tidy checks failed
Member
There was a problem hiding this comment.
I guess the original testcase was tainted :(.
Member
There was a problem hiding this comment.
Tabs also found in the 3 lines above.
Member
|
@bors r- |
Since rust-lang#42886, macros can create "nonstandard" PatKind::Lit patterns, that contain path expressions instead of the usual literal expr. These can cause trouble, including ICEs. We *could* map these nonstandard patterns to PatKind::Path patterns during HIR lowering, but that would be much effort for little gain, and I think is too risky for beta. So let's just forbid them during AST validation. Fixes rust-lang#43250.
3dfc8a6 to
a2adb7d
Compare
Contributor
Author
|
No more tabs! @bors r=eddyb |
Collaborator
|
📌 Commit a2adb7d has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
Aug 14, 2017
ast_validation: forbid "nonstandard" literal patterns Since #42886, macros can create "nonstandard" PatKind::Lit patterns, that contain path expressions instead of the usual literal expr. These can cause trouble, including ICEs. We *could* map these nonstandard patterns to PatKind::Path patterns during HIR lowering, but that would be much effort for little gain, and I think is too risky for beta. So let's just forbid them during AST validation. Fixes #43250. beta-nominating because regression. r? @eddyb
Collaborator
|
☀️ Test successful - status-appveyor, status-travis |
6 tasks
Contributor
|
Accepted for beta backport. Small patch, regression. cc @rust-lang/compiler |
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.
Since #42886, macros can create "nonstandard" PatKind::Lit patterns,
that contain path expressions instead of the usual literal expr. These
can cause trouble, including ICEs.
We could map these nonstandard patterns to PatKind::Path patterns
during HIR lowering, but that would be much effort for little gain, and
I think is too risky for beta. So let's just forbid them during AST
validation.
Fixes #43250.
beta-nominating because regression.
r? @eddyb