Commit 73e7207
committed
Fix ui constant tests for big-endian platforms
A number of tests under ui/const-ptr and ui/consts are currently
failing on big-endian platforms as the binary encoding of some
constants is hard-coded in the stderr test files. Fix this by
providing a normalize-stderr-test rule that strips out the
raw bytes hex dump, so the comparison can be done in an
endianness-independent manner. Note that in most cases, this
means the tests are now also independent of word size, so the
32bit and 64bit cases can be re-unified.
To keep tests that verify the details of those raw bytes dumps,
a new test case raw-bytes.rs performs the tests where the hex
dumps were stripped out a second time, but only on little-
endian platforms.
In addition, src/test/ui/const-ptr/forbidden_slices.rs exposes
an endian-specific difference in this diagnostic output:
constructing invalid value at .<deref>[0]: encountered 0x11,
but expected a boolean
depending on which byte of D0 is not a boolean value (0 or 1).
Fixed this by choosing a value of D0 that differs from 0 or 1
in all bytes.
Fixes part of rust-lang#105383.1 parent 2d8651a commit 73e7207
File tree
30 files changed
+1716
-1130
lines changed- src/test/ui
- const-ptr
- consts
- const-eval
- std
30 files changed
+1716
-1130
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
0 commit comments