rust-lang / rust-lang/rust-by-example
5.1 results of the Casting chapter are not correct
Open
Nobody has claimed this yet.
- Dominant language
- Handlebars
- Stars
- 8.1k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
cargo version
cargo 1.65.0 (4bc8f24d3 2022-10-20)
on mac m1
-100.0 as u8 is 0
on linux x86_64
-100.0 as u8 is 156
Execution on my mac mini m1 machine prints 0 instead of 156, but my execution on the linux x86_64 machine does return 156.
What caused the different execution results?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/types/cast.md at lines 83–84 and run the example using Cargo 1.65 on macOS M1 and Linux x86_64. Compare the platform-specific output for -100.0 as u8 and determine whether the example or its explanation needs correction so the documented result matches supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100