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

ICE -Zsave-analysis issue-3763.rs #69416

Closed
matthiaskrgr opened this issue Feb 23, 2020 · 0 comments · Fixed by #69422
Closed

ICE -Zsave-analysis issue-3763.rs #69416

matthiaskrgr opened this issue Feb 23, 2020 · 0 comments · Fixed by #69422
Assignees
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

mod my_mod {
    pub struct MyStruct {
        priv_field: isize
    }
    pub fn MyStruct () -> MyStruct {
        MyStruct {priv_field: 4}
    }
    impl MyStruct {
        fn happyfun(&self) {}
    }
}

fn main() {
    let my_struct = my_mod::MyStruct();
    let _woohoo = (&my_struct).priv_field;
    //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private

    let _woohoo = (Box::new(my_struct)).priv_field;
    //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private

    (&my_struct).happyfun();               //~ ERROR method `happyfun` is private

    (Box::new(my_struct)).happyfun();          //~ ERROR method `happyfun` is private
    let nope = my_struct.priv_field;
    //~^ ERROR field `priv_field` of struct `my_mod::MyStruct` is private
}

Meta

rustc --version --verbose:

rustc 1.43.0-nightly (436494b8f 2020-02-22)
binary: rustc
commit-hash: 436494b8f8008b600d64b3951f63c2bb0ea81673
commit-date: 2020-02-22
host: x86_64-unknown-linux-gnu
release: 1.43.0-nightly
LLVM version: 9.0

Error output

error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
  --> src/test/ui/issues/issue-3763.rs:15:19
   |
15 |     let _woohoo = (&my_struct).priv_field;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^

error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
  --> src/test/ui/issues/issue-3763.rs:18:19
   |
18 |     let _woohoo = (Box::new(my_struct)).priv_field;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0624]: method `happyfun` is private
  --> src/test/ui/issues/issue-3763.rs:21:18
   |
21 |     (&my_struct).happyfun();               //~ ERROR method `happyfun` is private
   |                  ^^^^^^^^

error[E0624]: method `happyfun` is private
  --> src/test/ui/issues/issue-3763.rs:23:27
   |
23 |     (Box::new(my_struct)).happyfun();          //~ ERROR method `happyfun` is private
   |                           ^^^^^^^^

error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
  --> src/test/ui/issues/issue-3763.rs:24:16
   |
24 |     let nope = my_struct.priv_field;
   |                ^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc_save_analysis/lib.rs:535:37
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.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.43.0-nightly (436494b8f 2020-02-22) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z save-analysis

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0616, E0624.
For more information about an error, try `rustc --explain E0616`.
Backtrace

error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
  --> src/test/ui/issues/issue-3763.rs:15:19
   |
15 |     let _woohoo = (&my_struct).priv_field;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^

error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
  --> src/test/ui/issues/issue-3763.rs:18:19
   |
18 |     let _woohoo = (Box::new(my_struct)).priv_field;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0624]: method `happyfun` is private
  --> src/test/ui/issues/issue-3763.rs:21:18
   |
21 |     (&my_struct).happyfun();               //~ ERROR method `happyfun` is private
   |                  ^^^^^^^^

error[E0624]: method `happyfun` is private
  --> src/test/ui/issues/issue-3763.rs:23:27
   |
23 |     (Box::new(my_struct)).happyfun();          //~ ERROR method `happyfun` is private
   |                           ^^^^^^^^

error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private
  --> src/test/ui/issues/issue-3763.rs:24:16
   |
24 |     let nope = my_struct.priv_field;
   |                ^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc_save_analysis/lib.rs:535:37
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1052
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1428
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:204
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:224
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
  12: rust_begin_unwind
             at src/libstd/panicking.rs:378
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  14: core::panicking::panic
             at src/libcore/panicking.rs:52
  15: rustc_save_analysis::SaveContext::get_expr_data
  16: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_expr
  17: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  18: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_mod
  19: rustc::dep_graph::graph::DepGraph::with_ignore
  20: rustc_session::utils::<impl rustc_session::session::Session>::time
  21: rustc::ty::context::tls::enter_global
  22: rustc_interface::interface::run_compiler_in_existing_thread_pool
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.43.0-nightly (436494b8f 2020-02-22) 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 5 previous errors

Some errors have detailed explanations: E0616, E0624.
For more information about an error, try `rustc --explain E0616`.

@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 Feb 23, 2020
@JohnTitor JohnTitor self-assigned this Feb 24, 2020
@JohnTitor JohnTitor added the A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. label Feb 26, 2020
Centril added a commit to Centril/rust that referenced this issue Mar 8, 2020
@bors bors closed this as completed in f459d2e Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

2 participants