Skip to content

ICE E0431.rs with -Zsave-analysis #73020

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
matthiaskrgr opened this issue Jun 5, 2020 · 5 comments · Fixed by #73046
Closed

ICE E0431.rs with -Zsave-analysis #73020

matthiaskrgr opened this issue Jun 5, 2020 · 5 comments · Fixed by #73046
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. 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

@matthiaskrgr
Copy link
Member

Code

code from ./src/test/ui/error-codes/E0431.rs

use {self}; //~ ERROR E0431

fn main () {
}

Meta

repo is @ 219380d

Error output

build/x86_64-unknown-linux-gnu/stage2/bin/rustc ./src/test/ui/error-codes/E0431.rs -Zsave-analysis

thread 'rustc' panicked at 'index 18446744073709551615 out of range for slice of length 0', src/librustc_save_analysis/dump_visitor.rs:213:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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

error[E0431]: `self` import can only appear in an import list with a non-empty prefix
 --> ./src/test/ui/error-codes/E0431.rs:1:6
  |
1 | use {self}; //~ ERROR E0431
  |      ^^^^ can only appear in an import list with a non-empty prefix

warning: unused import: `self`
 --> ./src/test/ui/error-codes/E0431.rs:1:6
  |
1 | use {self}; //~ ERROR E0431
  |      ^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

thread 'rustc' panicked at 'index 18446744073709551615 out of range for slice of length 0', src/librustc_save_analysis/dump_visitor.rs:213:21
stack backtrace:
   0:     0x7f4ba27b0d57 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he2fbf5405bd3f46a
   1:     0x7f4ba27fda3d - core::fmt::write::h65255e7874586eb2
   2:     0x7f4ba2781b95 - std::io::Write::write_fmt::h3c49d63e356d89fe
   3:     0x7f4ba278d980 - std::panicking::default_hook::{{closure}}::h6b88f05100c9e449
   4:     0x7f4ba278d694 - std::panicking::default_hook::h57a663a807afe943
   5:     0x7f4ba41458a3 - rustc_driver::report_ice::h34c4499908ba0b29
   6:     0x7f4ba278e06c - std::panicking::rust_panic_with_hook::haef04471b94d420c
   7:     0x7f4ba278dc3b - rust_begin_unwind
   8:     0x7f4ba27fb7e1 - core::panicking::panic_fmt::h95ae6ee01add471a
   9:     0x7f4ba27f9f12 - core::slice::slice_index_len_fail::h0017b5f53e111206
  10:     0x7f4ba424f418 - rustc_save_analysis::dump_visitor::DumpVisitor::process_path::h64d45cc6b7fee451
  11:     0x7f4ba4251011 - rustc_save_analysis::dump_visitor::DumpVisitor::process_crate::h3af551472fa9ad7e
  12:     0x7f4ba4120f98 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h230cde404218eeb4
  13:     0x7f4ba41be03e - rustc_session::utils::<impl rustc_session::session::Session>::time::ha57d20269542213a
  14:     0x7f4ba41318eb - rustc_middle::ty::context::tls::enter_global::h5e4aceeb2c5d9074
  15:     0x7f4ba41538e7 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h46a369817e38d2d4
  16:     0x7f4ba41bd7ca - rustc_span::with_source_map::ha1e1d15982d868c1
  17:     0x7f4ba4155b49 - rustc_interface::interface::run_compiler_in_existing_thread_pool::hfd5622ef3ce026be
  18:     0x7f4ba412f34e - scoped_tls::ScopedKey<T>::set::hd3c1397285b10bd3
  19:     0x7f4ba4156576 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3df4554cf04b61c9
  20:     0x7f4ba412317e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb0a109416f61afc2
  21:     0x7f4ba2795d7a - std::sys::unix::thread::Thread::new::thread_start::hb2effada6f868308
  22:     0x7f4ba24bc422 - start_thread
  23:     0x7f4ba25dabf3 - __GI___clone
  24:                0x0 - <unknown>

error: internal compiler error: unexpected panic

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.45.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

query stack during panic:
end of query stack
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0431`.

@matthiaskrgr matthiaskrgr 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 Jun 5, 2020
@jonas-schievink jonas-schievink added the A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. label Jun 5, 2020
@matthiaskrgr
Copy link
Member Author

another one: ./src/test/ui/issues/issue-47673.rs

// check-pass
#![allow(unused_imports)]

use {{}, {}};

fn main() {}

@matthiaskrgr
Copy link
Member Author

another one: ./src/test/ui/issues/issue-10806.rs

// run-pass
#![allow(unused_imports)]

// pretty-expanded FIXME #23616

pub fn foo() -> isize {
    3
}
pub fn bar() -> isize {
    4
}

pub mod baz {
    use {foo, bar};
    pub fn quux() -> isize {
        foo() + bar()
    }
}

pub mod grault {
    use {foo};
    pub fn garply() -> isize {
        foo()
    }
}

pub mod waldo {
    use {};
    pub fn plugh() -> isize {
        0
    }
}

pub fn main() {
    let _x = baz::quux();
    let _y = grault::garply();
    let _z = waldo::plugh();
}

@marmeladema
Copy link
Contributor

I am on it

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 6, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 6, 2020
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 6, 2020
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 6, 2020
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 6, 2020
@whizsid
Copy link
Contributor

whizsid commented Jun 7, 2020

Same issue happened after upgraded to the latest version today.

@marmeladema
Copy link
Contributor

Yes the fix #73046 has not landed yet.

@bors bors closed this as completed in 7355816 Jun 8, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. 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

Successfully merging a pull request may close this issue.

4 participants