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

Replace HashMap implementation with SwissTable (as an external crate) #58623

Merged
merged 11 commits into from Apr 24, 2019

Conversation

@Amanieu
Copy link
Contributor

commented Feb 21, 2019

This is the same as #56241 except that it imports hashbrown as an external crate instead of copying the implementation into libstd.

This includes a few API changes (all unstable):

  • try_reserve is added to HashSet.
  • Some trait bounds have been changed in the raw_entry API.
  • search_bucket has been removed from the raw_entry API (doesn't work with SwissTable).
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Feb 21, 2019

r? @nikomatsakis

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

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Feb 21, 2019

r? @nikomatsakis

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

@Amanieu

This comment has been minimized.

Copy link
Contributor Author

commented Feb 21, 2019

@Amanieu Amanieu referenced this pull request Feb 21, 2019

Closed

Replace HashMap implementation with SwissTable #56241

2 of 2 tasks complete
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Feb 21, 2019

The job x86_64-gnu-llvm-6.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:0b7b47fa:start=1550783174954297002,finish=1550783175943995694,duration=989698692
$ 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-6.0
---
[00:01:57] 
######################################################################## 100.0%
[00:01:57] extracting /checkout/obj/build/cache/2019-02-17/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:57]     Updating crates.io index
[00:02:09]     Updating git repository `https://github.com/Amanieu/hashbrown`
[00:02:10]   Downloaded cmake v0.1.35
[00:02:10]   Downloaded lazy_static v0.2.11
[00:02:10]   Downloaded num_cpus v1.10.0
[00:02:10]   Downloaded serde_json v1.0.38
---

[00:04:05] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:06] tidy error: /checkout/src/libstd/collections/hash/map.rs:440: TODO is deprecated; use FIXME
[00:04:07] Dependencies not on the whitelist:
[00:04:07] * autocfg 
[00:04:07] * fuchsia-cprng 
[00:04:07] * rand_os 
[00:04:07] * rdrand 
[00:04:07] * rdrand 
[00:04:07] invalid source: "git+https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0afdac18e6ece8c74f38e5e78e1c68ee17"
[00:04:07] some tidy checks failed
[00:04:07] 
[00:04:07] 
[00:04:07] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:07] 
[00:04:07] 
[00:04:07] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:07] Build completed unsuccessfully in 0:00:48
[00:04:07] Build completed unsuccessfully in 0:00:48
[00:04:07] Makefile:68: recipe for target 'tidy' failed
[00:04:07] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:23336ad2
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Feb 21 21:10:34 UTC 2019

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)

@gnzlbg

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2019

Is this blocked on the review of #56241 ?

@Amanieu Amanieu force-pushed the Amanieu:hashbrown3 branch from 23d4b1f to 98ef879 Feb 22, 2019

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Feb 22, 2019

The job x86_64-gnu-llvm-6.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:00b4c8b5:start=1550836397319031263,finish=1550836695311659100,duration=297992627837
$ 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-6.0
---
[00:02:49] 
######################################################################## 100.0%
[00:02:49] extracting /checkout/obj/build/cache/2019-02-17/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:02:49]     Updating crates.io index
[00:03:24]     Updating git repository `https://github.com/Amanieu/hashbrown`
[00:03:25]   Downloaded petgraph v0.4.13
[00:03:25]   Downloaded serde_derive v1.0.81
[00:03:25]   Downloaded time v0.1.40
[00:03:25]   Downloaded getopts v0.2.17
---
[00:06:00]    Compiling rustc-demangle v0.1.10
[00:06:00]    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:06:04]    Compiling rustc-std-workspace-alloc v1.0.0 (/checkout/src/tools/rustc-std-workspace-alloc)
[00:06:04]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:06:05]    Compiling hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[00:06:22] Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:06:22] travis_fold:end:stage0-std

[00:06:22] travis_time:end:stage0-std:start=1550837029522207392,finish=1550837086562098635,duration=57039891243
---
[00:28:55]    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:28:55]    Compiling rustc-demangle v0.1.10
[00:29:01]    Compiling rustc-std-workspace-alloc v1.0.0 (/checkout/src/tools/rustc-std-workspace-alloc)
[00:29:01]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:29:01]    Compiling hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[00:29:22] Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:29:22] travis_fold:end:stage1-std

