Skip to content

Commit eedc78d

Browse files
committed
Auto merge of rust-lang#2213 - RalfJung:clippy, r=RalfJung
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.
2 parents ba15da4 + 2b35dd5 commit eedc78d

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

.github/workflows/ci.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,8 @@ jobs:
8686
- name: Test
8787
run: bash ./ci.sh
8888

89-
fmt:
90-
name: formatting (ignored by bors)
91-
runs-on: ubuntu-latest
92-
steps:
93-
- uses: actions/checkout@v3
94-
- name: Install latest nightly
95-
run: |
96-
rustup toolchain install nightly --component rustfmt
97-
rustup override set nightly
98-
- name: Formatting (miri, ui_test)
99-
run: cargo fmt --all --check
100-
- name: Formatting (cargo-miri)
101-
run: cargo fmt --manifest-path cargo-miri/Cargo.toml --all --check
102-
10389
clippy:
104-
name: clippy (ignored by bors)
90+
name: clippy
10591
runs-on: ubuntu-latest
10692
steps:
10793
- uses: actions/checkout@v3
@@ -117,6 +103,20 @@ jobs:
117103
- name: Clippy (cargo-miri)
118104
run: cargo clippy --manifest-path cargo-miri/Cargo.toml --all-targets -- -D warnings
119105

106+
fmt:
107+
name: formatting (ignored by bors)
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v3
111+
- name: Install latest nightly
112+
run: |
113+
rustup toolchain install nightly --component rustfmt
114+
rustup override set nightly
115+
- name: Formatting (miri, ui_test)
116+
run: cargo fmt --all --check
117+
- name: Formatting (cargo-miri)
118+
run: cargo fmt --manifest-path cargo-miri/Cargo.toml --all --check
119+
120120
# These jobs doesn't actually test anything, but they're only used to tell
121121
# bors the build completed, as there is no practical way to detect when a
122122
# workflow is successful listening to webhooks only.
@@ -126,15 +126,15 @@ jobs:
126126
end-success:
127127
name: bors build finished
128128
runs-on: ubuntu-latest
129-
needs: [build]
129+
needs: [build, clippy]
130130
if: github.event.pusher.name == 'bors' && success()
131131
steps:
132132
- name: mark the job as a success
133133
run: exit 0
134134
end-failure:
135135
name: bors build finished
136136
runs-on: ubuntu-latest
137-
needs: [build]
137+
needs: [build, clippy]
138138
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
139139
steps:
140140
- name: mark the job as a failure
@@ -144,7 +144,7 @@ jobs:
144144
cron-fail-notify:
145145
name: cronjob failure notification
146146
runs-on: ubuntu-latest
147-
needs: [build]
147+
needs: [build, clippy]
148148
if: github.event_name == 'schedule' && (failure() || cancelled())
149149
steps:
150150
- name: Install zulip-send

src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
clippy::new_without_default,
1717
clippy::single_match,
1818
clippy::useless_format,
19-
clippy::derive_partial_eq_without_eq
19+
clippy::derive_partial_eq_without_eq,
20+
clippy::too_many_arguments
2021
)]
2122

2223
extern crate rustc_apfloat;

tests/pass/concurrency/linux-futex.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn wait_wake() {
132132

133133
static FUTEX: i32 = 0;
134134

135-
thread::spawn(move || {
135+
let t = thread::spawn(move || {
136136
thread::sleep(Duration::from_millis(200));
137137
unsafe {
138138
assert_eq!(libc::syscall(
@@ -155,14 +155,15 @@ fn wait_wake() {
155155
}
156156

157157
assert!((200..1000).contains(&start.elapsed().as_millis()));
158+
t.join().unwrap();
158159
}
159160

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

163164
static FUTEX: i32 = 0;
164165

165-
thread::spawn(move || {
166+
let t = thread::spawn(move || {
166167
thread::sleep(Duration::from_millis(200));
167168
unsafe {
168169
assert_eq!(libc::syscall(
@@ -202,6 +203,7 @@ fn wait_wake_bitset() {
202203
}
203204

204205
assert!((400..1000).contains(&start.elapsed().as_millis()));
206+
t.join().unwrap();
205207
}
206208

207209
fn main() {

0 commit comments

Comments
 (0)