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

Don't ICE when logging unusual types #57865

Merged
merged 1 commit into from Jan 25, 2019

Conversation

Projects
None yet
4 participants
@Aaron1011
Copy link
Contributor

Aaron1011 commented Jan 23, 2019

MonoItemExt#to_string is used for both debug logging and LLVM symbol
name generation. When debugging, we want to print out any type we
encounter, even if it's something weird like GeneratorWitness. However,
during codegen, we still want to error if we encounter an unexpected
type when generating a name.

To resolve this issue, this commit introduces a new 'debug' parameter to
the relevant methods. When set to 'true', it allows any type to be
printed - when set to 'false', it 'bug!'s when encountering an
unexpected type.

This prevents an ICE when enabling debug logging (via RUST_LOG) while
running rustc on generator-related code.

Don't ICE when logging unusual types
MonoItemExt#to_string is used for both debug logging and LLVM symbol
name generation. When debugging, we want to print out any type we
encounter, even if it's something weird like GeneratorWitness. However,
during codegen, we still want to error if we encounter an unexpected
type when generating a name.

To resolve this issue, this commit introduces a new 'debug' parameter to
the relevant methods. When set to 'true', it allows any type to be
printed - when set to 'false', it 'bug!'s when encountering an
unexpected type.

This prevents an ICE when enabling debug logging (via RUST_LOG) while
running rustc on generator-related code.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 23, 2019

r? @estebank

(rust_highfive has picked a reviewer for you, use r? to override)

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Jan 24, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 24, 2019

📌 Commit fc0c883 has been approved by estebank

Centril added a commit to Centril/rust that referenced this pull request Jan 25, 2019

Rollup merge of rust-lang#57865 - Aaron1011:fix/debug-ice, r=estebank
Don't ICE when logging unusual types

MonoItemExt#to_string is used for both debug logging and LLVM symbol
name generation. When debugging, we want to print out any type we
encounter, even if it's something weird like GeneratorWitness. However,
during codegen, we still want to error if we encounter an unexpected
type when generating a name.

To resolve this issue, this commit introduces a new 'debug' parameter to
the relevant methods. When set to 'true', it allows any type to be
printed - when set to 'false', it 'bug!'s when encountering an
unexpected type.

This prevents an ICE when enabling debug logging (via RUST_LOG) while
running rustc on generator-related code.

bors added a commit that referenced this pull request Jan 25, 2019

Auto merge of #57888 - Centril:rollup, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #56217 (Add grammar in docs for {f32,f64}::from_str, mention known bug.)
 - #57294 (When using value after move, point at span of local)
 - #57652 (Update/remove some old readmes)
 - #57802 (Print visible name for types as well as modules.)
 - #57865 (Don't ICE when logging unusual types)

Failed merges:

r? @ghost

@bors bors merged commit fc0c883 into rust-lang:master Jan 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment