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

debuginfo: Type metadata for ty::t '&[core::fmt::rt::Piece<>]' is already in the TypeMap! #14871

Closed
michaelwoerister opened this issue Jun 13, 2014 · 2 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@michaelwoerister
Copy link
Member

Compiling libcore with -g leads to the following error:

error: internal compiler error: Type metadata for ty::t '&[core::fmt::rt::Piece<>]' is already in the TypeMap!

This is due to the vec slice in question occurring multiple times along a type reference chain and the code path for vec slices doesn't take that possibility into account. This is also a potential problem for other kinds of types, e.g. fixed length vector types or function types. For regular pointer types this is already handled correctly.

@michaelwoerister
Copy link
Member Author

BTW: The issue has originally been discovered by @nick29581: #14819 (comment)

@michaelwoerister
Copy link
Member Author

Since PR #14935 the whole of rustc and standard libraries can be compiled with -g without this problem occurring, so I'm closing this issue.
Mind though that you have to use a compiler that actually contains the patch from the PR, so simply running "RUSTFLAGS=-g make rustc" will still fail until there's a new snapshot.

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
Implement `${count()}` metavariable expression

This PR implements `${count()}` metavariable expression for MBE as described in [RFC 3086][rfc]. See [this section][sec-count] of the RFC for its semantics.

Additionally, this PR changes the type of depth parameter of `${index()}` from u32 to usize so as to match how [rustc parses it][index-usize].

Part of rust-lang#11952
Fixes rust-lang#14871

[rfc]: rust-lang/rfcs#3086
[sec-count]: https://github.com/rust-lang/rfcs/blob/master/text/3086-macro-metavar-expr.md#count
[index-usize]:https://github.com/rust-lang/rust/blob/ddad0576caf8d0515ed453e04b468977c7d3dfc1/compiler/rustc_expand/src/mbe/metavar_expr.rs#L22
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.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

1 participant