-
Notifications
You must be signed in to change notification settings - Fork 13.3k
internal compiler error: 'rustc' panicked at 'No def'n found for DefId { krate: 0, node: 4 } in tcx.tcache' #23189
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
Comments
Apparently we don't properly handle the case of trying to instantiate a structure using the name of a module. |
Was about to open a new Issue but I guess I'm having the same problem here. This will be an update that this still happens in rustc 1.3.0-nightly (98dcd5e 2015-07-11) as well as in stable 1.1.0. I tried to write a very simple rust program split into two files. I couldn't figure out the right way to use modules from the documentation so I did trial and error for a bit and ended up with a compiler panic. I know my code most likely isn't even supposed to work and naming conventions are not followed, it still shouldn't crash the compiler though. I wrote this code: I expected to see this happen: Instead, this happened: Meta
Backtrace: error: internal compiler error: unexpected panic stack backtrace: |
Triage: being tracked by glacier. |
...Or not? Glacier appears to be passing, but this is fixed as far as I can tell. Marking both examples as E-needstest. |
Rollup of 11 pull requests Successful merges: - #54820 (Closes #54538: `unused_patterns` lint) - #54963 (Cleanup rustc/session) - #54991 (add test for #23189) - #55025 (Add missing lifetime fragment specifier to error message.) - #55047 (doc: make core::fmt::Error example more simple) - #55048 (Don't collect to vectors where unnecessary) - #55060 (clarify pointer add/sub function safety concerns) - #55062 (Make EvalContext::step public again) - #55066 (Fix incorrect link in println! documentation) - #55081 (Deduplicate tests) - #55088 (Update rustc documentation link) Failed merges: r? @ghost
Just started experimenting with Rust, but as soon as I try to use a Module, compilation fails.
Code:
main.rs:
mod person;
fn main() {
let p = person{ name : "Example" };
p.say_hello();
}
person.rs:
struct person {
name : String,
}
impl person {
fn say_hello(&self){
println!("Hello {}", self.name);
}
}
rustc 1.0.0-nightly (2fc8b1e 2015-03-07) (built 2015-03-08)
binary: rustc
commit-hash: 2fc8b1e
commit-date: 2015-03-07
build-date: 2015-03-08
host: x86_64-unknown-linux-gnu
release: 1.0.0-nightly
Backtrace:
Compiling test v0.0.1 (file:///home/****/work/test)
thread 'rustc' panicked at 'No def'n found for DefId { krate: 0, node: 4 } in tcx.tcache', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc/middle/ty.rs:5141
stack backtrace:
1: 0x7f8c5cdaa2d2 - sys::backtrace::write::h49f84a63c90f3a72QBA
2: 0x7f8c5cdd0322 - panicking::on_panic::hd99ba6230147c149jHJ
3: 0x7f8c5cd16a69 - rt::unwind::begin_unwind_inner::hcba984cddf911653mnJ
4: 0x7f8c5cd16e11 - rt::unwind::begin_unwind_fmt::h056d56048d7d024dXlJ
5: 0x7f8c5adf820c - middle::ty::lookup_item_type::h6ab48efb47b1c189TU7
6: 0x7f8c5bbf89a3 - check::check_expr_with_unifier::h7241075278574285947
7: 0x7f8c5bc1a62d - check::check_decl_local::h554e5d2066e836d5IWr
8: 0x7f8c5bbd2190 - check::check_block_with_expected::h4d6fd0761db904b4P2r
9: 0x7f8c5bbba2d2 - check::check_fn::hbe3c2620378bc01ffmn
10: 0x7f8c5bbcf943 - check::check_bare_fn::h560cf773e203be14Vbn
11: 0x7f8c5bbc7f1f - check::check_item::ha45b9554a5eca7eazun
12: 0x7f8c5bc878b3 - check_crate::closure.35693
13: 0x7f8c5bc833d7 - check_crate::h2872530e4373c1cbhfC
14: 0x7f8c5d3c585e - driver::phase_3_run_analysis_passes::hd173921852ab87d4mGa
15: 0x7f8c5d3aa6d5 - driver::compile_input::h552c440872c5b657Nba
16: 0x7f8c5d46ef1d - run_compiler::h56042a784d7b1fc7G6b
17: 0x7f8c5d46cc8c - thunk::F.Invoke<A, R>::invoke::h15113937807686641913
18: 0x7f8c5d46b8e0 - rt::unwind::try::try_fn::h14840337430372503284
19: 0x7f8c5ce3c0f8 - rust_try_inner
20: 0x7f8c5ce3c0e5 - rust_try
21: 0x7f8c5d46c06b - thunk::F.Invoke<A, R>::invoke::h6250943894687305386
22: 0x7f8c5cdbdb25 - sys::thread::thread_start::h848d60956d3aea28t8E
23: 0x7f8c56e2a373 - start_thread
24: 0x7f8c5c99f27c - __clone
25: 0x0 -
The text was updated successfully, but these errors were encountered: