Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New swatch code fails to compile on 32-bit machine #13264

Open
peter9477 opened this issue Apr 3, 2025 · 5 comments
Open

New swatch code fails to compile on 32-bit machine #13264

peter9477 opened this issue Apr 3, 2025 · 5 comments
Labels
C-bug Category: This is a bug

Comments

@peter9477
Copy link

peter9477 commented Apr 3, 2025

Summary

This code works only if usize is 64 bit:

Highlight(usize::from_ne_bytes([

On 32-bit you get this error:

   Compiling helix-view v25.1.1 (/home/trakcom/helix/helix-view)
error[E0308]: mismatched types
    --> helix-view/src/theme.rs:310:40
     |
310  |           Highlight(usize::from_ne_bytes([
     |  ___________________--------------------_^
     | |                   |
     | |                   arguments to this function are incorrect
311  | |             b,
312  | |             g,
313  | |             r,
...    |
318  | |             u8::MAX,
319  | |         ]))
     | |_________^ expected an array with a fixed size of 4 elements, found one with 8 elements
     |
note: associated function defined here
    --> /home/trakcom/.rustup/toolchains/1.76.0-armv7-unknown-linux-gnueabihf/lib/rustlib/src/rust/library/core/src/num/mod.rs:1244:5
     |
1244 | /     uint_impl! {
1245 | |         Self = usize,
1246 | |         ActualT = u32,
1247 | |         SignedT = isize,
...    |
1261 | |         bound_condition = " on 32-bit targets",
1262 | |     }
     | |_____^
     = note: this error originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info)


### Helix log

_No response_

### Platform

any

### Terminal Emulator

any

### Installation Method

source

### Helix Version

0ee58500
@peter9477 peter9477 added the C-bug Category: This is a bug label Apr 3, 2025
@RoloEdits
Copy link
Contributor

Related: #13188

Mentioned specifically by @archseer here

@peter9477
Copy link
Author

Given that this code is still covered by a PR (and the issue is noted there), I guess making this issue was a mistake? If that's true feel free to close. I didn't think to check PRs before adding it (because I'm a noob here).

@RoloEdits
Copy link
Contributor

Its fine, when that gets merged it will just close this issue👍

@nik-rev
Copy link
Contributor

nik-rev commented Apr 4, 2025

I feel like we should have a test for a 32-bit machine? CI should've failed for this ideally

@RoloEdits
Copy link
Contributor

Github doesnt offer 32bit CI runners as a standard offering: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants