Skip to content

Struct as method ICE #20714

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
andrewyli opened this issue Jan 7, 2015 · 0 comments
Closed

Struct as method ICE #20714

andrewyli opened this issue Jan 7, 2015 · 0 comments
Labels
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

@andrewyli
Copy link
Contributor

struct G;
fn main() {
    let g = G();
}

results in

RUST_BACKTRACE=1 rustc derp.rs
derp.rs:3:13: 3:16 error: expected function, found `G`
derp.rs:3     let g = G();
                      ^~~
derp.rs:3:13: 3:14 error: internal compiler error: unexpected callee type G
derp.rs:3     let g = G();
                      ^
note: the compiler unexpectedly panicked. 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
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:123

stack backtrace:
   1:     0x7f08db5c52d0 - sys::backtrace::write::h8532e701ef86014f4it
   2:     0x7f08db5eab00 - failure::on_fail::h7532e1f79d134d5dzvz
   3:     0x7f08db5501c0 - rt::unwind::begin_unwind_inner::h97b151606151d62deaz
   4:     0x7f08d63ffc60 - rt::unwind::begin_unwind::h15809447133099964284
   5:     0x7f08d63ffbf0 - diagnostic::SpanHandler::span_bug::he8142ababcc30c39DFF
   6:     0x7f08d956b230 - session::Session::span_bug::h57171ee4a68318521qq
   7:     0x7f08dabe36f0 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h9199988789662482206
   8:     0x7f08dabe3200 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_block::h5221501447364338274
   9:     0x7f08dabdab00 - check::upvar::AdjustBorrowKind<'a, 'tcx>::analyze_fn::h19f586a28eb33d19TUh
  10:     0x7f08dac46b40 - check::check_bare_fn::h592fda8aa741d710Qtj
  11:     0x7f08dac3e170 - check::check_item::h9827005a9cde6421CMj
  12:     0x7f08daddefe0 - check_crate::unboxed_closure.40162
  13:     0x7f08dadd9c30 - check_crate::h19fb6dea5733566ajsx
  14:     0x7f08dbb16640 - driver::phase_3_run_analysis_passes::h46b1604d9f9f5633Tva
  15:     0x7f08dbb04ae0 - driver::compile_input::h68b8602933aad8d7wba
  16:     0x7f08dbbcfeb0 - thunk::F.Invoke<A, R>::invoke::h18029802347644288836
  17:     0x7f08dbbcec60 - rt::unwind::try::try_fn::h6518866316425934196
  18:     0x7f08db651400 - rust_try_inner
  19:     0x7f08db6513f0 - rust_try
  20:     0x7f08dbbcefb0 - thunk::F.Invoke<A, R>::invoke::h15513809553472565307
  21:     0x7f08db5d6e40 - sys::thread::thread_start::h5ea7ba97235331d5a9v
  22:     0x7f08d5c23ea0 - start_thread
  23:     0x7f08db1f4999 - __clone
  24:                0x0 - <unknown>


Compilation exited abnormally with code 101 at Wed Jan  7 16:21:51

I think it should just result in the first error if fixed. Hopefully not duplicate.

Thanks.

@nrc nrc added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 8, 2015
barosl added a commit to barosl/rust that referenced this issue Jan 20, 2015
If a type that cannot be called as a function is called, and the result
is assigned to a variable, the "unexpected callee type" ICE occurs.

Fixes rust-lang#20714.
Fixes rust-lang#20842.
Fixes rust-lang#20862.
@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 Mar 4, 2015
@bors bors closed this as completed in ef34364 Mar 17, 2015
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. 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.

2 participants