Skip to content

Compiler crashed with impl Trait inside a non-existing type #53300

Closed
@dovahcrow

Description

@dovahcrow
Contributor

When putting impl Trait inside some non-existing type as the return type of a function, the compiler crashes unexpectedly with

thread 'main' panicked at 'no entry found for key', libcore/option.rs:960:5.

minimal case:

fn bug() -> Wrapper<impl A> {}

Playground: http://play.rust-lang.org/?gist=b16591d9c6cc69f894c15bfca84198d9&version=stable&mode=debug&edition=2015

rustc version (my local machine):

rustc 1.28.0 (9634041 2018-07-30)
binary: rustc
commit-hash: 9634041
commit-date: 2018-07-30
host: x86_64-apple-darwin
release: 1.28.0
LLVM version: 6.0

Activity

changed the title [-]Compiler crashed with impl Trait inside a non-existing type[/-] [+]Compiler crashed with `impl Trait` inside a non-existing type[/+] on Aug 13, 2018
added
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
on Aug 13, 2018
oli-obk

oli-obk commented on Aug 13, 2018

@oli-obk
Contributor

I was told that I should be more conservative with panics. Did I listen? No. "Can't happen anymore anyway", well it can

The fix is to revert the linked change (not the entire commit, just the change where the link points to)

28a76a9#diff-4ed25c00aceb84666fca639cf8101c7cL1069

and then add a test for it.

added
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
on Aug 13, 2018
JoshBrudnak

JoshBrudnak commented on Aug 13, 2018

@JoshBrudnak
Contributor

@oli-obk I would like to help out with this, thanks.

memoryruins

memoryruins commented on Aug 25, 2018

@memoryruins
Contributor

Fixed by @JoshBrudnak in #53460
Aborts without ICE on current nightly
rustc 1.30.0-nightly (d41f21f11 2018-08-24)

TheSirC

TheSirC commented on Dec 5, 2018

@TheSirC

Fixed by @JoshBrudnak in #53460
Aborts without ICE on current nightly
rustc 1.30.0-nightly (d41f21f11 2018-08-24)

Shouldn't this issue be closed considering this ?

dovahcrow

dovahcrow commented on Dec 5, 2018

@dovahcrow
ContributorAuthor

I think so.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @oli-obk@dovahcrow@memoryruins@JoshBrudnak@TheSirC

        Issue actions

          Compiler crashed with `impl Trait` inside a non-existing type · Issue #53300 · rust-lang/rust