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

Replace HashMap implementation with SwissTable #56241

Open
wants to merge 19 commits into
base: master
from

Conversation

@Amanieu
Copy link
Contributor

Amanieu commented Nov 26, 2018

The implementation is from the hashbrown crate.

This is mostly complete, however it is missing 2 features:

  • Adaptive early resizing. -- doesn't seem to be needed
  • try_reserve -- DONE

cc @pietroalbini @Gankro

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Nov 26, 2018

r? @sfackler

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

@pietroalbini

This comment has been minimized.

Copy link
Member

pietroalbini commented Nov 26, 2018

@bors try

cc @rust-lang/infra, this should get a perf run as soon as the try build finishes (it's needed for the second day of impl days at rustfest rome)

bors added a commit that referenced this pull request Nov 26, 2018

Auto merge of #56241 - Amanieu:hashbrown2, r=<try>
WIP: Replace HashMap implementation with SwissTable

The implementation is from the [hashbrown](https://github.com/Amanieu/hashbrown) crate.

This is mostly complete, however it is missing 2 features:
- Adaptive early resizing.
- `try_reserve`

cc @pietroalbini @Gankro
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 26, 2018

⌛️ Trying commit cfd3225 with merge 5aaebb9...

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Nov 26, 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:1529e080:start=1543249255992989136,finish=1543249321851190115,duration=65858200979
$ 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
---
[00:03:36]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:03:40] warning: unused variable: `additional`
[00:03:40]    --> src/libstd/collections/hash/map.rs:412:35
[00:03:40]     |
[00:03:40] 412 |     pub fn try_reserve(&mut self, additional: usize) -> Result<(), CollectionAllocErr> {
[00:03:40]     |                                   ^^^^^^^^^^ help: consider using `_additional` instead
[00:03:40]     = note: #[warn(unused_variables)] on by default
[00:03:40] 
[00:03:52]     Finished release [optimized] target(s) in 45.76s
[00:03:52] Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
[00:18:31]    Compiling core v0.0.0 (/checkout/src/libcore)
[00:18:31]    Compiling unwind v0.0.0 (/checkout/src/libunwind)
[00:18:31]    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
[00:18:36] error[E0432]: unresolved import
[00:18:36]   --> src/libcore/num/dec2flt/rawfp.rs:33:11
[00:18:36]    |
[00:18:36] 33 | use fmt::{Debug, LowerExp};
[00:18:36] 
[00:18:36] error: cannot determine resolution for the derive macro `Debug`
[00:18:36] error: cannot determine resolution for the derive macro `Debug`
[00:18:36]   --> src/libcore/num/dec2flt/rawfp.rs:40:23
[00:18:36]    |
[00:18:36] 40 | #[derive(Copy, Clone, Debug)]
[00:18:36]    |
[00:18:36]    = note: import resolution is stuck, try simplifying macro imports
[00:18:36] 
[00:18:36] 
[00:18:37] error[E0416]: identifier `Acquire` is bound more than once in the same pattern
[00:18:37]      |
[00:18:37]      |
[00:18:37] 2091 |         (Acquire, Acquire) => intrinsics::atomic_cxchg_acq(dst, old, new),
[00:18:37]      |                   ^^^^^^^ used in a pattern more than once
[00:18:37] 
[00:18:37] error[E0416]: identifier `Relaxed` is bound more than once in the same pattern
[00:18:37]      |
[00:18:37]      |
[00:18:37] 2094 |         (Relaxed, Relaxed) => intrinsics::atomic_cxchg_relaxed(dst, old, new),
[00:18:37]      |                   ^^^^^^^ used in a pattern more than once
[00:18:37] 
[00:18:37] error[E0416]: identifier `SeqCst` is bound more than once in the same pattern
[00:18:37]      |
[00:18:37]      |
[00:18:37] 2095 |         (SeqCst, SeqCst) => intrinsics::atomic_cxchg(dst, old, new),
[00:18:37]      |                  ^^^^^^ used in a pattern more than once
[00:18:37] 
[00:18:37] error[E0416]: identifier `Acquire` is bound more than once in the same pattern
[00:18:37]      |
[00:18:37]      |
[00:18:37] 2116 |         (Acquire, Acquire) => intrinsics::atomic_cxchgweak_acq(dst, old, new),
[00:18:37]      |                   ^^^^^^^ used in a pattern more than once
[00:18:37] 
[00:18:37] error[E0416]: identifier `Relaxed` is bound more than once in the same pattern
[00:18:37]      |
[00:18:37]      |
[00:18:37] 2119 |         (Relaxed, Relaxed) => intrinsics::atomic_cxchgweak_relaxed(dst, old, new),
[00:18:37]      |                   ^^^^^^^ used in a pattern more than once
[00:18:37] 
[00:18:37] error[E0416]: identifier `SeqCst` is bound more than once in the same pattern
[00:18:37]      |
[00:18:37]      |
[00:18:37] 2120 |         (SeqCst, SeqCst) => intrinsics::atomic_cxchgweak(dst, old, new),
[00:18:37]      |                  ^^^^^^ used in a pattern more than once
[00:18:37] error: aborting due to 8 previous errors
[00:18:37] 
[00:18:37] Some errors occurred: E0416, E0432.
[00:18:37] For more information about an error, try `rustc --explain E0416`.
[00:18:37] For more information about an error, try `rustc --explain E0416`.
[00:18:37] error: Could not compile `core`.
[00:18:37] warning: build failed, waiting for other jobs to finish...
[00:18:38] error: build failed
[00:18:38] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:18:38] expected success, got: exit code: 101
[00:18:38] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:18:38] Build completed unsuccessfully in 0:15:32
[00:18:38] Makefile:28: recipe for target 'all' failed
[00:18:38] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:04a839fb
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Mon Nov 26 16:40:49 UTC 2018

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

This comment has been minimized.

Copy link
Member

pietroalbini commented Nov 26, 2018

@bors try delegate+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 26, 2018

✌️ @Amanieu can now approve this pull request

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 26, 2018

⌛️ Trying commit 03db6f4 with merge 73919a1...

bors added a commit that referenced this pull request Nov 26, 2018

Auto merge of #56241 - Amanieu:hashbrown2, r=<try>
WIP: Replace HashMap implementation with SwissTable

The implementation is from the [hashbrown](https://github.com/Amanieu/hashbrown) crate.

This is mostly complete, however it is missing 2 features:
- Adaptive early resizing.
- `try_reserve`

cc @pietroalbini @Gankro
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Nov 26, 2018

The job dist-x86_64-linux 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_fold:end:services

travis_fold:start:git.checkout
travis_time:start:1f8f5510
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[00:05:22]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:05:26] warning: unused variable: `additional`
[00:05:26]    --> src/libstd/collections/hash/map.rs:412:35
[00:05:26]     |
[00:05:26] 412 |     pub fn try_reserve(&mut self, additional: usize) -> Result<(), CollectionAllocErr> {
[00:05:26]     |                                   ^^^^^^^^^^ help: consider using `_additional` instead
[00:05:26]     = note: #[warn(unused_variables)] on by default
[00:05:26] 
[00:05:40]     Finished release [optimized] target(s) in 50.48s
[00:05:40] Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
[00:49:56]    Compiling core v0.0.0 (/checkout/src/libcore)
[00:49:56]    Compiling unwind v0.0.0 (/checkout/src/libunwind)
[00:49:56]    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
[00:50:00] error[E0432]: unresolved import
[00:50:00]   --> src/libcore/num/dec2flt/rawfp.rs:33:11
[00:50:00]    |
[00:50:00] 33 | use fmt::{Debug, LowerExp};
[00:50:00] 
[00:50:00] error: cannot determine resolution for the derive macro `Debug`
[00:50:00] error: cannot determine resolution for the derive macro `Debug`
[00:50:00]   --> src/libcore/num/dec2flt/rawfp.rs:40:23
[00:50:00]    |
[00:50:00] 40 | #[derive(Copy, Clone, Debug)]
[00:50:00]    |
[00:50:00]    = note: import resolution is stuck, try simplifying macro imports
[00:50:00] 
[00:50:00] 
[00:50:01] error[E0416]: identifier `Acquire` is bound more than once in the same pattern
[00:50:01]      |
[00:50:01]      |
[00:50:01] 2091 |         (Acquire, Acquire) => intrinsics::atomic_cxchg_acq(dst, old, new),
[00:50:01]      |                   ^^^^^^^ used in a pattern more than once
[00:50:01] 
[00:50:01] error[E0416]: identifier `Relaxed` is bound more than once in the same pattern
[00:50:01]      |
[00:50:01]      |
[00:50:01] 2094 |         (Relaxed, Relaxed) => intrinsics::atomic_cxchg_relaxed(dst, old, new),
[00:50:01]      |                   ^^^^^^^ used in a pattern more than once
[00:50:01] 
[00:50:01] error[E0416]: identifier `SeqCst` is bound more than once in the same pattern
[00:50:01]      |
[00:50:01]      |
[00:50:01] 2095 |         (SeqCst, SeqCst) => intrinsics::atomic_cxchg(dst, old, new),
[00:50:01]      |                  ^^^^^^ used in a pattern more than once
[00:50:01] 
[00:50:01] error[E0416]: identifier `Acquire` is bound more than once in the same pattern
[00:50:01]      |
[00:50:01]      |
[00:50:01] 2116 |         (Acquire, Acquire) => intrinsics::atomic_cxchgweak_acq(dst, old, new),
[00:50:01]      |                   ^^^^^^^ used in a pattern more than once
[00:50:01] 
[00:50:01] error[E0416]: identifier `Relaxed` is bound more than once in the same pattern
[00:50:01]      |
[00:50:01]      |
[00:50:01] 2119 |         (Relaxed, Relaxed) => intrinsics::atomic_cxchgweak_relaxed(dst, old, new),
[00:50:01]      |                   ^^^^^^^ used in a pattern more than once
[00:50:01] 
[00:50:01] error[E0416]: identifier `SeqCst` is bound more than once in the same pattern
[00:50:01]      |
[00:50:01]      |
[00:50:01] 2120 |         (SeqCst, SeqCst) => intrinsics::atomic_cxchgweak(dst, old, new),
[00:50:01]      |                  ^^^^^^ used in a pattern more than once
[00:50:02] error: aborting due to 8 previous errors
[00:50:02] 
[00:50:02] Some errors occurred: E0416, E0432.
[00:50:02] For more information about an error, try `rustc --explain E0416`.
---
travis_time:end:0d9aa0f5:start=1543252380560909682,finish=1543252380570961872,duration=10052190
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:009923ec
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:2056231c
travis_time:start:2056231c
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:14508654
$ dmesg | grep -i kill

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)

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Nov 26, 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:03b58678:start=1543251899547419502,finish=1543251953974008641,duration=54426589139
$ 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
---
[00:19:12]    Compiling core v0.0.0 (/checkout/src/libcore)
[00:19:12]    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
[00:19:12]    Compiling unwind v0.0.0 (/checkout/src/libunwind)
[00:19:17] error[E0432]: unresolved import
[00:19:17]   --> src/libcore/num/dec2flt/rawfp.rs:33:11
[00:19:17]    |
[00:19:17] 33 | use fmt::{Debug, LowerExp};
[00:19:17] 
[00:19:17] error: cannot determine resolution for the derive macro `Debug`
[00:19:17] error: cannot determine resolution for the derive macro `Debug`
[00:19:17]   --> src/libcore/num/dec2flt/rawfp.rs:40:23
[00:19:17]    |
[00:19:17] 40 | #[derive(Copy, Clone, Debug)]
[00:19:17]    |
[00:19:17]    = note: import resolution is stuck, try simplifying macro imports
[00:19:17] 
[00:19:17] 
[00:19:17] error[E0416]: identifier `Acquire` is bound more than once in the same pattern
[00:19:17]      |
[00:19:17]      |
[00:19:17] 2091 |         (Acquire, Acquire) => intrinsics::atomic_cxchg_acq(dst, old, new),
[00:19:17]      |                   ^^^^^^^ used in a pattern more than once
[00:19:17] 
[00:19:17] error[E0416]: identifier `Relaxed` is bound more than once in the same pattern
[00:19:17]      |
[00:19:17]      |
[00:19:17] 2094 |         (Relaxed, Relaxed) => intrinsics::atomic_cxchg_relaxed(dst, old, new),
[00:19:17]      |                   ^^^^^^^ used in a pattern more than once
[00:19:17] 
[00:19:17] error[E0416]: identifier `SeqCst` is bound more than once in the same pattern
[00:19:17]      |
[00:19:17]      |
[00:19:17] 2095 |         (SeqCst, SeqCst) => intrinsics::atomic_cxchg(dst, old, new),
[00:19:17]      |                  ^^^^^^ used in a pattern more than once
[00:19:17] 
[00:19:17] error[E0416]: identifier `Acquire` is bound more than once in the same pattern
[00:19:17]      |
[00:19:17]      |
[00:19:17] 2116 |         (Acquire, Acquire) => intrinsics::atomic_cxchgweak_acq(dst, old, new),
[00:19:17]      |                   ^^^^^^^ used in a pattern more than once
[00:19:17] 
[00:19:17] error[E0416]: identifier `Relaxed` is bound more than once in the same pattern
[00:19:17]      |
[00:19:17]      |
[00:19:17] 2119 |         (Relaxed, Relaxed) => intrinsics::atomic_cxchgweak_relaxed(dst, old, new),
[00:19:17]      |                   ^^^^^^^ used in a pattern more than once
[00:19:17] 
[00:19:17] error[E0416]: identifier `SeqCst` is bound more than once in the same pattern
[00:19:17]      |
[00:19:17] 2120error: aborting due to 8 previous errors
[00:19:19] 
[00:19:19] Some errors occurred: E0416, E0432.
---
[00:19:19] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:19:19] expected success, got: exit code: 101
[00:19:19] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:19:19] Build completed unsuccessfully in 0:15:50
[00:19:19] Makefile:28: recipe for target 'all' failed
[00:19:19] make: *** [all] Error 1
57304 ./obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib
57300 ./obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu
57296 ./obj/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib
56896 ./src/llvm/test/MC

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)

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 26, 2018

