Skip to content

Commit 69fcbfd

Browse files
committed
Auto merge of rust-lang#11466 - Alexendoo:ci-32bit, r=flip1995
Fix `i686-unknown-linux-gnu` CI job When testing oli-obk/ui_test#161 I gave `--ignored` a try, I was surprised to see many of the 32bit tests passing even though I'm on a 64bit target Turns out the `.stderr`s were incorrect, and our `i686-unknown-linux-gnu` job has been running `x86_64-unknown-linux-gnu` so it didn't get picked up changelog: none
2 parents 0d36d57 + 60ffff0 commit 69fcbfd

17 files changed

+171
-615
lines changed

.github/workflows/clippy_bors.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,14 @@ jobs:
5252
needs: changelog
5353
strategy:
5454
matrix:
55-
os: [ubuntu-latest, windows-latest, macos-latest]
56-
host: [x86_64-unknown-linux-gnu, i686-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc]
57-
exclude:
55+
include:
5856
- os: ubuntu-latest
59-
host: x86_64-apple-darwin
60-
- os: ubuntu-latest
61-
host: x86_64-pc-windows-msvc
62-
- os: macos-latest
63-
host: x86_64-unknown-linux-gnu
64-
- os: macos-latest
65-
host: i686-unknown-linux-gnu
66-
- os: macos-latest
67-
host: x86_64-pc-windows-msvc
68-
- os: windows-latest
6957
host: x86_64-unknown-linux-gnu
70-
- os: windows-latest
58+
- os: ubuntu-latest
7159
host: i686-unknown-linux-gnu
7260
- os: windows-latest
61+
host: x86_64-pc-windows-msvc
62+
- os: macos-latest
7363
host: x86_64-apple-darwin
7464

7565
runs-on: ${{ matrix.os }}
@@ -84,8 +74,17 @@ jobs:
8474
- name: Checkout
8575
uses: actions/checkout@v3
8676

77+
- name: Install i686 dependencies
78+
if: matrix.host == 'i686-unknown-linux-gnu'
79+
run: |
80+
sudo dpkg --add-architecture i386
81+
sudo apt-get update
82+
sudo apt-get install gcc-multilib zlib1g-dev:i386
83+
8784
- name: Install toolchain
88-
run: rustup show active-toolchain
85+
run: |
86+
rustup set default-host ${{ matrix.host }}
87+
rustup show active-toolchain
8988
9089
# Run
9190
- name: Set LD_LIBRARY_PATH (Linux)
@@ -109,11 +108,11 @@ jobs:
109108
run: cargo build --tests --features deny-warnings,internal
110109

111110
- name: Test
112-
if: runner.os == 'Linux'
111+
if: matrix.host == 'x86_64-unknown-linux-gnu'
113112
run: cargo test --features deny-warnings,internal
114113

115114
- name: Test
116-
if: runner.os != 'Linux'
115+
if: matrix.host != 'x86_64-unknown-linux-gnu'
117116
run: cargo test --features deny-warnings,internal -- --skip dogfood
118117

119118
- name: Test clippy_lints

