https://github.com/timelessnesses/rust-parser-weird-thing
https://github.com/timelessnesses/rust-parser-weird-thing
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/timelessnesses/rust-parser-weird-thing
- Owner: timelessnesses
- Created: 2024-07-18T16:16:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-18T16:32:15.000Z (almost 2 years ago)
- Last Synced: 2025-01-01T15:42:31.102Z (over 1 year ago)
- Language: Rust
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust's compiler bug thing?
Apparently the boundary checks for slice size is not checked under a circumstances for some reasons. If you try to run the code without removing commented out codes you will get error of `out of bounds` error, Rust does support compile time checks for any panic out of bound when accessing slices. But if your slice is in under a Tuple Struct which is returned by a function, the compiler won't check it for you. You can try remove comments and see that the `built_for_this` function doesn't get printed as error when try to compile the code.