💔 Test failed - status-travis

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Nov 26, 2018

The job dist-x86_64-linux 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_fold:end:services

travis_fold:start:git.checkout
travis_time:start:05edbc7a
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[00:47:07]    Compiling core v0.0.0 (/checkout/src/libcore)
[00:47:07]    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
[00:47:07]    Compiling unwind v0.0.0 (/checkout/src/libunwind)
[00:47:10] error[E0432]: unresolved import
[00:47:10]   --> src/libcore/num/dec2flt/rawfp.rs:33:11
[00:47:10]    |
[00:47:10] 33 | use fmt::{Debug, LowerExp};
[00:47:10] 
[00:47:10] error: cannot determine resolution for the derive macro `Debug`
[00:47:10] error: cannot determine resolution for the derive macro `Debug`
[00:47:10]   --> src/libcore/num/dec2flt/rawfp.rs:40:23
[00:47:10]    |
[00:47:10] 40 | #[derive(Copy, Clone, Debug)]
[00:47:10]    |
[00:47:10]    = note: import resolution is stuck, try simplifying macro imports
[00:47:10] 
[00:47:10] 
[00:47:10] error[E0416]: identifier `Acquire` is bound more than once in the same pattern
[00:47:10]      |
[00:47:10]      |
[00:47:10] 2091 |         (Acquire, Acquire) => intrinsics::atomic_cxchg_acq(dst, old, new),
[00:47:10]      |                   ^^^^^^^ used in a pattern more than once
[00:47:10] 
[00:47:10] error[E0416]: identifier `Relaxed` is bound more than once in the same pattern
[00:47:10]      |
[00:47:10]      |
[00:47:10] 2094 |         (Relaxed, Relaxed) => intrinsics::atomic_cxchg_relaxed(dst, old, new),
[00:47:10]      |                   ^^^^^^^ used in a pattern more than once
[00:47:10] 
[00:47:10] error[E0416]: identifier `SeqCst` is bound more than once in the same pattern
[00:47:10]      |
[00:47:10]      |
[00:47:10] 2095 |         (SeqCst, SeqCst) => intrinsics::atomic_cxchg(dst, old, new),
[00:47:10]      |                  ^^^^^^ used in a pattern more than once
[00:47:10] 
[00:47:10] error[E0416]: identifier `Acquire` is bound more than once in the same pattern
[00:47:10]      |
[00:47:10]      |
[00:47:10] 2116 |         (Acquire, Acquire) => intrinsics::atomic_cxchgweak_acq(dst, old, new),
[00:47:10]      |                   ^^^^^^^ used in a pattern more than once
[00:47:10] 
[00:47:10] error[E0416]: identifier `Relaxed` is bound more than once in the same pattern
[00:47:10]      |
[00:47:10]      |
[00:47:10] 2119 |         (Relaxed, Relaxed) => intrinsics::atomic_cxchgweak_relaxed(dst, old, new),
[00:47:10]      |                   ^^^^^^^ used in a pattern more than once
[00:47:10] 
[00:47:10] error[E0416]: identifier `SeqCst` is bound more than once in the same pattern
[00:47:10]      |
[00:47:10]      |
[00:47:10] 2120 |         (SeqCst, SeqCst) => intrinsics::atomic_cxchgweak(dst, old, new),
[00:47:10]      |                  ^^^^^^ used in a pattern more than once
[00:47:11] error: aborting due to 8 previous errors
[00:47:11] 
[00:47:11] Some errors occurred: E0416, E0432.
[00:47:11] For more information about an error, try `rustc --explain E0416`.
---
travis_time:end:0a9aeb56:start=1543254768289710638,finish=1543254768295832212,duration=6121574
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:056e60b6
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:1c0c9ede
travis_time:start:1c0c9ede
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:171ff89d
$ dmesg | grep -i kill

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)

@Amanieu

This comment has been minimized.

Copy link
Contributor

Amanieu commented Nov 27, 2018

It seems that the new HashMap is causing errors in name resolution. However I am not familiar with the code. Could someone point me at the HashMaps that are likely to cause the errors above?

cc @petrochenkov

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Nov 27, 2018

@Amanieu
use fmt::Debug blocks resolution of #[derive(Debug)].
Apparently we can't determine that it doesn't import anything named Debug in macro namespace soon enough.

The workaround is to remove use fmt::Debug; and use fmt::Debug in code.

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Nov 27, 2018

Oh, wait a second, this PR doesn't actually modify rawfp.rs and libcore in general.
That's worse.

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Nov 27, 2018

Did the previous HashMap have any guarantees about "order of elements == order of insertion", or something like that, accidentally?

@Amanieu

This comment has been minimized.

Copy link
Contributor

Amanieu commented Nov 27, 2018

@petrochenkov There are no ordering guarantees in HashMap, so it is very likely that the ordering has changed when the HashMap implementation changed. Is there anything in name resolution that relies on the insertion order?

I am currently trying to narrow down the exact hash map that is causing the issue. I can confirm that switching only librustc_resolve to the new hashmap reproduces this issue (everything else still uses the old hashmap).

Note that it is also possible that there is a bug in the new HashMap.

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Nov 27, 2018

There are no ordering guarantees in HashMap, so it is very likely that the ordering has changed

Fix: order of elements with a hash collision, not the general order.
But that probably doesn't matter because our hash maps cannot be used as multi-maps.

I am currently trying to narrow down the exact hash map that is causing the issue. I can confirm that switching only librustc_resolve to the new hashmap reproduces this issue (everything else still uses the old hashmap).

Yes, it's better to bisect all uses of FxHashMap in rustc_resolve and find out what exact map is responsible, then it will be clearer what happens on the resolve side.

@Amanieu Amanieu force-pushed the Amanieu:hashbrown2 branch from f770977 to ec35c14 Dec 11, 2018

@Amanieu Amanieu force-pushed the Amanieu:hashbrown2 branch from ec35c14 to 3bee3c0 Dec 11, 2018

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 23, 2018

☔️ The latest upstream changes (presumably #57063) made this pull request unmergeable. Please resolve the merge conflicts.

@Gankro

This comment has been minimized.

Copy link
Contributor

Gankro commented Dec 23, 2018

(my review is currently on hold as i deal with some medical issues, sorry)

@stokhos

This comment has been minimized.

Copy link

stokhos commented Jan 14, 2019

Ping from triage @sfackler have you had time to review this pr?

@Amanieu

This comment has been minimized.

Copy link
Contributor

Amanieu commented Jan 14, 2019

@alexcrichton suggested that instead of copying hashbrown into libstd, we could have libstd import hashbrown directly as an extern crate. libstd would then just have an API shim with documentation and stability attributes that wraps the actual implementation in the hashbrown crate.

@TimNN

This comment has been minimized.

Copy link
Contributor

TimNN commented Jan 22, 2019

Ping from triage @Amanieu / @alexcrichton: What are the plans for this PR?

@Gankro

This comment has been minimized.

Copy link
Contributor

Gankro commented Jan 22, 2019

(still on medical leave)

i do not think we should extern hashbrown without the review we would require to merge this code

@gnzlbg

This comment has been minimized.

Copy link
Contributor

gnzlbg commented Jan 23, 2019

I would prefer to:

  • wait for @Gankro's review before changing libstd to use hashbrown,
  • in the mean time,
    • change this PR to add hashbrown as an an external crate since that would allow us to set up some more extensive CI for it, instead of adding that to the CI budget of libstd (e.g. do some fuzzing, etc.). This would mean that @Gankro 's review would need to continue in the hashbrown repo though

    • do a crater run once this PR is green (have we done that already?). I think that for this PR is ok to do a couple of crater runs. One crater run now might uncover issues, and we should definitely do a crater run right before merging after all review comments have been addressed to make sure that none of the fixes broke anything.

@Gankro get well soon and don't stress yourself about the review !

@Amanieu

This comment has been minimized.

Copy link
Contributor

Amanieu commented Jan 23, 2019

I'm going to leave the PR as it is until the review is finished. I will be integrating any feedback back into the hashbrown repo.

@panaman67

This comment has been minimized.

Copy link

panaman67 commented Jan 24, 2019

Really excited for this commit. Great work!

@TimNN TimNN added S-blocked and removed S-waiting-on-author labels Jan 29, 2019

@TimNN

This comment has been minimized.

Copy link
Contributor

TimNN commented Jan 29, 2019

(still on medical leave)

i do not think we should extern hashbrown without the review we would require to merge this code

Thanks for the update!

@Gankro get well soon and don't stress yourself about the review !

Couldn't agree more, get better soon!


I'm marking this as blocked for the moment, so it doesn't show up during the regular PR triage.

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