bitcoin-dev-project / bitcoin-dev-project/rust-for-bitcoiners
Mismatched types error in the first example of pointers
- Dominant language
- Rust
- Stars
- 86
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
```
let x: u8 = 1234521; // requires 1 byte(8 bits) to store "x" in memory
let y: &u128 = &x; // In a 64 bit architecture this will require 64 bits to store "y" in memory
let z: &&u128 = &y; // same bits as y
```
I'm not sure if casting x to u128 is the better way...
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the first pointers example containing x, y, and z and reproduce the compiler's mismatched-types error. Determine the intended pointer types and update the example so it compiles, then verify that the memory-size explanation matches the corrected code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100