Skip to content

rustc hates him! Sidestep borrow checking with this weird trick.

Notifications You must be signed in to change notification settings

meithecatte/fake-static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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

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: rust-lang/rust#25860

About

rustc hates him! Sidestep borrow checking with this weird trick.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages