Skip to content

Commit

Permalink
Auto merge of rust-lang#2213 - RalfJung:clippy, r=RalfJung
Browse files Browse the repository at this point in the history
make clippy mandatory for bors, and silence another clippy lint

We don't currently trigger this but I saw it in a PR and I'd rather evaluate this on a case-by-case basis during review, thank you clippy.
  • Loading branch information
bors committed Jun 7, 2022
2 parents ba15da4 + 2b35dd5 commit eedc78d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,8 @@ jobs:
- name: Test
run: bash ./ci.sh

fmt:
name: formatting (ignored by bors)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
run: |
rustup toolchain install nightly --component rustfmt
rustup override set nightly
- name: Formatting (miri, ui_test)
run: cargo fmt --all --check
- name: Formatting (cargo-miri)
run: cargo fmt --manifest-path cargo-miri/Cargo.toml --all --check

clippy:
name: clippy (ignored by bors)
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -117,6 +103,20 @@ jobs:
- name: Clippy (cargo-miri)
run: cargo clippy --manifest-path cargo-miri/Cargo.toml --all-targets -- -D warnings

fmt:
name: formatting (ignored by bors)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
run: |
rustup toolchain install nightly --component rustfmt
rustup override set nightly
- name: Formatting (miri, ui_test)
run: cargo fmt --all --check
- name: Formatting (cargo-miri)
run: cargo fmt --manifest-path cargo-miri/Cargo.toml --all --check

# These jobs doesn't actually test anything, but they're only used to tell
# bors the build completed, as there is no practical way to detect when a
# workflow is successful listening to webhooks only.
Expand All @@ -126,15 +126,15 @@ jobs:
end-success:
name: bors build finished
runs-on: ubuntu-latest
needs: [build]
needs: [build, clippy]
if: github.event.pusher.name == 'bors' && success()
steps:
- name: mark the job as a success
run: exit 0
end-failure:
name: bors build finished
runs-on: ubuntu-latest
needs: [build]
needs: [build, clippy]
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
steps:
- name: mark the job as a failure
Expand All @@ -144,7 +144,7 @@ jobs:
cron-fail-notify:
name: cronjob failure notification
runs-on: ubuntu-latest
needs: [build]
needs: [build, clippy]
if: github.event_name == 'schedule' && (failure() || cancelled())
steps:
- name: Install zulip-send
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
clippy::new_without_default,
clippy::single_match,
clippy::useless_format,
clippy::derive_partial_eq_without_eq
clippy::derive_partial_eq_without_eq,
clippy::too_many_arguments
)]

extern crate rustc_apfloat;
Expand Down
6 changes: 4 additions & 2 deletions tests/pass/concurrency/linux-futex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn wait_wake() {

static FUTEX: i32 = 0;

thread::spawn(move || {
let t = thread::spawn(move || {
thread::sleep(Duration::from_millis(200));
unsafe {
assert_eq!(libc::syscall(
Expand All @@ -155,14 +155,15 @@ fn wait_wake() {
}

assert!((200..1000).contains(&start.elapsed().as_millis()));
t.join().unwrap();
}

fn wait_wake_bitset() {
let start = Instant::now();

static FUTEX: i32 = 0;

thread::spawn(move || {
let t = thread::spawn(move || {
thread::sleep(Duration::from_millis(200));
unsafe {
assert_eq!(libc::syscall(
Expand Down Expand Up @@ -202,6 +203,7 @@ fn wait_wake_bitset() {
}

assert!((400..1000).contains(&start.elapsed().as_millis()));
t.join().unwrap();
}

fn main() {
Expand Down

0 comments on commit eedc78d

Please sign in to comment.