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

error: internal compiler error: node_id_to_type: no type for node expr A::C (id=61) #13407

Closed
ghost opened this issue Apr 8, 2014 · 2 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@ghost
Copy link

ghost commented Apr 8, 2014

Host OS: Linux Mint 15 x86_64
rustc version: rustc 0.10-pre (6f1c06d 2014-04-03 03:42:02 -0700)

Test case:

use A::B;
pub mod A {
  pub trait B {
    fn new() -> Self;
  }
  pub struct C;
  impl B for C {
    fn new() -> C { C }
  }
}

pub fn test(param: ~A::B) {}

fn main() {
  test(A::C = B::new());
}
@ftxqxd
Copy link
Contributor

ftxqxd commented Jun 7, 2014

Reduced test case (with help from creduce):

mod A {
    struct C;
}
fn main() {
    A::C = 1;
}

@ghost ghost self-assigned this Nov 11, 2014
@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 Nov 28, 2014
@ghost ghost removed the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Dec 12, 2014
@Twisol
Copy link

Twisol commented Jan 4, 2015

Neither example currently causes an ICE:

Reduced:

$ rustc foo.rs
foo.rs:5:5: 5:13 error: illegal left-hand side expression [E0070]
foo.rs:5     A::C = 1;
             ^~~~~~~~
foo.rs:5:12: 5:13 error: mismatched types: expected `A::C`, found `_` (expected struct A::C, found integral variable)
foo.rs:5     A::C = 1;
                    ^
error: aborting due to 2 previous errors

Original (adjusting ~ to Box):

$ rustc foo.rs
foo.rs:15:8: 15:23 error: illegal left-hand side expression [E0070]
foo.rs:15   test(A::C = B::new());
                 ^~~~~~~~~~~~~~~
foo.rs:15:8: 15:23 error: mismatched types: expected `Box<A::B>`, found `()` (expected box, found ())
foo.rs:15   test(A::C = B::new());
                 ^~~~~~~~~~~~~~~
error: aborting due to 2 previous errors

Version info:

$ rustc --verbose --version
rustc 0.13.0-nightly (c6c786671 2015-01-04 00:50:59 +0000)
binary: rustc
commit-hash: c6c786671d692d7b13c2e5c68a53001327b4b125
commit-date: 2015-01-04 00:50:59 +0000
host: x86_64-apple-darwin
release: 0.13.0-nightly

@jdm jdm added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jan 5, 2015
@steveklabnik steveklabnik removed the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 16, 2015
@bors bors closed this as completed in a4fa901 Mar 17, 2015
bors pushed a commit to rust-lang-ci/rust that referenced this issue Sep 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 24, 2024
Fix `if_then_some_else_none` sugg missing closure intro

Fixes rust-lang#13407

rust-lang#13407 works in current stable. The suggestion-generating code got trampled over in 0532104 :-)

changelog: [`if_then_some_else_none`]: Fix missing closure in suggestion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

5 participants