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

extra-debug-info with debug! causes error: internal compiler error: #5848

Closed
danluu opened this issue Apr 12, 2013 · 2 comments
Closed

extra-debug-info with debug! causes error: internal compiler error: #5848

danluu opened this issue Apr 12, 2013 · 2 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@danluu
Copy link
Contributor

danluu commented Apr 12, 2013

rustc -Z extra-debug-info debug.rs
error: internal compiler error: node_id_to_type: no type for node arg (id=756)

fn main() {
    debug!("foo")
}
@yichoi
Copy link
Contributor

yichoi commented Jun 10, 2013

error message changed

rustc: /home/yichoi/rust_latest/src/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1367: void llvm::DwarfDebug::beginFunction(const llvm::MachineFunction*): Assertion `TheCU && "Unable to find compile unit!"' failed.
Stack dump:
0.      Running pass 'Function Pass Manager' on module 'debug.rc'.
1.      Running pass 'X86 Assembly / Object Emitter' on function '@_ZN4main17_2b23311f69177dc03_00E'
Aborted (core dumped)

@vadimcn vadimcn mentioned this issue Jun 14, 2013
bors added a commit that referenced this issue Jun 17, 2013
This commit fixes rustc's debug info generation and turns debug-info tests back on.

The old generator used to write out LLVM metadata directly, however it seems that debug metadata format is not stable and keeps changing from release to release.  So I wrapped LLVM's official debug info API - the DIBuilder class, and now rustc will use that.

One bit of old functionality that still doesn't work, is debug info for function arguments.  Someone more familiar with the compiler guts will need to look into that.

Also, unfortunately, debug info is still won't work on Windows,- due to a LLVM bug (http://llvm.org/bugs/show_bug.cgi?id=16249).

Resolves issues #5836, #5848, #6814
@msullivan
Copy link
Contributor

This was fixed.

flip1995 added a commit to flip1995/rust that referenced this issue Aug 11, 2020
…ord-lint, r=matthiaskrgr

Add derive_ord_xor_partial_ord lint

Fix rust-lang#1621

Some remarks:
This PR follows the example of the analogous derive_hash_xor_partial_eq lint where possible.
I initially tried using the `match_path` function to identify `Ord` implementation like the derive_hash_xor_partial_eq lint currently does, for `Hash` implementations but that didn't work.

Specifically, the structs at the top level were getting paths that matched `&["$crate", "cmp", "Ord"]` instead of `&["std", "cmp", "Ord"]`. While trying to figure out what to do instead I saw the comment at the top of [clippy_lints/src/utils/paths.rs](https://github.com/rust-lang/rust-clippy/blob/f5d429cd762423901f946abd800dc2cd91366ccf/clippy_lints/src/utils/paths.rs#L5) that mentioned [this issue](rust-lang/rust-clippy#5393) and suggested to use diagnostic items instead of hardcoded paths whenever possible. I looked for a way to identify `Ord` implementations with diagnostic items, but (possibly because this was the first time I had heard of diagnostic items,) I was unable to find one.

Eventually I tried using `get_trait_def_id` and comparing `DefId` values directly and that seems to work as expected. Maybe there's a better approach however?

changelog: new lint: derive_ord_xor_partial_ord
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 11, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#5837 (needless_collect: catch x: Vec<_> = iter.collect(); x.into_iter() ...)
 - rust-lang#5846 (Handle mapping to Option in `map_flatten` lint)
 - rust-lang#5848 (Add derive_ord_xor_partial_ord lint)
 - rust-lang#5852 (Add lint for duplicate methods of trait bounds)
 - rust-lang#5856 (Remove old Symbol reexport)

Failed merges:

r? @ghost

changelog: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)
Projects
None yet
Development

No branches or pull requests

3 participants