Use assert_eq! in copy_from_slice#51765
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 29, 2018
jonas-schievink:patch-1
Merged
Use assert_eq! in copy_from_slice#51765bors merged 1 commit intorust-lang:masterfrom jonas-schievink:patch-1
bors merged 1 commit intorust-lang:masterfrom
jonas-schievink:patch-1
Conversation
This will print both lengths when the assertion fails instead of just saying that they're different.
Contributor
|
r? @KodrAus (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
|
Looks good to me! Thanks @jonas-schievink @bors r+ rollup |
Collaborator
|
📌 Commit 6b0c2fd has been approved by |
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this pull request
Jun 28, 2018
Use assert_eq! in copy_from_slice This will print both lengths when the assertion fails instead of just saying that they're different. Output of current stable and nightly (modulo the exact line number): ``` thread 'main' panicked at 'destination and source slices have different lengths', libcore/slice/mod.rs:1645:9 ``` Output after this PR: ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `123`, right: `456`: destination and source slices have different lengths', libcore/slice/mod.rs:1645:9 ``` Note that I have not run the tests locally.
bors
added a commit
that referenced
this pull request
Jun 28, 2018
Rollup of 6 pull requests Successful merges: - #51636 (Refactor error reporting of constants) - #51765 (Use assert_eq! in copy_from_slice) - #51822 (Provide existing ref suggestions for more E0308 errors) - #51839 (Detect overflows of non u32 shifts) - #51868 (Remove process::id from 'Stabilized APIs' in 1.27.0 release notes) - #51875 (Explicitely disable WASM code generation for Emscripten) 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 will print both lengths when the assertion fails instead of just saying that they're different.
Output of current stable and nightly (modulo the exact line number):
Output after this PR:
Note that I have not run the tests locally.