Uh oh!
There was an error while loading. Please reload this page.
Check array indices in constant propagation - #51308
Conversation
rust-highfive
commented
Jun 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 |
oli-obk
left a comment
There was a problem hiding this comment.
My initial hope was that just propagating the Rvalue::Len would automatically cause the index out of bounds terminator to report its error.
Did you try to go down that route?
Not sure what you mean with So I'll just look into what exactly has to be propagated here and adjust the PR. I think I understand what kind of approach you're thinking of. |
oli-obk
commented
Jun 3, 2018
oh... that makes a lot of sense. So we're just failing badly at propagating those constants? |
fanzier
commented
Jun 3, 2018
Yes, exactly, this code in Removing this makes array index checks work. I'll do slices in a separate PR. Will update the commit in a minute. |
f34283a to
42bd288Comparerust-highfive
commented
Jun 3, 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 |
rust-highfive
commented
Jun 3, 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 |
oli-obk
commented
Jun 4, 2018
You should |
c4fb5d7 to
4db265bComparefanzier
commented
Jun 4, 2018
Thanks, Travis is passing now |
oli-obk
commented
Jun 4, 2018
@bors r+ Awesome! Thanks |
bors
commented
Jun 4, 2018
📌 Commit 4db265b has been approved by |
bors
commented
Jun 5, 2018
🔒 Merge conflict |
4db265b to
9600489Comparefanzier
commented
Jun 5, 2018
Rebased but didn't find any conflicts (?) |
oli-obk
commented
Jun 5, 2018
yea bors is a little confused lately @bors r+ |
bors
commented
Jun 5, 2018
📌 Commit 9600489 has been approved by |
…ck, r=oli-obk Check array indices in constant propagation Previously, uses of constant weren't correctly propagated. This fixesrust-lang#48920. r? @oli-obk because you suggested it
Rollup of 7 pull requests Successful merges: - #50852 (Add doc comment to hiding portions of code example) - #51183 (Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function) - #51255 (Fix confusing error message for sub_instant) - #51256 (Fix crate-name option in rustdoc) - #51308 (Check array indices in constant propagation) - #51343 (test: Ignore some problematic tests on sparc and sparc64) - #51358 (Tests that #39963 is fixed on MIR borrowck) Failed merges:
leonardo-m
commented
Jun 9, 2018
Is code like this supposed to give an error in the last Nightly? |
oli-obk
commented
Jun 9, 2018
It's just a lint and not an error, but yes indeed it should |
leonardo-m
commented
Jun 10, 2018
If I compile with "rustc test.rs" I see: If I compile with "rustc --emit=metadata test.rs", I see no errors. Is this good? |
oli-obk
commented
Jun 10, 2018
Ugh.... that is weird. Open an issue? |
leonardo-m
commented
Jun 11, 2018
Opened as #51491 |
Previously, uses of constant weren't correctly propagated.
This fixes#48920.
r? @oli-obk because you suggested it