[00:29:22] travis_time:end:stage1-std:start=1550838395939538339,finish=1550838467114885749,duration=71175347410
---
[01:05:13]     Checking rustc_asan v0.0.0 (/checkout/src/librustc_asan)
[01:05:13]     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[01:05:13]     Checking rustc_tsan v0.0.0 (/checkout/src/librustc_tsan)
[01:05:13]     Checking rustc_msan v0.0.0 (/checkout/src/librustc_msan)
[01:05:13]     Checking hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[01:05:36]     Finished release [optimized] target(s) in 29.02s
[01:05:36] Documenting stage2 test (x86_64-unknown-linux-gnu)
[01:05:37]     Checking term v0.0.0 (/checkout/src/libterm)
[01:05:37]     Checking getopts v0.2.17
---
[01:11:19] .................................................................................................... 1900/5409
[01:11:23] .................................................................................................... 2000/5409
[01:11:27] ..................................................i................................................. 2100/5409
[01:11:31] .................................................................................................... 2200/5409
[01:11:35] ..................................F................................................................. 2300/5409
[01:11:44] .................................................................................................... 2500/5409
[01:11:48] .................................................................................................... 2600/5409
[01:11:52] .................................................................................................... 2700/5409
[01:11:57] .................................................................................................... 2800/5409
---
[01:13:42] 
[01:13:42] ---- [ui] ui/issues/issue-21763.rs stdout ----
[01:13:42] diff of stderr:
[01:13:42] 
[01:13:42] 4 LL |     foo::<HashMap<Rc<()>, Rc<()>>>();
[01:13:42] 5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
[01:13:42] 6    |
[01:13:42] -    = help: within `std::collections::HashMap<std::rc::Rc<()>, std::rc::Rc<()>>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
[01:13:42] +    = help: within `(std::rc::Rc<()>, std::rc::Rc<()>)`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
[01:13:42] 8    = note: required because it appears within the type `(std::rc::Rc<()>, std::rc::Rc<()>)`
[01:13:42] -    = note: required because it appears within the type `std::marker::PhantomData<(std::rc::Rc<()>, std::rc::Rc<()>)>`
[01:13:42] -    = note: required because it appears within the type `std::collections::hash::table::RawTable<std::rc::Rc<()>, std::rc::Rc<()>>`
[01:13:42] +    = note: required because of the requirements on the impl of `std::marker::Send` for `hashbrown::raw::RawTable<(std::rc::Rc<()>, std::rc::Rc<()>)>`
[01:13:42] +    = note: required because it appears within the type `hashbrown::map::HashMap<std::rc::Rc<()>, std::rc::Rc<()>, std::collections::hash_map::RandomState>`
[01:13:42] 11    = note: required because it appears within the type `std::collections::HashMap<std::rc::Rc<()>, std::rc::Rc<()>>`
[01:13:42] 12 note: required by `foo`
[01:13:42] 
[01:13:42] 
[01:13:42] The actual stderr differed from the expected stderr.
[01:13:42] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21763/issue-21763.stderr
[01:13:42] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21763/issue-21763.stderr
[01:13:42] To update references, rerun the tests and pass the `--bless` flag
[01:13:42] To only update this specific test, also pass `--test-args issues/issue-21763.rs`
[01:13:42] error: 1 errors occurred comparing output.
[01:13:42] status: exit code: 1
[01:13:42] status: exit code: 1
[01:13:42] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-21763.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21763/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21763/auxiliary" "-A" "unused"
[01:13:42] ------------------------------------------
[01:13:42] 
[01:13:42] ------------------------------------------
[01:13:42] stderr:
[01:13:42] stderr:
[01:13:42] ------------------------------------------
[01:13:42] {"message":"`std::rc::Rc<()>` cannot be sent between threads safely","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n    println!(\"{:?}\", foo);\n}\n\nfn main() {\n    // Calling the method is still fine, as i32 implements Debug.\n    some_func(5i32);\n\n    // This would fail to compile now:\n    // struct WithoutDebug;\n    // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-21763.rs","byte_start":162,"byte_end":192,"line_start":9,"line_end":9,"column_start":5,"column_end":35,"is_primary":true,"text":[{"text":"    foo::<HashMap<Rc<()>, Rc<()>>>();","highlight_start":5,"highlight_end":35}],"label":"`std::rc::Rc<()>` cannot be sent between threads safely","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"within `(std::rc::Rc<()>, std::rc::Rc<()>)`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(std::rc::Rc<()>, std::rc::Rc<()>)`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `std::marker::Send` for `hashbrown::raw::RawTable<(std::rc::Rc<()>, std::rc::Rc<()>)>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `hashbrown::map::HashMap<std::rc::Rc<()>, std::rc::Rc<()>, std::collections::hash_map::RandomState>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `std::collections::HashMap<std::rc::Rc<()>, std::rc::Rc<()>>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-21763.rs","byte_start":124,"byte_end":141,"line_start":6,"line_end":6,"column_start":1,"column_end":18,"is_primary":true,"text":[{"text":"fn foo<T: Send>() {}","highlight_start":1,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely\n  --> /checkout/src/test/ui/issues/issue-21763.rs:9:5\n   |\nLL |     foo::<HashMap<Rc<()>, Rc<()>>>();\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely\n   |\n   = help: within `(std::rc::Rc<()>, std::rc::Rc<()>)`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`\n   = note: required because it appears within the type `(std::rc::Rc<()>, std::rc::Rc<()>)`\n   = note: required because of the requirements on the impl of `std::marker::Send` for `hashbrown::raw::RawTable<(std::rc::Rc<()>, std::rc::Rc<()>)>`\n   = note: required because it appears within the type `hashbrown::map::HashMap<std::rc::Rc<()>, std::rc::Rc<()>, std::collections::hash_map::RandomState>`\n   = note: required because it appears within the type `std::collections::HashMap<std::rc::Rc<()>, std::rc::Rc<()>>`\nnote: required by `foo`\n  --> /checkout/src/test/ui/issues/issue-21763.rs:6:1\n   |\nLL | fn foo<T: Send>() {}\n   | ^^^^^^^^^^^^^^^^^\n\n"}
[01:13:42] {"message":"For more information about this error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0277`.\n"}
[01:13:42] 
[01:13:42] ------------------------------------------
[01:13:42] 
---
[01:13:42] 
[01:13:42] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:13:42] 
[01:13:42] 
[01:13:42] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:13:42] 
[01:13:42] 
[01:13:42] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:13:42] Build completed unsuccessfully in 0:04:35
[01:13:42] Build completed unsuccessfully in 0:04:35
[01:13:42] Makefile:48: recipe for target 'check' failed
[01:13:42] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:06b3f925
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Feb 22 13:12:07 UTC 2019
---
travis_time:end:080df13e:start=1550841129040537997,finish=1550841129045782102,duration=5244105
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0ce829d0
$ 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:1b437d90
travis_time:start:1b437d90
$ 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:06c2cfb8
$ 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

commented Feb 22, 2019

The job x86_64-gnu-llvm-6.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:08945f30:start=1550841979055942243,finish=1550842064074396060,duration=85018453817
$ 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-6.0
---
################################################                          67.6%
######################################################################## 100.0%
[00:05:45] extracting /checkout/obj/build/cache/2019-02-17/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:05:45]     Updating crates.io index
[00:05:56]     Updating git repository `https://github.com/Amanieu/hashbrown`
[00:05:58]   Downloaded cmake v0.1.33
[00:05:58]   Downloaded serde_derive v1.0.81
[00:05:58]   Downloaded getopts v0.2.17
[00:05:58]   Downloaded toml v0.4.10
---
[00:08:30]    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:08:30]    Compiling rustc-demangle v0.1.10
[00:08:34]    Compiling rustc-std-workspace-alloc v1.0.0 (/checkout/src/tools/rustc-std-workspace-alloc)
[00:08:34]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:08:34]    Compiling hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[00:08:51] Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:08:51] travis_fold:end:stage0-std

[00:08:51] travis_time:end:stage0-std:start=1550842548305667454,finish=1550842603804697380,duration=55499029926
---
[00:31:10]    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:31:10]    Compiling rustc-demangle v0.1.10
[00:31:15]    Compiling rustc-std-workspace-alloc v1.0.0 (/checkout/src/tools/rustc-std-workspace-alloc)
[00:31:15]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:31:15]    Compiling hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[00:31:36] Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:31:36] travis_fold:end:stage1-std

