bitcoin-dev-project / bitcoin-dev-project/rust-for-bitcoiners

Mismatched types error in the first example of pointers

Open
#5 1 comment 0 reactions 0 assignees View on GitHub
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.