├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md └── src ├── lib.rs └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "rustyroulette" 7 | version = "0.1.0" 8 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rustyroulette" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rustyroulette 2 | 3 | A pretty simple library I wrote for my reddit cake day, which I intend of publishing on r/rustjerk. 4 | 5 | ## Features 6 | 7 | - 6 different ways of doing pretty felonious things in Rust 8 | - selected at random!! 9 | 10 | These include: 11 | 12 | 1. a simple segmentation fault 13 | 2. a stack overflow 14 | 3. a memory leak 15 | 4. lots and lots of panics 16 | 5. a compiler stack overflow 17 | 6. unwrapping a present (results in a massive panic due to the shock of being gifted nothing) 18 | 19 | ## What did I learn from this? 20 | 21 | Actually, this project wasn't completely useless (although it is). 22 | I've learned quite about how to trick the compiler, messed a bit w/ unsafe code etc. 23 | Also, I leared how good the rust compiler actually is. I had to search for quite some time to get some of my shenanigans to work when compiling in release mode. 24 | The optimizations are really good! 25 | 26 | ## Usage 27 | 28 | Just clone this repo and compile it. 29 | 30 | ```bash 31 | cargo run [-r] 32 | ``` 33 | 34 | In order to see the compiler overflow, you need to uncomment line 66, and recompile. 35 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use rustyroulette::spin_and_shoot; 2 | 3 | fn main() { 4 | spin_and_shoot(); 5 | } --------------------------------------------------------------------------------