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

smaller PR just to fix #50002 #50039

Merged
merged 2 commits into from
Apr 21, 2018
Merged

smaller PR just to fix #50002 #50039

merged 2 commits into from
Apr 21, 2018

Conversation

ExpHP
Copy link
Contributor

@ExpHP ExpHP commented Apr 18, 2018

I pulled this out of #50010 to make it easier to backport to beta if necessary, considering that inclusive range syntax is stabilizing soon (?).

It fixes a bug in <str>::index_mut with (..=end) ranges (#50002), which prior to this fix was not only unusable but also UB in the cases where it "worked" (it gave improperly truncated UTF-8).

(not that I can imagine why anybody would use <str>::index_mut... but I'm not here to judge)

@rust-highfive
Copy link
Collaborator

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:00:45] configure: rust.quiet-tests     := True
---
[00:59:47] .................................................................................i..................
[00:59:55] ........................i...........................................................................
---
[01:00:49] .....................i...........................................................................i..
[01:00:57] ....................................................................................................
[01:01:05] ...........ii.......................................................................................
[01:01:17] ............................................................................................i.......
---
[01:02:08] .............................................i......................................................
---
[01:07:27] ..............................i.....................................................................
[01:07:45] ...............................................................i....................................
[01:08:05] .................................................i..................................................
[01:08:31] ....................................................................................................
[01:08:59] ....................................................................................................
[01:09:28] ....................................................................................................
[01:10:00] .......i............................................................................................
[01:10:19] ...i.........................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[01:10:48] .......................................................
[01:11:30] ....................................................................................................
[01:12:11] .....................................................................ii.............................
[01:12:59] ................................i.......................test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[01:13:22] .............................i.ii...........
[01:14:16] .............................................................................................iiiiiii
---
[01:17:46] ....................i............................................................ii.iii.............
[01:17:55] ....................................................................................................
[01:18:05] .........i..............................i...........................................................
[01:18:15] ....................................................................................................
[01:18:23] ...........i........................................................................................
---
[01:19:36] ....i...............................................................................................
[01:19:47] ........i..ii.......................................................................................
[01:19:59] ....................................................................................................
[01:20:10] ....................................................................................................
[01:20:21] ..........................................................................i.........................
[01:20:33] ....................i...............................................................................
---
[01:21:12] ...........................i........................................................................
[01:21:14] ....................................................................i...............................
[01:21:15] ...............i.......................................................
---
[01:21:36] .............i........................
---
[01:22:11] i...i..ii....i.............ii.........iii......i..i...i...ii..i..i..ii.....
---
[01:22:15] i.......i......................i.......
---
[01:23:05] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[01:23:07] ....ii...
---
[01:33:54] ..................i.................................................................................
[01:36:00] ........i...........................................................................................
---
[01:37:35] ..........FF........................................................................................
[01:37:39] ........................................................................................
[01:37:39] failures:
[01:37:39]
[01:37:39] ---- str::test_str_slicemut_rangetoinclusive_ok stdout ----
[01:37:39]  thread 'str::test_str_slicemut_rangetoinclusive_ok' panicked at 'byte index 4 is not a char boundary; it is inside 'α' (bytes 3..5) of `abcαβγ`', libcore/str/mod.rs:2268:5
---
[01:37:39] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "alloc" "--" "--quiet"
[01:37:39] expected success, got: exit code: 101
[01:37:39]
[01:37:39]
[01:37:39] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:37:39] Build completed unsuccessfully in 0:39:30
[01:37:39] make: *** [check] Error 1
[01:37:39] Makefile:58: recipe for target 'check' failed

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 @TimNN. (Feature Requests)

@pietroalbini
Copy link
Member

Highfive failed to assign a reviewer for this, assigning the same one as the other PR. r? @bluss

@pietroalbini pietroalbini added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 18, 2018
@kennytm kennytm added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 18, 2018
and add one for non-mut slicing since I touched that method too
@nagisa nagisa added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Apr 20, 2018
@alexcrichton
Copy link
Member

@bors: r+ p=1

Thanks @ExpHP and sorry for the delay!

FWIW if you'd like to give similar treatment to all the inclusive range methods here (basically delegate to the other range implementations), that'd be awesome as well!

@bors
Copy link
Contributor

bors commented Apr 21, 2018

📌 Commit 90b361b has been approved by alexcrichton

@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 Apr 21, 2018
@alexcrichton alexcrichton added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Apr 21, 2018
@bors
Copy link
Contributor

bors commented Apr 21, 2018

⌛ Testing commit 90b361b with merge 699eb95...

bors added a commit that referenced this pull request Apr 21, 2018
smaller PR just to fix #50002

I pulled this out of #50010 to make it easier to backport to beta if necessary, considering that inclusive range syntax is stabilizing soon (?).

It fixes a bug in `<str>::index_mut` with `(..=end)` ranges (#50002), which prior to this fix was not only unusable but also UB in the cases where it "worked" (it gave improperly truncated UTF-8).

(not that I can imagine why anybody would *use* `<str>::index_mut`... but I'm not here to judge)
@bors
Copy link
Contributor

bors commented Apr 21, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 699eb95 to master...

@bors bors merged commit 90b361b into rust-lang:master Apr 21, 2018
@ExpHP ExpHP deleted the quick-50002 branch April 21, 2018 21:50
bors added a commit that referenced this pull request Apr 23, 2018
[beta] Another round of backports

This is a backport of:

* #50039
* #50121
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants