Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meithecatte/fake-static
rustc hates him! Sidestep borrow checking with this weird trick.
https://github.com/meithecatte/fake-static
Last synced: 25 days ago
JSON representation
rustc hates him! Sidestep borrow checking with this weird trick.
- Host: GitHub
- URL: https://github.com/meithecatte/fake-static
- Owner: meithecatte
- Created: 2019-07-27T11:26:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T10:33:53.000Z (over 1 year ago)
- Last Synced: 2024-12-01T12:13:02.098Z (27 days ago)
- Language: Rust
- Size: 1.95 KB
- Stars: 98
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> WARNING: This is a shitpost. If that is not immediately clear to you, and if it
> sounds like something you might want to use, **stop whatever you're doing immediately**
> and go read the [Rustonomicon](https://doc.rust-lang.org/nomicon/) again and again
> until you can recite it backwards while balancing on one leg.rustc hates him! Sidestep borrow checking with this weird trick.
**Note:** This "may" cause undefined behavior. But it's fine, there's no unsafe in sight ;3
```rust
fn main() {
let boom = fake_static::make_static(&vec![0; 1<<20]);
println!("{:?}", boom);
}
```Please don't use this in production. Or anywhere, for that matter. The only purpose of this ~~piece of shit~~ is to bring attention to the relevant issue, which hasn't seen any attention for over a year: https://github.com/rust-lang/rust/issues/25860