Skip to content
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

ICE "no type for node..." #44869

Closed
lexxvir opened this issue Sep 26, 2017 · 3 comments
Closed

ICE "no type for node..." #44869

lexxvir opened this issue Sep 26, 2017 · 3 comments
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lexxvir
Copy link

lexxvir commented Sep 26, 2017

The compiler unexpectedly panicked on wrong code.

Reduced version of code:

fn main() {
    bug("", "");
}

fn bug<'a>(v1: &mut'a str, v2: &mut'a str) {
    let _ = v1.chars();
    let _ = v2.split('.').map(|p| p.parse::<u64>());
    
    std::mem::swap(v1, v2);
}

Output:

error: expected type, found `'a`
 --> src/main.rs:5:20
  |
5 | fn bug<'a>(v1: &mut'a str, v2: &mut'a str) {
  |                    ^^

error: expected type, found `'a`
 --> src/main.rs:5:36
  |
5 | fn bug<'a>(v1: &mut'a str, v2: &mut'a str) {
  |                                    ^^

error[E0425]: cannot find value `v1` in this scope
 --> src/main.rs:6:13
  |
6 |     let _ = v1.chars();
  |             ^^ not found in this scope

error[E0425]: cannot find value `v2` in this scope
 --> src/main.rs:7:13
  |
7 |     let _ = v2.split('.').map(|p| p.parse::<u64>());
  |             ^^ not found in this scope

error[E0425]: cannot find value `v1` in this scope
 --> src/main.rs:9:20
  |
9 |     std::mem::swap(v1, v2);
  |                    ^^ not found in this scope

error[E0425]: cannot find value `v2` in this scope
 --> src/main.rs:9:24
  |
9 |     std::mem::swap(v1, v2);
  |                        ^^ not found in this scope

error: internal compiler error: /checkout/src/librustc_typeck/check/mod.rs:2015: no type for node 33: type u64 (id=33) in fcx 0x7f53da9f2000

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.22.0-nightly (6c476ce46 2017-09-25) running on x86_64-unknown-linux-gnu

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:492:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Meta

rustc 1.22.0-nightly (6c476ce 2017-09-25)
Link to playground

@TimNN TimNN added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 27, 2017
@TimNN
Copy link
Contributor

TimNN commented Sep 27, 2017

Likely related to ##44814.

@nikomatsakis
Copy link
Contributor

triage: P-high

Assigning to @petrochenkov as the theory is that is same cause as #44814, which is believed to be due to #44633.

@petrochenkov
Copy link
Contributor

This is an exact duplicate of #44814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants