Uh oh!
There was an error while loading. Please reload this page.
Fix various issues with control-flow statements inside anonymous constants - #51967
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
estebank
left a comment
There was a problem hiding this comment.
Minor nitpicks, after that r=me.
There was a problem hiding this comment.
Use an enum instead of a boolean? That way you can communicate the meaning of the different states, not only in the method signature, but also at the return point and when being checked.
There was a problem hiding this comment.
Merge with the ty::TyParam(_) branch above, as they return the same thing.
There was a problem hiding this comment.
Expand the bug description a little with something like "literal integer with bad type".
There was a problem hiding this comment.
I don't really like the wording here, but that is the current wording, so don't bother coming up with better wording if you can't think of one immediately (I can't).
There was a problem hiding this comment.
Yeah, I thought the same thing. It's hard to think of something snappy. Perhaps simply:
`return` found outside a function
?
There was a problem hiding this comment.
Maybe "outside of function scope"? It'd be good to also expand the diagnostic to include an explanation that it is in a const scope, presenting a terse explanation that whatever is in such a scope will be evaluated at compile time, as well as a link to the documentation (https://doc.rust-lang.org/book/second-edition/ch03-01-variables-and-mutability.html#differences-between-variables-and-constants seems like the appropriate place, but it doesn't go into detail about this case).
Regardless, out of scope for this PR.
1e28faa to
9132e85Compareestebank
commented
Jul 2, 2018
@bors r+ |
bors
commented
Jul 2, 2018
📌 Commit 9132e8510337bdee76562e6e594016ac9e530c12 has been approved by |
bors
commented
Jul 2, 2018
☔ The latest upstream changes (presumably #51321) made this pull request unmergeable. Please resolve the merge conflicts. |
9132e85 to
adf4ef7Comparevarkor
commented
Jul 2, 2018
bors
commented
Jul 2, 2018
@varkor: 🔑 Insufficient privileges: Not in reviewers |
estebank
commented
Jul 2, 2018
@bors r+ |
bors
commented
Jul 2, 2018
📌 Commit adf4ef7 has been approved by |
…=estebank Fix various issues with control-flow statements inside anonymous constants Fixesrust-lang#51761. Fixesrust-lang#51963 (and the host of other reported issues there). (Might be easiest to review per commit, as they should be standalone.) r? @estebank
rust-highfive
commented
Jul 2, 2018
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
varkor
commented
Jul 2, 2018
Looks like a spurious failure to me. |
estebank
commented
Jul 2, 2018
@bors retry |
bors
commented
Jul 5, 2018
bors
commented
Jul 5, 2018
☀️ Test successful - status-appveyor, status-travis |
Fixes#51761.
Fixes#51963 (and the host of other reported issues there).
(Might be easiest to review per commit, as they should be standalone.)
r? @estebank