tests/compile-test.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,16 @@ fn run_ui_cargo() {
289289

290290
let quiet = args.quiet;
291291

292+
let ignored_32bit = |path: &Path| {
293+
// FIXME: for some reason the modules are linted in a different order for this test
294+
cfg!(target_pointer_width = "32") && path.ends_with("tests/ui-cargo/module_style/fail_mod/Cargo.toml")
295+
};
296+
292297
ui_test::run_tests_generic(
293298
vec![config],
294-
|path, config| path.ends_with("Cargo.toml") && ui_test::default_any_file_filter(path, config),
299+
|path, config| {
300+
path.ends_with("Cargo.toml") && ui_test::default_any_file_filter(path, config) && !ignored_32bit(path)
301+
},
295302
|config, path, _file_contents| {
296303
config.out_dir = canonicalize(
297304
std::env::current_dir()

tests/ui/cast_size_32bit.stderr renamed to tests/ui/cast_size.32bit.stderr

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: casting `isize` to `i8` may truncate the value
2-
--> $DIR/cast_size_32bit.rs:12:5
2+
--> $DIR/cast_size.rs:15:5
33
|
44
LL | 1isize as i8;
55
| ^^^^^^^^^^^^
@@ -12,33 +12,33 @@ LL | i8::try_from(1isize);
1212
| ~~~~~~~~~~~~~~~~~~~~
1313

1414
error: casting `isize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`isize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
15-
--> $DIR/cast_size_32bit.rs:15:5
15+
--> $DIR/cast_size.rs:18:5
1616
|
1717
LL | x0 as f64;
1818
| ^^^^^^^^^
1919
|
2020
= note: `-D clippy::cast-precision-loss` implied by `-D warnings`
2121

2222
error: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
23-
--> $DIR/cast_size_32bit.rs:16:5
23+
--> $DIR/cast_size.rs:19:5
2424
|
2525
LL | x1 as f64;
2626
| ^^^^^^^^^
2727

2828
error: casting `isize` to `f32` causes a loss of precision (`isize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide)
29-
--> $DIR/cast_size_32bit.rs:17:5
29+
--> $DIR/cast_size.rs:20:5
3030
|
3131
LL | x0 as f32;
3232
| ^^^^^^^^^
3333

3434
error: casting `usize` to `f32` causes a loss of precision (`usize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide)
35-
--> $DIR/cast_size_32bit.rs:18:5
35+
--> $DIR/cast_size.rs:21:5
3636
|
3737
LL | x1 as f32;
3838
| ^^^^^^^^^
3939

4040
error: casting `isize` to `i32` may truncate the value on targets with 64-bit wide pointers
41-
--> $DIR/cast_size_32bit.rs:19:5
41+
--> $DIR/cast_size.rs:22:5
4242
|
4343
LL | 1isize as i32;
4444
| ^^^^^^^^^^^^^
@@ -50,7 +50,7 @@ LL | i32::try_from(1isize);
5050
| ~~~~~~~~~~~~~~~~~~~~~
5151

5252
error: casting `isize` to `u32` may truncate the value on targets with 64-bit wide pointers
53-
--> $DIR/cast_size_32bit.rs:20:5
53+
--> $DIR/cast_size.rs:23:5
5454
|
5555
LL | 1isize as u32;
5656
| ^^^^^^^^^^^^^
@@ -62,7 +62,7 @@ LL | u32::try_from(1isize);
6262
| ~~~~~~~~~~~~~~~~~~~~~
6363

6464
error: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
65-
--> $DIR/cast_size_32bit.rs:21:5
65+
--> $DIR/cast_size.rs:24:5
6666
|
6767
LL | 1usize as u32;
6868
| ^^^^^^^^^^^^^
@@ -74,7 +74,7 @@ LL | u32::try_from(1usize);
7474
| ~~~~~~~~~~~~~~~~~~~~~
7575

7676
error: casting `usize` to `i32` may truncate the value on targets with 64-bit wide pointers
77-
--> $DIR/cast_size_32bit.rs:22:5
77+
--> $DIR/cast_size.rs:25:5
7878
|
7979
LL | 1usize as i32;
8080
| ^^^^^^^^^^^^^
@@ -86,15 +86,15 @@ LL | i32::try_from(1usize);
8686
| ~~~~~~~~~~~~~~~~~~~~~
8787

8888
error: casting `usize` to `i32` may wrap around the value on targets with 32-bit wide pointers
89-
--> $DIR/cast_size_32bit.rs:22:5
89+
--> $DIR/cast_size.rs:25:5
9090
|
9191
LL | 1usize as i32;
9292
| ^^^^^^^^^^^^^
9393
|
9494
= note: `-D clippy::cast-possible-wrap` implied by `-D warnings`
9595

9696
error: casting `i64` to `isize` may truncate the value on targets with 32-bit wide pointers
97-
--> $DIR/cast_size_32bit.rs:24:5
97+
--> $DIR/cast_size.rs:26:5
9898
|
9999
LL | 1i64 as isize;
100100
| ^^^^^^^^^^^^^
@@ -106,7 +106,7 @@ LL | isize::try_from(1i64);
106106
| ~~~~~~~~~~~~~~~~~~~~~
107107

108108
error: casting `i64` to `usize` may truncate the value on targets with 32-bit wide pointers
109-
--> $DIR/cast_size_32bit.rs:25:5
109+
--> $DIR/cast_size.rs:27:5
110110
|
111111
LL | 1i64 as usize;
112112
| ^^^^^^^^^^^^^
@@ -118,7 +118,7 @@ LL | usize::try_from(1i64);
118118
| ~~~~~~~~~~~~~~~~~~~~~
119119

120120
error: casting `u64` to `isize` may truncate the value on targets with 32-bit wide pointers
121-
--> $DIR/cast_size_32bit.rs:26:5
121+
--> $DIR/cast_size.rs:28:5
122122
|
123123
LL | 1u64 as isize;
124124
| ^^^^^^^^^^^^^
@@ -130,13 +130,13 @@ LL | isize::try_from(1u64);
130130
| ~~~~~~~~~~~~~~~~~~~~~
131131

132132
error: casting `u64` to `isize` may wrap around the value on targets with 64-bit wide pointers
133-
--> $DIR/cast_size_32bit.rs:26:5
133+
--> $DIR/cast_size.rs:28:5
134134
|
135135
LL | 1u64 as isize;
136136
| ^^^^^^^^^^^^^
137137

138138
error: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers
139-
--> $DIR/cast_size_32bit.rs:27:5
139+
--> $DIR/cast_size.rs:29:5
140140
|
141141
LL | 1u64 as usize;
142142
| ^^^^^^^^^^^^^
@@ -148,24 +148,31 @@ LL | usize::try_from(1u64);
148148
| ~~~~~~~~~~~~~~~~~~~~~
149149

150150
error: casting `u32` to `isize` may wrap around the value on targets with 32-bit wide pointers
151-
--> $DIR/cast_size_32bit.rs:28:5
151+
--> $DIR/cast_size.rs:30:5
152152
|
153153
LL | 1u32 as isize;
154154
| ^^^^^^^^^^^^^
155155

156156
error: casting `i32` to `f32` causes a loss of precision (`i32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide)
157-
--> $DIR/cast_size_32bit.rs:33:5
157+
--> $DIR/cast_size.rs:35:5
158158
|
159159
LL | 999_999_999 as f32;
160160
| ^^^^^^^^^^^^^^^^^^
161161

162-
error: casting integer literal to `f64` is unnecessary
163-
--> $DIR/cast_size_32bit.rs:34:5
162+
error: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
163+
--> $DIR/cast_size.rs:36:5
164+
|
165+
LL | 9_999_999_999_999_999usize as f64;
166+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167+
168+
error: literal out of range for `usize`
169+
--> $DIR/cast_size.rs:36:5
164170
|
165-
LL | 3_999_999_999usize as f64;
166-
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `3_999_999_999_f64`
171+
LL | 9_999_999_999_999_999usize as f64;
172+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
167173
|
168-
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
174+
= note: the literal `9_999_999_999_999_999usize` does not fit into the type `usize` whose range is `0..=4294967295`
175+
= note: `#[deny(overflowing_literals)]` on by default
169176

170-
error: aborting due to 18 previous errors
177+
error: aborting due to 19 previous errors
171178

tests/ui/cast_size.stderr renamed to tests/ui/cast_size.64bit.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: casting `isize` to `i8` may truncate the value
2-
--> $DIR/cast_size.rs:12:5
2+
--> $DIR/cast_size.rs:15:5
33
|
44
LL | 1isize as i8;
55
| ^^^^^^^^^^^^
@@ -12,7 +12,7 @@ LL | i8::try_from(1isize);
1212
| ~~~~~~~~~~~~~~~~~~~~
1313

1414
error: casting `isize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`isize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
15-
--> $DIR/cast_size.rs:16:5
15+
--> $DIR/cast_size.rs:18:5
1616
|
1717
LL | x0 as f64;
1818
| ^^^^^^^^^
@@ -26,19 +26,19 @@ LL | x1 as f64;
2626
| ^^^^^^^^^
2727

2828
error: casting `isize` to `f32` causes a loss of precision (`isize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide)
29-
--> $DIR/cast_size.rs:21:5
29+
--> $DIR/cast_size.rs:20:5
3030
|
3131
LL | x0 as f32;
3232
| ^^^^^^^^^
3333

3434
error: casting `usize` to `f32` causes a loss of precision (`usize` is 32 or 64 bits wide, but `f32`'s mantissa is only 23 bits wide)
35-
--> $DIR/cast_size.rs:23:5
35+
--> $DIR/cast_size.rs:21:5
3636
|
3737
LL | x1 as f32;
3838
| ^^^^^^^^^
3939

4040
error: casting `isize` to `i32` may truncate the value on targets with 64-bit wide pointers
41-
--> $DIR/cast_size.rs:25:5
41+
--> $DIR/cast_size.rs:22:5
4242
|
4343
LL | 1isize as i32;
4444
| ^^^^^^^^^^^^^
@@ -50,7 +50,7 @@ LL | i32::try_from(1isize);
5050
| ~~~~~~~~~~~~~~~~~~~~~
5151

5252
error: casting `isize` to `u32` may truncate the value on targets with 64-bit wide pointers
53-
--> $DIR/cast_size.rs:27:5
53+
--> $DIR/cast_size.rs:23:5
5454
|
5555
LL | 1isize as u32;
5656
| ^^^^^^^^^^^^^
@@ -62,7 +62,7 @@ LL | u32::try_from(1isize);
6262
| ~~~~~~~~~~~~~~~~~~~~~
6363

6464
error: casting `usize` to `u32` may truncate the value on targets with 64-bit wide pointers
65-
--> $DIR/cast_size.rs:29:5
65+
--> $DIR/cast_size.rs:24:5
6666
|
6767
LL | 1usize as u32;
6868
| ^^^^^^^^^^^^^
@@ -74,7 +74,7 @@ LL | u32::try_from(1usize);
7474
| ~~~~~~~~~~~~~~~~~~~~~
7575

7676
error: casting `usize` to `i32` may truncate the value on targets with 64-bit wide pointers
77-
--> $DIR/cast_size.rs:31:5
77+
--> $DIR/cast_size.rs:25:5
7878
|
7979
LL | 1usize as i32;
8080
| ^^^^^^^^^^^^^
@@ -86,15 +86,15 @@ LL | i32::try_from(1usize);
8686
| ~~~~~~~~~~~~~~~~~~~~~
8787

8888
error: casting `usize` to `i32` may wrap around the value on targets with 32-bit wide pointers
89-
--> $DIR/cast_size.rs:31:5
89+
--> $DIR/cast_size.rs:25:5
9090
|
9191
LL | 1usize as i32;
9292
| ^^^^^^^^^^^^^
9393
|
9494
= note: `-D clippy::cast-possible-wrap` implied by `-D warnings`
9595

9696
error: casting `i64` to `isize` may truncate the value on targets with 32-bit wide pointers
97-
--> $DIR/cast_size.rs:36:5
97+
--> $DIR/cast_size.rs:26:5
9898
|
9999
LL | 1i64 as isize;
100100
| ^^^^^^^^^^^^^
@@ -106,7 +106,7 @@ LL | isize::try_from(1i64);
106106
| ~~~~~~~~~~~~~~~~~~~~~
107107

108108
error: casting `i64` to `usize` may truncate the value on targets with 32-bit wide pointers
109-
--> $DIR/cast_size.rs:38:5
109+
--> $DIR/cast_size.rs:27:5
110110
|
111111
LL | 1i64 as usize;
112112
| ^^^^^^^^^^^^^
@@ -118,7 +118,7 @@ LL | usize::try_from(1i64);
118118
| ~~~~~~~~~~~~~~~~~~~~~
119119

120120
error: casting `u64` to `isize` may truncate the value on targets with 32-bit wide pointers
121-
--> $DIR/cast_size.rs:40:5
121+
--> $DIR/cast_size.rs:28:5
122122
|
123123
LL | 1u64 as isize;
124124
| ^^^^^^^^^^^^^
@@ -130,13 +130,13 @@ LL | isize::try_from(1u64);
130130
| ~~~~~~~~~~~~~~~~~~~~~
131131

132132
error: casting `u64` to `isize` may wrap around the value on targets with 64-bit wide pointers
133-
--> $DIR/cast_size.rs:40:5
133+
--> $DIR/cast_size.rs:28:5
134134
|
135135
LL | 1u64 as isize;
136136
| ^^^^^^^^^^^^^
137137

138138
error: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers
139-
--> $DIR/cast_size.rs:43:5
139+
--> $DIR/cast_size.rs:29:5
140140
|
141141
LL | 1u64 as usize;
142142
| ^^^^^^^^^^^^^
@@ -148,19 +148,19 @@ LL | usize::try_from(1u64);
148148
| ~~~~~~~~~~~~~~~~~~~~~
149149

150150
error: casting `u32` to `isize` may wrap around the value on targets with 32-bit wide pointers
151-
--> $DIR/cast_size.rs:45:5
151+
--> $DIR/cast_size.rs:30:5
152152
|
153153
LL | 1u32 as isize;
154154
| ^^^^^^^^^^^^^
155155

156156
error: casting `i32` to `f32` causes a loss of precision (`i32` is 32 bits wide, but `f32`'s mantissa is only 23 bits wide)
157-
--> $DIR/cast_size.rs:51:5
157+
--> $DIR/cast_size.rs:35:5
158158
|
159159
LL | 999_999_999 as f32;
160160
| ^^^^^^^^^^^^^^^^^^
161161

162162
error: casting `usize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`usize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
163-
--> $DIR/cast_size.rs:53:5
163+
--> $DIR/cast_size.rs:36:5
164164
|
165165
LL | 9_999_999_999_999_999usize as f64;
166166
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)