stedolan / counterexamples

Counterexamples in Type Systems
http://counterexamples.org
372 stars 23 forks source link

Eventually, nothing: Rust crush fixed #11

Closed WaffleLapkin closed 3 years ago

WaffleLapkin commented 3 years ago

With the update of LLVM 12, rust doesn't crush with an endless loop anymore. E.g.: this example from Eventually, nothing now hangs without problems:

fn main() {
    enum Empty {}

    fn bottom() -> Empty { loop {} }
    fn elim<T>(v : Empty) -> T { match v {} }

    let s: &str = elim(bottom());
    println!("string: {}", s);
}

[playground]

Note however that LLVM still has some bugs related to infinite loops/recursions, see for example https://github.com/rust-lang/rust/issues/85742.