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

Add example of using the indexing operator to HashMap docs #55519

Open
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
8 participants
@fhartwig
Contributor

fhartwig commented Oct 30, 2018

Fixes #52575

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Oct 30, 2018

r? @Kimundi

(rust_highfive has picked a reviewer for you, use r? to override)

@TimNN

This comment has been minimized.

Contributor

TimNN commented Nov 13, 2018

Ping from triage @Kimundi / @rust-lang/docs: This PR requires your review.

@fhartwig: #52575 mentions that the docs should also state that the HashMap can't be updated using the index notation, do you think you could include that.

@TimNN

This comment has been minimized.

Contributor

TimNN commented Nov 27, 2018

Ping from triage @fhartwig: it looks like some changes have been requested to this PR.

@TimNN

This comment has been minimized.

Contributor

TimNN commented Dec 4, 2018

Ping from triage @fhartwig: It looks like your PR needs to be updated.

@frewsxcv

This comment has been minimized.

Member

frewsxcv commented Dec 4, 2018

I just pushed a commit w/ my suggestion, hope that's okay @fhartwig! Thanks for your contribution!

@bors r+ rollup

@bors

This comment has been minimized.

Contributor

bors commented Dec 4, 2018

📌 Commit 4bddb76 has been approved by frewsxcv

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 4, 2018

The job x86_64-gnu-llvm-5.0 of 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.
travis_time:end:2e195da0:start=1543953065982088445,finish=1543953138489016061,duration=72506927616
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:54:54] 
[00:54:54] running 120 tests
[00:54:57] i..ii...iii...iiii....i...i..........i..iii.............i.....i.....ii...i..i.ii..............i...ii 100/120
[00:54:57] ..ii.i.....iiii.....
[00:54:57] 
[00:54:57]  finished in 3.374
[00:54:57] travis_fold:end:test_codegen

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:55:11] 
[00:55:11] running 118 tests
[00:55:34] .iiiii...i.....i..i...i..i.i..i.i..i.....i..i....i..........iiii.........i.i....i...i.......ii.i.i.i 100/118
[00:55:38] ......iii.i.....ii
[00:55:38] 
[00:55:38]  finished in 26.892
[00:55:38] travis_fold:end:test_debuginfo

---
[01:04:36] error: no global memory allocator found but one is required; link to std or add #[global_allocator] to a static item that implements the GlobalAlloc trait.
[01:04:36] 
[01:04:36] 
[01:04:36] running 408 tests
[01:04:53] .............................................F...................................................... 100/408
[01:05:16] .................................................................................................... 300/408
[01:05:27] .................................................................................................... 400/408
' failed
' failed
[01:05:28] make: *** [check] Error 1
58684 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/release/deps
56896 ./src/llvm/test/MC
56108 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/release/build
55740 ./obj/build/x86_64-unknown-linux-gnu/test/run-pass/proc-macro
---
travis_time:end:2d0bca8d:start=1543957078483039607,finish=1543957078486971550,duration=3931943
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:122cfb59
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/

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)

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 4, 2018

Rollup merge of rust-lang#55519 - fhartwig:hashmap-index-example, r=f…
…rewsxcv

Add example of using the indexing operator to HashMap docs

Fixes rust-lang#52575

bors added a commit that referenced this pull request Dec 4, 2018

Auto merge of #56521 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 15 pull requests

Successful merges:

 - #51753 (Document `From` implementations)
 - #55519 (Add example of using the indexing operator to HashMap docs)
 - #55563 (Improve no result found sentence in doc search)
 - #55987 (Add Weak.ptr_eq)
 - #56119 (Utilize `?` instead of `return None`.)
 - #56332 ([rustdoc] Specific crate search)
 - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs)
 - #56388 (More MIR borrow check cleanup)
 - #56424 (Mention raw-ident syntax)
 - #56452 (Remove redundant clones)
 - #56456 (Handle existential types in dead code analysis)
 - #56466 (data_structures: remove tuple_slice)
 - #56476 (Fix invalid line number match)
 - #56497 (cleanup: remove static lifetimes from consts in libstd)
 - #56498 (Fix line numbers display)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Dec 5, 2018

Auto merge of #56521 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 15 pull requests

Successful merges:

 - #51753 (Document `From` implementations)
 - #55519 (Add example of using the indexing operator to HashMap docs)
 - #55563 (Improve no result found sentence in doc search)
 - #55987 (Add Weak.ptr_eq)
 - #56119 (Utilize `?` instead of `return None`.)
 - #56332 ([rustdoc] Specific crate search)
 - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs)
 - #56388 (More MIR borrow check cleanup)
 - #56424 (Mention raw-ident syntax)
 - #56452 (Remove redundant clones)
 - #56456 (Handle existential types in dead code analysis)
 - #56466 (data_structures: remove tuple_slice)
 - #56476 (Fix invalid line number match)
 - #56497 (cleanup: remove static lifetimes from consts in libstd)
 - #56498 (Fix line numbers display)

Failed merges:

r? @ghost
@GuillaumeGomez

This comment has been minimized.

Member

GuillaumeGomez commented Dec 5, 2018

@bors: r-

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 5, 2018

The job x86_64-gnu-llvm-5.0 of 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.
travis_time:end:0e0cc0ac:start=1544027612572084932,finish=1544027675108760406,duration=62536675474
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:57:56] 
[00:57:56] running 120 tests
[00:57:59] i..ii...iii..iiii.....i...i..........i..iii.............i.....i.....ii...i..i.ii..............i...ii 100/120
[00:58:00] ..ii.i.....iiii.....
[00:58:00] 
[00:58:00]  finished in 3.525
[00:58:00] travis_fold:end:test_codegen

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:58:16] 
[00:58:16] running 118 tests
[00:58:40] .iiiii...i.....i..i...i..i.i..i.i..i.....i..i....i..........iiii.........i.i....i...i.......ii.i.i.i 100/118
[00:58:44] ......iii.i.....ii
[00:58:44] 
[00:58:44]  finished in 28.661
[00:58:44] travis_fold:end:test_debuginfo

---
[01:08:16] error: no global memory allocator found but one is required; link to std or add #[global_allocator] to a static item that implements the GlobalAlloc trait.
[01:08:16] 
[01:08:16] 
[01:08:16] running 408 tests
[01:08:34] ...............................................F.................................................... 100/408
[01:09:02] .................................................................................................... 300/408
[01:09:14] .................................................................................................... 400/408
[01:09:15] ........
[01:09:15] failures:
[01:09:15] failures:
[01:09:15] 
[01:09:15] ---- collections/btree/map.rs - collections::btree::map::BTreeMap (line 69) stdout ----
[01:09:15] thread 'collections/btree/map.rs - collections::btree::map::BTreeMap (line 69)' panicked at 'test executable failed:
[01:09:15] We've got 4 reviews, but Les Misérables ain't one.
[01:09:15] Up! is unreviewed.
[01:09:15] Office Space: Deals with real issues in the workplace.
[01:09:15] 
[01:09:15] thread 'main' panicked at 'no entry found for key', src/libcore/option.rs:1008:5
[01:09:15] 
[01:09:15] ', src/librustdoc/test.rs:358:17
[01:09:15] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:09:15] 
---
[01:09:15] 
[01:09:15] error: test failed, to rerun pass '--doc'
[01:09:15] 
[01:09:15] 
[01:09:15] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "alloc" "--" "--quiet"
[01:09:15] 
[01:09:15] 
[01:09:15] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:09:15] Build completed unsuccessfully in 0:22:26
[01:09:15] Build completed unsuccessfully in 0:22:26
[01:09:15] make: *** [check] Error 1
[01:09:15] Makefile:58: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:021cc3f0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Dec  5 17:44:00 UTC 2018
---
travis_time:end:020925b6:start=1544031842064199093,finish=1544031842070011407,duration=5812314
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:08b40f82
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment