Skip to content

Eager unreachable blocks for ! type#47291

Closed
varkor wants to merge 16 commits intorust-lang:masterfrom
varkor:unreachable-never-patterns
Closed

Eager unreachable blocks for ! type#47291
varkor wants to merge 16 commits intorust-lang:masterfrom
varkor:unreachable-never-patterns

Conversation

@varkor
Copy link
Copy Markdown
Contributor

@varkor varkor commented Jan 9, 2018

This change optimises the generation of MIR in the presence of !. Blocks are now immediately marked as unreachable if:

  • A function argument is derived from the value of type !.
  • A match arm binds a value whose type is derived from !.
  • An rvalue is created whose type is derived from !.

This avoids unnecessary MIR generation and also fixes #43061 and fixes #41446.

r? @nikomatsakis

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

Labels

S-blocked Status: Blocked on something else such as an RFC or other implementation work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust 1.20.0-nightly ICE with never_type: Broken MIR MIR generates Unreachable in fewer situations than before