fake-static

Crates.iofake-static
lib.rsfake-static
version0.1.0
sourcesrc
created_at2019-07-27 11:28:34.106945
updated_at2019-07-27 11:28:34.106945
descriptionrustc hates him! Sidestep borrow checking with this weird trick (no unsafe inside).
homepage
repositoryhttps://github.com/NieDzejkob/fake-static
max_upload_size
id152035
size2,490
Maja Kądziołka (meithecatte)

documentation

https://docs.rs/fake-static/

README

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.

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

Commit count: 4

cargo fmt