Skip to content

ICE with save-analysis #43785

New issue

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

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

Already on GitHub? # to your account

Closed
Bobo1239 opened this issue Aug 10, 2017 · 3 comments
Closed

ICE with save-analysis #43785

Bobo1239 opened this issue Aug 10, 2017 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Bobo1239
Copy link
Contributor

(maybe) related: rust-lang/rls#160; #39450
Not really sure what is happening here. Wanted to try out rls but it's panicking. The relevant crate is https://github.com/DanielKeep/rust-conv.

$ RUST_BACKTRACE=1 RUSTFLAGS=-Zsave-analysis cargo check
   Compiling conv v0.3.3
error: internal compiler error: /checkout/src/librustc_save_analysis/span_utils.rs:231: Mis-counted brackets when breaking path? Parsing 'NegOverflow => "conversion resulted in negative overflow",
            PosOverflow => "conversion resulted in positive overflow",
            Unrepresentable => "could not convert unrepresentable value",
        ),
        FromName(Unrepresentable),
        FromName(NegOverflow),
        FromName(PosOverflow),
        FromRemap(RangeError(NegOverflow, PosOverflow))
    )]
    pub enum GeneralError' in /home/bobo1239/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/conv-0.3.3/src/errors.rs, line 237
   --> /home/bobo1239/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/conv-0.3.3/src/errors.rs:237:13
    |
237 | /             NegOverflow => "conversion resulted in negative overflow",
238 | |             PosOverflow => "conversion resulted in positive overflow",
239 | |             Unrepresentable => "could not convert unrepresentable value",
240 | |         ),
...   |
245 | |     )]
246 | |     pub enum GeneralError<T> {
    | |_________________________^

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.21.0-nightly (f14249953 2017-08-09) running on x86_64-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:434:8
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:380
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:390
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:610
   5: std::panicking::begin_panic
   6: rustc::session::opt_span_bug_fmt::{{closure}}
   7: rustc::session::span_bug_fmt
   8: rustc_save_analysis::span_utils::SpanUtils::spans_with_brackets
   9: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O>>::process_path_prefixes
  10: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O>>::write_sub_paths_truncated
  11: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O>>::process_path
  12: syntax::visit::walk_pat
  13: syntax::visit::walk_expr
  14: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_expr
  15: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_expr
  16: syntax::visit::walk_expr
  17: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_expr
  18: syntax::visit::walk_expr
  19: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_expr
  20: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_expr
  21: syntax::visit::walk_expr
  22: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_expr
  23: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O>>::process_method_call
  24: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_expr
  25: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O>>::process_method
  26: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O>>::process_impl_item
  27: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_item
  28: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_item
  29: <rustc_save_analysis::dump_visitor::DumpVisitor<'l, 'tcx, 'll, O> as syntax::visit::Visitor<'l>>::visit_mod
  30: <rustc_save_analysis::DumpHandler<'a> as rustc_save_analysis::SaveHandler>::save
  31: <rustc_driver::RustcDefaultCalls as rustc_driver::CompilerCalls<'a>>::build_controller::{{closure}}::{{closure}}
  32: <rustc_driver::RustcDefaultCalls as rustc_driver::CompilerCalls<'a>>::build_controller::{{closure}}
  33: rustc_driver::driver::compile_input::{{closure}}
  34: rustc::ty::context::TyCtxt::create_and_enter
  35: rustc_driver::driver::compile_input
  36: rustc_driver::run_compiler

error: Could not compile `conv`.

To learn more, run the command again with --verbose.
@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 10, 2017
@Mark-Simulacrum
Copy link
Member

cc @nrc

@kennytm
Copy link
Member

kennytm commented Aug 13, 2017

Since this ICE involves spans_with_brackets which will be removed in #43826, please check what will happen after that nightly is released.

(Testing it locally with the new branch doesn't produce ICE, but I can't guarantee the spans are correct.)

@Bobo1239
Copy link
Contributor Author

The ICE is fixed and rls seems to work with the conv crate (as far as non-macro code is concerned).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

3 participants