Skip to content

Compiler panic on function shadowing #22468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ekelly opened this issue Feb 17, 2015 · 2 comments · Fixed by #24980
Closed

Compiler panic on function shadowing #22468

ekelly opened this issue Feb 17, 2015 · 2 comments · Fixed by #24980
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ekelly
Copy link

ekelly commented Feb 17, 2015

Compiler expects function, finds &str. This causes a compiler panic when attempting to compile.

fn main() {
    let train = "foo";
    let x = train("hello");
}

fn train(file: &str) -> bool {
    true
}
@huonw
Copy link
Member

huonw commented Feb 18, 2015

What version of the compiler do you have (rustc -V)?

Playpen (rustc 1.0.0-nightly (b63cee4a1 2015-02-14 17:01:11 +0000)) doesn't ICE:

<anon>:3:13: 3:27 error: expected function, found `&str`
<anon>:3     let x = train("hello");
                     ^~~~~~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101

@kmcallister kmcallister added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-resolve Area: Name/path resolution done by `rustc_resolve` specifically labels Feb 18, 2015
@ekelly
Copy link
Author

ekelly commented Feb 18, 2015

rustc 1.0.0-alpha (44a287e 2015-01-08 17:03:40 -0800)

On Feb 17, 2015 7:38 PM, "Huon Wilson" notifications@github.com wrote:

What version of the compiler do you have (rustc -V)?

Playpen https://play.rust-lang.org/ (rustc 1.0.0-nightly (b63cee4
2015-02-14 17:01:11 +0000)) doesn't ICE:

:3:13: 3:27 error: expected function, found &str
:3 let x = train("hello");
^~~~~~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101


Reply to this email directly or view it on GitHub
#22468 (comment).

@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 3, 2015
jooert added a commit to jooert/rust that referenced this issue Apr 30, 2015
Manishearth added a commit to Manishearth/rust that referenced this issue May 1, 2015
bors added a commit that referenced this issue May 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants