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

Test that bounds checks are elided when slice len is checked up-front #73362

Merged
merged 3 commits into from
Jun 19, 2020

Conversation

erikdesjardins
Copy link
Contributor

Closes #69101

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 15, 2020
@@ -0,0 +1,26 @@
// no-system-llvm
// compile-flags: -O
#![crate_type = "lib"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment explaining what this test is testing?

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 16, 2020

📌 Commit e0975b9 has been approved by nikomatsakis

@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 Jun 16, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 17, 2020
Test that bounds checks are elided when slice len is checked up-front

Closes rust-lang#69101
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 17, 2020
Test that bounds checks are elided when slice len is checked up-front

Closes rust-lang#69101
@tmiasko
Copy link
Contributor

tmiasko commented Jun 17, 2020

Failed in #73438 on x86_64-gnu which enables debug assertions in std.
---- [codegen] codegen/issue-69101-bounds-check.rs stdout ----

error: verification with 'FileCheck' failed
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/issue-69101-bounds-check/issue-69101-bounds-check.ll" "/checkout/src/test/codegen/issue-69101-bounds-check.rs"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
/checkout/src/test/codegen/issue-69101-bounds-check.rs:15:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: panic_bounds_check
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/issue-69101-bounds-check/issue-69101-bounds-check.ll:141:25: note: found here
; call core::panicking::panic_bounds_check
                        ^~~~~~~~~~~~~~~~~~
/checkout/src/test/codegen/issue-69101-bounds-check.rs:26:16: error: CHECK-NOT: excluded string found in input
 // CHECK-NOT: panic_bounds_check
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/issue-69101-bounds-check/issue-69101-bounds-check.ll:264:25: note: found here
; call core::panicking::panic_bounds_check
                        ^~~~~~~~~~~~~~~~~~

------------------------------------------

@erikdesjardins
Copy link
Contributor Author

Sorry about that. Added (I hope) the right annotation to ignore those builds

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 18, 2020

📌 Commit 6351850 has been approved by nikomatsakis

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 19, 2020
Rollup of 13 pull requests

Successful merges:

 - rust-lang#70740 (Enabling static-pie for musl)
 - rust-lang#72331 (Report error when casting an C-like enum implementing Drop)
 - rust-lang#72486 (Fix asinh of negative values)
 - rust-lang#72497 (tag/niche terminology cleanup)
 - rust-lang#72999 (Create self-contained directory and move there some of external binaries/libs)
 - rust-lang#73130 (Remove const prop for indirects)
 - rust-lang#73142 (Ensure std benchmarks get tested.)
 - rust-lang#73305 (Disallow loading crates with non-ascii identifier name.)
 - rust-lang#73346 (Add rust specific features to print target features)
 - rust-lang#73362 (Test that bounds checks are elided when slice len is checked up-front)
 - rust-lang#73459 (Reduce pointer casts in Box::into_boxed_slice)
 - rust-lang#73464 (Document format correction)
 - rust-lang#73479 (Minor tweaks to liballoc)

Failed merges:

r? @ghost
@bors bors merged commit 7d3238f into rust-lang:master Jun 19, 2020
@erikdesjardins erikdesjardins deleted the bounds branch June 19, 2020 23:26
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
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
6 participants