Skip to content

Conversation

klutzy
Copy link
Contributor

@klutzy klutzy commented May 10, 2014

LLVM internally uses uint64_t for array size, but the corresponding
C API (LLVMArrayType) uses unsigned int so ths value is truncated.
Therefore rustc generates wrong type for fixed-sized large vector e.g.
[0 x i8] for [0u8, ..(1 << 32)].

This patch adds LLVMRustArrayType function for uint64_t support.

@klutzy
Copy link
Contributor Author

klutzy commented May 11, 2014

1u << 32 triggers #10183 on 32-bit machines. :( I'll add a workaround soon.

@sanxiyn
Copy link
Contributor

sanxiyn commented May 11, 2014

Testing only on 64-bit by #[cfg(target_word_size = "64")] may be appropriate here.

LLVM internally uses `uint64_t` for array size, but the corresponding
C API (`LLVMArrayType`) uses `unsigned int` so ths value is truncated.
Therefore rustc generates wrong type for fixed-sized large vector e.g.
`[0 x i8]` for `[0u8, ..(1 << 32)]`.

This patch adds `LLVMRustArrayType` function for `uint64_t` support.
@klutzy
Copy link
Contributor Author

klutzy commented May 13, 2014

rebased with cfg!(target_word_size = "64").

bors added a commit that referenced this pull request May 14, 2014
Closes #14184 (std: Move the owned module from core to std)
Closes #14183 (Allow blocks in const expressions)
Closes #14176 (Add tests for from_bits.)
Closes #14175 (Replaced ~T by Box<T> in manual)
Closes #14173 (Implements Default trait for BigInt and BigUint)
Closes #14171 (Fix #8391)
Closes #14159 (Clean up unicode code in libstd)
Closes #14126 (docs: Add a not found page)
Closes #14123 (add a line to the example to clarify semantics)
Closes #14106 (Pretty printer improvements)
Closes #14083 (rustllvm: Add LLVMRustArrayType)
Closes #13957 (io: Implement process wait timeouts)
@bors bors closed this in #14187 May 14, 2014
@emberian
Copy link
Contributor

Yet more pain with their mediocre C API :(

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2023
Add more basic issue templates with auto category labeling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants