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

rust compiler bug report #16058

Closed
GuillaumeGomez opened this issue Jul 28, 2014 · 6 comments
Closed

rust compiler bug report #16058

GuillaumeGomez opened this issue Jul 28, 2014 · 6 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@GuillaumeGomez
Copy link
Member

Hey, here is the error :

error: internal compiler error: no type for expr in fcx 0x2b06fe9a8828
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/ast_util.rs:784

stack backtrace:
   1:     0x2b06fc267350 - rt::backtrace::imp::write::ha4acd61ef18a62aeDUp
   2:     0x2b06fc26a640 - failure::on_fail::h147f48194e5619a2Afq
   3:     0x2b06f8237440 - unwind::begin_unwind_inner::h60a9644c6207f9d1iTd
   4:     0x2b06faaa2960 - unwind::begin_unwind::h13234818861632264244
   5:     0x2b06faaa33d0 - diagnostic::Handler::bug::h97c5f2afd408a802uZC
   6:     0x2b06f6c51080 - driver::session::Session::bug::hfbe0fc9221dd7cb1Tfv
   7:     0x2b06f718cea0 - middle::typeck::check::FnCtxt<'a>::expr_ty::h5ef85b9a05ee109bASQ
   8:     0x2b06f7246d00 - middle::typeck::check::check_expr_with_unifier::h4f61cd485703bf82zXR
   9:     0x2b06f7210410 - middle::typeck::check::check_block_with_expected::hbe211d6a0d57169er4T
  10:     0x2b06f720bea0 - middle::typeck::check::check_fn::hcb6a99e34082f902ygP
  11:     0x2b06f720bbc0 - middle::typeck::check::check_bare_fn::h489482049518bcac95O
  12:     0x2b06f7215890 - middle::typeck::check::check_method_body::h90c1356a11d46bd27OP
  13:     0x2b06f7204c80 - middle::typeck::check::check_item::h9391443ec508f3d5CDP
  14:     0x2b06f7206800 - visit::walk_item::h4323661955317677675
  15:     0x2b06f720b9c0 - middle::typeck::check::check_item_types::ha82db9ce640d4abfr5O
  16:     0x2b06f6c3c090 - util::common::time::h2359099069666774330
  17:     0x2b06f7424e10 - middle::typeck::check_crate::h866b1f6ae8937907E1f
  18:     0x2b06f74f7930 - driver::driver::phase_3_run_analysis_passes::h6dcc982b3e00cf90E8t
  19:     0x2b06f74f2950 - driver::driver::compile_input::h67e0103484fb9c9dTUt
  20:     0x2b06f75a1290 - driver::run_compiler::ha05dba9ca20aca52iZw
  21:     0x2b06f75a11a0 - driver::main_args::closure.$x22closure$x22$LP$134272$RP$
  22:     0x2b06f75b4060 - task::TaskBuilder<S>::try_future::closure.$x22closure$x22$LP$135416$RP$
  23:     0x2b06f75b3e40 - task::TaskBuilder<S>::spawn_internal::closure.$x22closure$x22$LP$135393$RP$
  24:     0x2b06f7f9e590 - task::spawn_opts::closure.$x22closure$x22$LP$8187$RP$
  25:     0x2b06f828fc30 - rust_try
  26:     0x2b06f8234750 - unwind::try::h2d0dc9479d15367bnHd
  27:     0x2b06f82344b0 - task::Task::run::h854afb19e4abdac4dSc
  28:     0x2b06f7f9e380 - task::spawn_opts::closure.$x22closure$x22$LP$8133$RP$
  29:     0x2b06f8236510 - thread::thread_start::h2a1fd0502c67d799hfd
  30:     0x2b06fcfed0c0 - start_thread
  31:     0x2b06f86412d9 - __clone
  32:                0x0 - <unknown>

make: *** [rgsl] Error 101

Here is my code :

pub struct GslResult {
    pub val: f64,
    pub err: f64
}

impl GslResult {
    pub fn new() -> GslResult {
        Result {
            val: 0f64,
            err: 0f64
        }
    }
}

Good luck to fix this.

@huonw huonw added the I-ICE label Jul 28, 2014
@errordeveloper
Copy link
Contributor

@GuillaumeGomez can you please update the issue with output of rustc --version? That's just to be sure now and also track this later on.

@luqmana
Copy link
Member

luqmana commented Jul 31, 2014

I get this (with an empty main):

m.rs:8:9: 8:15 error: `Result` does not name a structure [E0071]
m.rs:8         Result {
               ^~~~~~
error: internal compiler error: no type for expr in fcx 0x1095aa1c0
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /Users/Luqman/Develop/mozilla/rust/src/libsyntax/ast_util.rs:784

@GuillaumeGomez, it seems like you accidentally put Result where you meant GslResult, so you can just change that and it should work fine then.

In any case, it seems like we're ICE here even though we've already outputted the right error.

@GuillaumeGomez
Copy link
Member Author

@errordeveloper : Yes of course, here it is but I'm not sure I didn't updated meanwhile :

rustc --version
rustc 0.12.0-pre-nightly (79e9f14ab 2014-07-27 20:51:16 +0000)

@luqmana : At first, I did create a Result struct in a Gsl module but then I removed the Gsl module and change my Result struct To GslResult struct and forgot to modify all the code. So don't worry, I corrected it right after the compiler 'error'.

@errordeveloper
Copy link
Contributor

@GuillaumeGomez well, does it still crash with given 79e9f14 build?

@GuillaumeGomez
Copy link
Member Author

When I update my rust compiler, it gives me this version :

> rustc --version
rustc 0.12.0-pre-nightly (7a25cf3f3 2014-07-30 17:06:18 +0000)

And it still crashes.

But you can check very easily if it works or not with a code like that :

pub struct Whatever {
    pub whatever: int,
}

impl Whatever {
    pub fn new() -> Whatever {
        Result {
            val: 0,
        }
    }
}

@alexcrichton
Copy link
Member

Closed by #16133

bors added a commit to rust-lang-ci/rust that referenced this issue Dec 11, 2023
fix: Smaller spans for unresolved field and method diagnostics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants