Skip to content

Commit 92b12f5

Browse files
author
Chojan Shang
authored
Merge branch 'master' into update-deps
2 parents 61cc058 + 2563283 commit 92b12f5

File tree

23 files changed

+567
-410
lines changed

23 files changed

+567
-410
lines changed

.github/workflows/rust.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- trying.tmp
7+
- staging.tmp
8+
pull_request:
9+
10+
jobs:
11+
miri:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- env:
16+
TARGET: x86_64-unknown-linux-gnu
17+
run: sh ci/miri.sh
18+
19+
rustfmt_clippy:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- env:
24+
TARGET: i586-unknown-linux-gnu
25+
run: sh ci/tools.sh
26+
27+
test:
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions-rs/toolchain@v1
32+
with:
33+
toolchain: ${{ matrix.channel }}
34+
override: true
35+
- env:
36+
TARGET: ${{ matrix.target }}
37+
CHANNEL: ${{ matrix.channel }}
38+
CROSS: ${{ matrix.target != 'x86_64-unknown-linux-gnu' && '1' || '0' }}
39+
NO_STD: ${{ matrix.target == 'thumbv6m-none-eabi' && '1' || '0' }}
40+
run: sh ci/run.sh
41+
strategy:
42+
matrix:
43+
os: [ubuntu-latest]
44+
target: [
45+
x86_64-unknown-linux-gnu,
46+
i686-unknown-linux-gnu,
47+
i586-unknown-linux-gnu,
48+
armv7-unknown-linux-gnueabihf,
49+
aarch64-unknown-linux-gnu,
50+
thumbv6m-none-eabi,
51+
x86_64-pc-windows-gnu,
52+
]
53+
channel: [1.49.0, nightly]
54+
include:
55+
- os: macos-latest
56+
target: x86_64-apple-darwin
57+
channel: nightly
58+
- os: windows-latest
59+
target: x86_64-pc-windows-msvc
60+
channel: nightly
61+
- os: macos-latest
62+
target: x86_64-apple-darwin
63+
channel: 1.49.0
64+
- os: windows-latest
65+
target: x86_64-pc-windows-msvc
66+
channel: 1.49.0
67+
- os: ubuntu-latest
68+
target: x86_64-unknown-linux-gnu
69+
channel: beta
70+
- os: ubuntu-latest
71+
target: x86_64-unknown-linux-gnu
72+
channel: stable
73+
74+
# These jobs doesn't actually test anything, but they're only used to tell
75+
# bors the build completed, as there is no practical way to detect when a
76+
# workflow is successful listening to webhooks only.
77+
#
78+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
79+
80+
end-success:
81+
name: bors build finished
82+
if: github.event.pusher.name == 'bors' && success()
83+
runs-on: ubuntu-latest
84+
needs: [miri, rustfmt_clippy, test]
85+
86+
steps:
87+
- name: Mark the job as successful
88+
run: exit 0
89+
90+
end-failure:
91+
name: bors build finished
92+
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
93+
runs-on: ubuntu-latest
94+
needs: [miri, rustfmt_clippy, test]
95+
96+
steps:
97+
- name: Mark the job as a failure
98+
run: exit 1

.travis.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6-
and this project adheres to [Semantic Versioning](http://semver.org/).
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository = "https://github.com/rust-lang/hashbrown"
88
readme = "README.md"
99
keywords = ["hash", "no_std", "hashmap", "swisstable"]
1010
categories = ["data-structures", "no-std"]
11-
exclude = [".travis.yml", "bors.toml", "/ci/*"]
11+
exclude = [".github", "bors.toml", "/ci/*"]
1212
edition = "2018"
1313

1414
[dependencies]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
hashbrown
22
=========
33

4-
[![Build Status](https://travis-ci.com/rust-lang/hashbrown.svg?branch=master)](https://travis-ci.com/rust-lang/hashbrown)
4+
[![Build Status](https://github.com/rust-lang/hashbrown/actions/workflows/rust.yml/badge.svg)](https://github.com/rust-lang/hashbrown/actions)
55
[![Crates.io](https://img.shields.io/crates/v/hashbrown.svg)](https://crates.io/crates/hashbrown)
66
[![Documentation](https://docs.rs/hashbrown/badge.svg)](https://docs.rs/hashbrown)
77
[![Rust](https://img.shields.io/badge/rust-1.49.0%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/hashbrown)
@@ -114,8 +114,8 @@ this pre-generates seeds at compile time and embeds them as constants. See [aHas
114114

115115
Licensed under either of:
116116

117-
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
118-
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
117+
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
118+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
119119

120120
at your option.
121121

benches/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl Iterator for RandomKeys {
3838
type Item = usize;
3939
fn next(&mut self) -> Option<usize> {
4040
// Add 1 then multiply by some 32 bit prime.
41-
self.state = self.state.wrapping_add(1).wrapping_mul(3787392781);
41+
self.state = self.state.wrapping_add(1).wrapping_mul(3_787_392_781);
4242
Some(self.state)
4343
}
4444
}

ci/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ else
1212
FEATURES="rustc-internal-api,serde,rayon,raw,bumpalo"
1313
OP="test"
1414
fi
15-
if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then
15+
if [ "${CHANNEL}" = "nightly" ]; then
1616
FEATURES="${FEATURES},nightly"
1717
export RUSTFLAGS="$RUSTFLAGS -D warnings"
1818
fi
@@ -36,7 +36,7 @@ fi
3636
"${CARGO}" -vv ${OP} --target="${TARGET}" --release
3737
"${CARGO}" -vv ${OP} --target="${TARGET}" --release --features "${FEATURES}"
3838

39-
if [ "${TRAVIS_RUST_VERSION}" = "nightly" ] && [ "${NO_STD}" != 1 ]; then
39+
if [ "${CHANNEL}" = "nightly" ] && [ "${NO_STD}" != 1 ]; then
4040
# Run benchmark on native targets, build them on non-native ones:
4141
NO_RUN=""
4242
if [ "${CROSS}" = "1" ]; then

ci/tools.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@ if retry rustup component add rustfmt ; then
3030
fi
3131

3232
if retry rustup component add clippy ; then
33-
cargo clippy --all -- -D clippy::pedantic
34-
fi
35-
36-
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
37-
if retry rustup component add clippy ; then
38-
cargo clippy --all --target=i586-unknown-linux-gnu -- -D clippy::all -D clippy::pedantic
39-
fi
33+
cargo clippy --all --tests --features serde,rayon,bumpalo -- -D clippy::all -D clippy::pedantic
34+
cargo clippy --all --tests --features raw -- -D clippy::all -D clippy::pedantic \
35+
-A clippy::missing_safety_doc -A clippy::missing_errors_doc
4036
fi
4137

4238
if command -v shellcheck ; then

src/external_trait_impls/rayon/helpers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use alloc::vec::Vec;
44
use rayon::iter::{IntoParallelIterator, ParallelIterator};
55

66
/// Helper for collecting parallel iterators to an intermediary
7+
#[allow(clippy::linkedlist)] // yes, we need linked list here for efficient appending!
78
pub(super) fn collect<I: IntoParallelIterator>(iter: I) -> (LinkedList<Vec<I::Item>>, usize) {
89
let list = iter
910
.into_par_iter()

src/external_trait_impls/rayon/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ mod test_par_map {
512512
where
513513
H: Hasher,
514514
{
515-
self.k.hash(state)
515+
self.k.hash(state);
516516
}
517517
}
518518

@@ -679,7 +679,7 @@ mod test_par_map {
679679
fn test_values_mut() {
680680
let vec = vec![(1, 1), (2, 2), (3, 3)];
681681
let mut map: HashMap<_, _> = vec.into_par_iter().collect();
682-
map.par_values_mut().for_each(|value| *value = (*value) * 2);
682+
map.par_values_mut().for_each(|value| *value *= 2);
683683
let values: Vec<_> = map.par_values().cloned().collect();
684684
assert_eq!(values.len(), 3);
685685
assert!(values.contains(&2));

0 commit comments

Comments
 (0)