thepowersgang / mrustc

Alternative rust compiler (re-implementation)
MIT License
2.18k stars 109 forks source link

Compilation Error: Failed to find IntoIterator implementation for `core-0_0_0` #317

Closed iamanonymouscs closed 1 year ago

iamanonymouscs commented 1 year ago

I encountered an error while compiling a Rust program using mrustc. The code and error message is as follows

Code

fn main() {
    let arr = [0; 10];
    for i in arr {
        println!("{}", i)
    }
}

Error Output

:0:0 error:0:Failed to find an impl of ::"core-0_0_0"::iter::traits::IntoIterator for [_/*36:i*/; 10]
Aborted (core dumped)

However, the code can be compiled successfilly by rustc(stable 1.72).

thepowersgang commented 1 year ago

mrustc only supports up to rust 1.54.0, and then only when explicitly asked to build it. The default is (for legacy reasons) 1.29

Look at the build-1.54.0.sh script for the commands to build for a more recent version.

iamanonymouscs commented 1 year ago

Thank you for your reply😃. I find the code failed to be compiled by rustc-1.29🤣