[00:31:36] travis_time:end:stage1-std:start=1550843900013830045,finish=1550843968736650178,duration=68722820133
---
[01:07:02]     Checking rustc_tsan v0.0.0 (/checkout/src/librustc_tsan)
[01:07:02]     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[01:07:02]     Checking rustc_asan v0.0.0 (/checkout/src/librustc_asan)
[01:07:02]     Checking rustc_msan v0.0.0 (/checkout/src/librustc_msan)
[01:07:02]     Checking hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[01:07:23]     Finished release [optimized] target(s) in 26.61s
[01:07:23] Documenting stage2 test (x86_64-unknown-linux-gnu)
[01:07:24]     Checking getopts v0.2.17
[01:07:24]     Checking proc_macro v0.0.0 (/checkout/src/libproc_macro)
---
[01:12:59] .................................................................................................... 1900/5409
[01:13:02] .................................................................................................... 2000/5409
[01:13:05] ..................................................i................................................. 2100/5409
[01:13:09] .................................................................................................... 2200/5409
[01:13:13] ..................................F................................................................. 2300/5409
[01:13:21] .................................................................................................... 2500/5409
[01:13:25] .................................................................................................... 2600/5409
[01:13:28] .................................................................................................... 2700/5409
[01:13:33] .................................................................................................... 2800/5409
---
[01:15:08] ---- [ui] ui/issues/issue-21763.rs stdout ----
[01:15:08] diff of stderr:
[01:15:08] 
[01:15:08] 6    |
[01:15:08] 7    = help: within `(std::rc::Rc<()>, std::rc::Rc<()>)`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
[01:15:08] 8    = note: required because it appears within the type `(std::rc::Rc<()>, std::rc::Rc<()>)`
[01:15:08] -    = note: required because of the requirements on the impl of `std::marker::Send` for `std::collections::hash::raw::RawTable<(std::rc::Rc<()>, std::rc::Rc<()>)>`
[01:15:08] +    = note: required because of the requirements on the impl of `std::marker::Send` for `hashbrown::raw::RawTable<(std::rc::Rc<()>, std::rc::Rc<()>)>`
[01:15:08] +    = note: required because it appears within the type `hashbrown::map::HashMap<std::rc::Rc<()>, std::rc::Rc<()>, std::collections::hash_map::RandomState>`
[01:15:08] 10    = note: required because it appears within the type `std::collections::HashMap<std::rc::Rc<()>, std::rc::Rc<()>>`
[01:15:08] 11 note: required by `foo`
[01:15:08] 
[01:15:08] 
[01:15:08] The actual stderr differed from the expected stderr.
[01:15:08] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21763/issue-21763.stderr
[01:15:08] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21763/issue-21763.stderr
[01:15:08] To update references, rerun the tests and pass the `--bless` flag
[01:15:08] To only update this specific test, also pass `--test-args issues/issue-21763.rs`
[01:15:08] error: 1 errors occurred comparing output.
[01:15:08] status: exit code: 1
[01:15:08] status: exit code: 1
[01:15:08] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-21763.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21763/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21763/auxiliary" "-A" "unused"
[01:15:08] ------------------------------------------
[01:15:08] 
[01:15:08] ------------------------------------------
[01:15:08] stderr:
[01:15:08] stderr:
[01:15:08] ------------------------------------------
[01:15:08] {"message":"`std::rc::Rc<()>` cannot be sent between threads safely","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n    println!(\"{:?}\", foo);\n}\n\nfn main() {\n    // Calling the method is still fine, as i32 implements Debug.\n    some_func(5i32);\n\n    // This would fail to compile now:\n    // struct WithoutDebug;\n    // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-21763.rs","byte_start":162,"byte_end":192,"line_start":9,"line_end":9,"column_start":5,"column_end":35,"is_primary":true,"text":[{"text":"    foo::<HashMap<Rc<()>, Rc<()>>>();","highlight_start":5,"highlight_end":35}],"label":"`std::rc::Rc<()>` cannot be sent between threads safely","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"within `(std::rc::Rc<()>, std::rc::Rc<()>)`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `(std::rc::Rc<()>, std::rc::Rc<()>)`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `std::marker::Send` for `hashbrown::raw::RawTable<(std::rc::Rc<()>, std::rc::Rc<()>)>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `hashbrown::map::HashMap<std::rc::Rc<()>, std::rc::Rc<()>, std::collections::hash_map::RandomState>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `std::collections::HashMap<std::rc::Rc<()>, std::rc::Rc<()>>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-21763.rs","byte_start":124,"byte_end":141,"line_start":6,"line_end":6,"column_start":1,"column_end":18,"is_primary":true,"text":[{"text":"fn foo<T: Send>() {}","highlight_start":1,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely\n  --> /checkout/src/test/ui/issues/issue-21763.rs:9:5\n   |\nLL |     foo::<HashMap<Rc<()>, Rc<()>>>();\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely\n   |\n   = help: within `(std::rc::Rc<()>, std::rc::Rc<()>)`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`\n   = note: required because it appears within the type `(std::rc::Rc<()>, std::rc::Rc<()>)`\n   = note: required because of the requirements on the impl of `std::marker::Send` for `hashbrown::raw::RawTable<(std::rc::Rc<()>, std::rc::Rc<()>)>`\n   = note: required because it appears within the type `hashbrown::map::HashMap<std::rc::Rc<()>, std::rc::Rc<()>, std::collections::hash_map::RandomState>`\n   = note: required because it appears within the type `std::collections::HashMap<std::rc::Rc<()>, std::rc::Rc<()>>`\nnote: required by `foo`\n  --> /checkout/src/test/ui/issues/issue-21763.rs:6:1\n   |\nLL | fn foo<T: Send>() {}\n   | ^^^^^^^^^^^^^^^^^\n\n"}
[01:15:08] {"message":"For more information about this error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0277`.\n"}
[01:15:08] 
[01:15:08] ------------------------------------------
[01:15:08] 
---
[01:15:08] 
[01:15:08] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:15:08] 
[01:15:08] 
[01:15:08] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:15:08] 
[01:15:08] 
[01:15:08] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:15:08] Build completed unsuccessfully in 0:04:14
[01:15:08] Build completed unsuccessfully in 0:04:14
[01:15:08] make: *** [check] Error 1
[01:15:08] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:044d37da
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Feb 22 14:43:01 UTC 2019
---
travis_time:end:12c8ad82:start=1550846583040003467,finish=1550846583047892883,duration=7889416
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0706f548
$ 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:0a593634
$ 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 Amanieu force-pushed the Amanieu:hashbrown3 branch from b42286f to e08307b Feb 22, 2019

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Feb 22, 2019

The job x86_64-gnu-llvm-6.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:0cf42d8c:start=1550847506732434047,finish=1550847647656849386,duration=140924415339
$ 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-6.0
---
#######################################################################   98.9%
######################################################################## 100.0%
[00:01:29] extracting /checkout/obj/build/cache/2019-02-17/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:29]     Updating crates.io index
[00:01:41]     Updating git repository `https://github.com/Amanieu/hashbrown`
[00:01:42]   Downloaded filetime v0.2.4
[00:01:42]   Downloaded libc v0.2.46
[00:01:42]   Downloaded toml v0.4.10
[00:01:42]   Downloaded serde_derive v1.0.81
---
[00:04:09]    Compiling rustc-demangle v0.1.10
[00:04:10]    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:04:14]    Compiling rustc-std-workspace-alloc v1.0.0 (/checkout/src/tools/rustc-std-workspace-alloc)
[00:04:14]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:04:14]    Compiling hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[00:04:31] Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:04:31] travis_fold:end:stage0-std

[00:04:31] travis_time:end:stage0-std:start=1550847892598802010,finish=1550847947562097407,duration=54963295397
---
[00:26:36]    Compiling rustc-demangle v0.1.10
[00:26:36]    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:26:41]    Compiling rustc-std-workspace-alloc v1.0.0 (/checkout/src/tools/rustc-std-workspace-alloc)
[00:26:41]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:26:41]    Compiling hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[00:27:02] Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:27:02] travis_fold:end:stage1-std

[00:27:02] travis_time:end:stage1-std:start=1550849231240092681,finish=1550849298840313806,duration=67600221125
---
[01:01:48]     Checking rustc_asan v0.0.0 (/checkout/src/librustc_asan)
[01:01:48]     Checking rustc_lsan v0.0.0 (/checkout/src/librustc_lsan)
[01:01:48]     Checking rustc_msan v0.0.0 (/checkout/src/librustc_msan)
[01:01:48]     Checking rustc_tsan v0.0.0 (/checkout/src/librustc_tsan)
[01:01:48]     Checking hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[01:02:07]     Finished release [optimized] target(s) in 24.97s
[01:02:07] Documenting stage2 test (x86_64-unknown-linux-gnu)
[01:02:08]     Checking proc_macro v0.0.0 (/checkout/src/libproc_macro)
[01:02:08]     Checking getopts v0.2.17
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:17:06] 
[01:17:06] running 119 tests
[01:17:31] .iiiii...i.....i..i...i..i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i.i. 100/119
[01:17:35] i......iii.i.....ii
[01:17:35] 
[01:17:35]  finished in 28.736
[01:17:35] travis_fold:end:test_debuginfo

---
[01:32:44] travis_fold:start:test_stage1-std
travis_time:start:test_stage1-std
Testing std stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:32:44]    Compiling std v0.0.0 (/checkout/src/libstd)
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<_, _>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3121 |         let old_raw_cap = m.raw_capacity();
[01:32:50]      |                             ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<_, _>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3122 |         while old_raw_cap == m.raw_capacity() {
[01:32:50]      |                                ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<_, _>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3136 |         assert_eq!(m.raw_capacity(), 1);
[01:32:50]      |                      ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<{integer}, {integer}>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3142 |         let initial_raw_cap = m.raw_capacity();
[01:32:50]      |                                 ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<{integer}, {integer}>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3144 |         let raw_cap = m.raw_capacity();
[01:32:50]      |                         ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<usize, usize>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3156 |         assert_eq!(m.raw_capacity(), raw_cap);
[01:32:50]      |                      ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<usize, usize>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3164 |         let new_raw_cap = m.raw_capacity();
[01:32:50]      |                             ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<usize, usize>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3170 |             assert_eq!(m.raw_capacity(), new_raw_cap);
[01:32:50]      |                          ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<usize, usize>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3174 |         assert_eq!(m.raw_capacity(), raw_cap);
[01:32:50]      |                      ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:50] 
[01:32:50] error[E0599]: no method named `raw_capacity` found for type `collections::hash::map::HashMap<usize, usize>` in the current scope
[01:32:50]      |
[01:32:50]      |
[01:32:50] 205  | pub struct HashMap<K, V, S = RandomState> {
[01:32:50]      | ----------------------------------------- method `raw_capacity` not found for this
[01:32:50] ...
[01:32:50] 3184 |         assert_eq!(m.raw_capacity(), initial_raw_cap);
[01:32:50]      |                      ^^^^^^^^^^^^ help: did you mean: `capacity`
[01:32:56] error: aborting due to 10 previous errors
[01:32:56] 
[01:32:56] For more information about this error, try `rustc --explain E0599`.
[01:32:56] error: Could not compile `std`.
[01:32:56] error: Could not compile `std`.
[01:32:56] 
[01:32:56] To learn more, run the command again with --verbose.
[01:32:56] 
[01:32:56] 
[01:32:56] 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" "std" "--" "--quiet"
[01:32:56] 
[01:32:56] 
[01:32:56] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:32:56] Build completed unsuccessfully in 0:27:25
[01:32:56] Build completed unsuccessfully in 0:27:25
[01:32:56] make: *** [check] Error 1
[01:32:56] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1f97819a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Feb 22 16:34:13 UTC 2019

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 Amanieu force-pushed the Amanieu:hashbrown3 branch from e08307b to 4ba6550 Feb 22, 2019

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Feb 22, 2019

The job x86_64-gnu-llvm-6.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:27256134:start=1550855847061037770,finish=1550855986444044834,duration=139383007064
$ 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-6.0
---
[00:03:52] 
######################################################################## 100.0%
[00:03:53] extracting /checkout/obj/build/cache/2019-02-17/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:03:53]     Updating crates.io index
[00:04:05]     Updating git repository `https://github.com/Amanieu/hashbrown`
[00:04:07]   Downloaded toml v0.4.10
[00:04:07]   Downloaded lazy_static v0.2.11
[00:04:07]   Downloaded petgraph v0.4.13
[00:04:07]   Downloaded cc v1.0.28
---
[00:06:52]    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:06:52]    Compiling rustc-demangle v0.1.10
[00:06:57]    Compiling rustc-std-workspace-alloc v1.0.0 (/checkout/src/tools/rustc-std-workspace-alloc)
[00:06:57]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:06:57]    Compiling hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[00:07:15] Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:07:15] travis_fold:end:stage0-std

[00:07:15] travis_time:end:stage0-std:start=1550856370233384723,finish=1550856431085034599,duration=60851649876
---
[00:31:29]    Compiling panic_abort v0.0.0 (/checkout/src/libpanic_abort)
[00:31:29]    Compiling rustc-demangle v0.1.10
[00:31:35]    Compiling rustc-std-workspace-alloc v1.0.0 (/checkout/src/tools/rustc-std-workspace-alloc)
[00:31:35]    Compiling panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[00:31:35]    Compiling hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[00:31:58] Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
[00:31:58] travis_fold:end:stage1-std

[00:31:58] travis_time:end:stage1-std:start=1550857839309315208,finish=1550857914259204906,duration=74949889698
---
[01:10:11]     Checking rustc_asan v0.0.0 (/checkout/src/librustc_asan)
[01:10:11]     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
[01:10:11]     Checking rustc_lsan v0.0.0 (/checkout/src/librustc_lsan)
[01:10:11]     Checking rustc_tsan v0.0.0 (/checkout/src/librustc_tsan)
[01:10:11]     Checking hashbrown v0.1.8 (https://github.com/Amanieu/hashbrown?branch=libstd#4f1cfb0a)
[01:10:32]     Finished release [optimized] target(s) in 27.93s
[01:10:33] Documenting stage2 test (x86_64-unknown-linux-gnu)
[01:10:33]     Checking term v0.0.0 (/checkout/src/libterm)
[01:10:33]     Checking getopts v0.2.17
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:27:21] 
[01:27:21] running 119 tests
[01:27:50] .iiiii...i.....i..i...i..i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i.i. 100/119
[01:27:55] i......iii.i.....ii
[01:27:55] 
[01:27:55]  finished in 33.860
[01:27:55] travis_fold:end:test_debuginfo

---
[01:47:11] thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
[01:47:11]   left: `1`,
[01:47:11]  right: `2`', src/libstd/collections/hash/map.rs:3152:9
[01:47:11] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:47:11] ..........F......................................................................................... 100/763
[01:47:11] thread '<unnamed>' panicked at 'explicit panic', src/libstd/io/buffered.rs:1290:17
[01:47:11] thread '<unnamed>' panicked at 'explicit panic', src/libstd/io/buffered.rs:1277:9
[01:47:11] thread '<unnamed>' panicked at 'explicit panic', src/libstd/io/stdio.rs:793:13
[01:47:11] .................................................................................................... 300/763
---
[01:47:23] 
[01:47:23] error: test failed, to rerun pass '--lib'
[01:47:23] 
[01:47:23] 
[01:47:23] 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" "std" "--" "--quiet"
[01:47:23] 
[01:47:23] 
[01:47:23] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:47:23] Build completed unsuccessfully in 0:33:11
[01:47:23] Build completed unsuccessfully in 0:33:11
[01:47:23] make: *** [check] Error 1
[01:47:23] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:10327b84
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Feb 22 19:07:20 UTC 2019
---
travis_time:end:189cfc80:start=1550862442226217131,finish=1550862442232160897,duration=5943766
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0dafe3d7
$ 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:05e73a4c
travis_time:start:05e73a4c
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true

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)

@stjepang

This comment has been minimized.

Copy link
Contributor

commented Feb 23, 2019

Can we do a crater run to see if there are any regressions?

@Amanieu

This comment has been minimized.

Copy link
Contributor Author

commented Feb 24, 2019

Is this blocked on the review of #56241 ?

Sort-of. I've been including most of the feedback from that thread into hashbrown itself.

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Feb 25, 2019

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

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Feb 25, 2019

@bors: try

While review progresses let's in parallel start some programmatic analysis! (aka perf runs, crater runs, etc)

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Feb 25, 2019

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout hashbrown3 (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self hashbrown3 --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
warning: Cannot merge binary files: Cargo.lock (HEAD vs. heads/homu-tmp)
Auto-merging src/libstd/lib.rs
Removing src/libstd/collections/hash/table.rs
Auto-merging src/libstd/collections/hash/set.rs
CONFLICT (content): Merge conflict in src/libstd/collections/hash/set.rs
Auto-merging src/libstd/collections/hash/map.rs
CONFLICT (content): Merge conflict in src/libstd/collections/hash/map.rs
Auto-merging Cargo.lock
CONFLICT (content): Merge conflict in Cargo.lock
Automatic merge failed; fix conflicts and then commit the result.

@Amanieu

This comment has been minimized.

Copy link
Contributor Author

commented Feb 25, 2019

This issue should probably be addressed before merging: https://github.com/Amanieu/hashbrown/issues/47

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Feb 25, 2019

@bors: try

@bors

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2019

⌛️ Trying commit 76003ba with merge abade53...

bors added a commit that referenced this pull request Feb 25, 2019

Auto merge of #58623 - Amanieu:hashbrown3, r=<try>
Replace HashMap implementation with SwissTable (as an external crate)

This is the same as #56241 except that it imports `hashbrown` as an external crate instead of copying the implementation into libstd.

This includes a few API changes (all unstable):
- `try_reserve` is added to `HashSet`.
- Some trait bounds have been changed in the `raw_entry` API.
- `search_bucket` has been removed from the `raw_entry` API (doesn't work with SwissTable).
@bors

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2019

💥 Test timed out

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Feb 26, 2019

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

⌛️ Testing commit e7f162f with merge 0928511...

bors added a commit that referenced this pull request Apr 24, 2019

Auto merge of #58623 - Amanieu:hashbrown3, r=alexcrichton
Replace HashMap implementation with SwissTable (as an external crate)

This is the same as #56241 except that it imports `hashbrown` as an external crate instead of copying the implementation into libstd.

This includes a few API changes (all unstable):
- `try_reserve` is added to `HashSet`.
- Some trait bounds have been changed in the `raw_entry` API.
- `search_bucket` has been removed from the `raw_entry` API (doesn't work with SwissTable).
@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

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

@bors bors added the merged-by-bors label Apr 24, 2019

@bors bors merged commit e7f162f into rust-lang:master Apr 24, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details

@Centril Centril added this to the 1.36 milestone Apr 24, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 24, 2019

📣 Toolstate changed by #58623!

Tested on commit 0928511.
Direct link to PR: #58623

💔 miri on windows: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Apr 24, 2019

📣 Toolstate changed by rust-lang/rust#58623!
Tested on commit rust-lang/rust@0928511.
Direct link to PR: <rust-lang/rust#58623>

💔 miri on windows: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
@jhpratt

This comment has been minimized.

Copy link

commented Apr 24, 2019

Now that this has been merged, the hashbrown crate is essentially the same as std, and will provide no further advantages?

@archseer

This comment has been minimized.

Copy link

commented Apr 24, 2019

From what I understand, hashbrown still uses FxHash whereas the stdlib one uses SipHash, meaning that relying on the crate might still give you a bit more performance?

@Amanieu

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

Also:

  • no_std support
  • rayon parallel iterator support
@archseer

This comment has been minimized.

Copy link

commented Apr 24, 2019

@Amanieu might be nice to extract hashbrown's fx.rs into a standalone crate. It's very similar to cbreeden/fxhash but it doesn't depend on byteorder -- it's the only external piece I need now that this PR was merged.

@thomcc

This comment has been minimized.

Copy link

commented Apr 24, 2019

And raw_entry support (and possibly other features that are only available on nightly with the std hashmap)

@Amanieu

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

@archseer The fx.rs implementation was taken from the rustc-hash crate. You should use that.

The only reason I removed the byteorder dependency is because hashbrown can't depend on other crates when it is used in libstd. Why are you trying to avoid the byteorder dependency?

@Kerollmops Kerollmops referenced this pull request Apr 24, 2019

Open

dependency reduction #625

0 of 4 tasks complete
@RalfJung

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

@rust-lang/infra shouldn't it have created an issue for the Miri toolstate failure?

@kennytm

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

@RalfJung "test-fail" won't create an issue since there could be false positive, only "build-fail" would create an issue.

@cuviper cuviper referenced this pull request Apr 25, 2019

Merged

Release 0.5.0, deprecated #25

bors bot added a commit to rayon-rs/rayon-hash that referenced this pull request Apr 25, 2019

Merge #25
25: Release 0.5.0, deprecated r=cuviper a=cuviper

This is the last subtree merge before `hashbrown` replaced the `std` types in rust-lang/rust#58623.

I am also marking this crate deprecated -- folks who want to parallelize these types going forward should use `hashbrown`'s own "rayon" feature.

Co-authored-by: Florian Hartwig <florian.j.hartwig@gmail.com>
Co-authored-by: Meltinglava <meltinglavaoutland@gmail.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: Andy Russell <arussell123@gmail.com>
Co-authored-by: bors <bors@rust-lang.org>
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
Co-authored-by: Steven Fackler <sfackler@gmail.com>
Co-authored-by: John Kåre Alsaker <john.kare.alsaker@gmail.com>
Co-authored-by: Hidehito Yabuuchi <hdht.ybuc@gmail.com>
Co-authored-by: Corey Farwell <coreyf@rwell.org>
Co-authored-by: kennytm <kennytm@gmail.com>
Co-authored-by: Alexander Regueiro <alexreg@me.com>
Co-authored-by: Stein Somers <git@steinsomers.be>
Co-authored-by: Ryan Marcus <ryan@ryanmarc.us>
Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
Co-authored-by: Wiktor Kuchta <wiktorkuchta@protonmail.com>
Co-authored-by: Anthony Ramine <n.oxyde@gmail.com>
Co-authored-by: Scott McMurray <scottmcm@users.noreply.github.com>

SimonSapin added a commit to servo/servo that referenced this pull request Apr 25, 2019

Upgrade to rustc 1.36.0-nightly (e305df184 2019-04-24)
This includes a `size_of` regression for a few DOM types,
due to rust-lang/rust#58623 which replaces the
implementation of `HashMap` in the standard library to Hashbrown.

Although `size_of<HashMap>` grows, it’s not obvious how total memory usage
is going to be impacted: Hashbrown only has one `u8` instead of one `usize`
of overhead per hash table bucket for storing (part of) a hash,
and so might allocate less memory itself.

Hashbrown also typically has better run time performance:
https://github.com/rust-lang/hashbrown#performance

Still, I’ve filed rust-lang/hashbrown#69
about potentially reducing the `size_of<HashMap>` regression.

bors-servo added a commit to servo/servo that referenced this pull request Apr 25, 2019

Auto merge of #23263 - servo:rustup, r=jdm
Upgrade to rustc 1.36.0-nightly (e305df184 2019-04-24)

This includes a `size_of` regression for a few DOM types, due to rust-lang/rust#58623 which replaces the implementation of `HashMap` in the standard library to Hashbrown.

Although `size_of<HashMap>` grows, it’s not obvious how total memory usage is going to be impacted: Hashbrown only has one `u8` instead of one `usize` of overhead per hash table bucket for storing (part of) a hash, and so might allocate less memory itself.

Hashbrown also typically has better run time performance: https://github.com/rust-lang/hashbrown#performance

Still, I’ve filed rust-lang/hashbrown#69 about potentially reducing the `size_of<HashMap>` regression.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23263)
<!-- Reviewable:end -->
= note: required because it appears within the type `std::marker::PhantomData<(std::rc::Rc<()>, std::rc::Rc<()>)>`
= note: required because it appears within the type `std::collections::hash::table::RawTable<std::rc::Rc<()>, std::rc::Rc<()>>`
= note: required because of the requirements on the impl of `std::marker::Send` for `hashbrown::raw::RawTable<(std::rc::Rc<()>, std::rc::Rc<()>)>`
= note: required because it appears within the type `hashbrown::map::HashMap<std::rc::Rc<()>, std::rc::Rc<()>, std::collections::hash_map::RandomState>`

This comment has been minimized.

Copy link
@jethrogb

jethrogb Apr 26, 2019

Contributor

Do I understand from this UI test update that the compiler may "leak" to the user that std::collections::HashMap is actually implemented in the hashbrown crate? I think this might be confusion to users.

This comment has been minimized.

Copy link
@Gankro

Gankro Apr 26, 2019

Contributor

It’s not especially different from the current situation of exposing implementation types like RawTable or BTreeNode

This comment has been minimized.

Copy link
@jethrogb

jethrogb Apr 26, 2019

Contributor

Except those are all types from std itself. So the user might see a private type name but at least they know where it's coming from.

This comment has been minimized.

Copy link
@shepmaster

shepmaster Apr 26, 2019

Member

This kind of thing already caused a lot of confusion with the "simple" issue of re-exporting of core via std. I feel like I haven't seen that problem in a while; is there some existing solution we can use?

This comment has been minimized.

Copy link
@eddyb

eddyb Apr 30, 2019

Member

There is a way to do this reexport that produces a path that starts with std, I just don't know how. There are reexports of core / alloc items in std that handle this correctly.

This comment has been minimized.

Copy link
@Gankro

Gankro Apr 30, 2019

Contributor

std::HashMap isn't a re-export, though. It's a newtype around hashbrown::Hashmap

This comment has been minimized.

Copy link
@eddyb

eddyb May 1, 2019

Member

You could also reexport hashbrown as an "implementation detail" or something, but I don't know if you can get rustc to use std paths in error messages without it being publicly reachable, which we'd want to avoid.

This comment has been minimized.

Copy link
@eddyb

eddyb May 1, 2019

Member

You can also, for this error in particular, have unsafe impl<K: Send, V: Send, S: Send> Send for HashMap<K, V, S> {} but I'm not sure that's a good idea.

This comment has been minimized.

Copy link
@jethrogb

jethrogb May 1, 2019

Contributor

I don't know if you can get rustc to use std paths in error messages without it being publicly reachable, which we'd want to avoid.

What if you re-export them as pub items, but the re-export itself is not actually publicly reachable?

@Restioson

This comment has been minimized.

Copy link

commented Apr 30, 2019

Re: the fxhash crate @archseer. The maintainer seems to be inactive, so no PRs are being reviewed or accepted. Currently it also does not support no_std.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.