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

Trying to use impl Trait in a trait implementation causes ICE #49841

Closed
KamilaBorowska opened this issue Apr 10, 2018 · 0 comments
Closed

Trying to use impl Trait in a trait implementation causes ICE #49841

KamilaBorowska opened this issue Apr 10, 2018 · 0 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@KamilaBorowska
Copy link
Contributor

KamilaBorowska commented Apr 10, 2018

Trying the following on beta:

use std::hash::{Hash, Hasher};

struct X;

impl Hash for X {
    fn hash(&self, hasher: &mut impl Hasher) {}
}

fn main() {}

I get the following error message.

   Compiling playground v0.0.1 (file:///playground)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.26.0-beta.3 (8a75d2b50 2018-04-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

Playpen link: https://play.rust-lang.org/?gist=5f2404761b1e9eef3faca5ab5bd92167&version=beta

@KamilaBorowska KamilaBorowska changed the title Cannot use impl Trait in a trait. Trying to use impl Trait in a trait causes ICE Apr 10, 2018
@KamilaBorowska KamilaBorowska changed the title Trying to use impl Trait in a trait causes ICE Trying to use impl Trait in a trait implementation causes ICE Apr 10, 2018
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 10, 2018
sinkuu added a commit to sinkuu/rust that referenced this issue Apr 26, 2018
kennytm added a commit to kennytm/rust that referenced this issue Apr 27, 2018
Fix ICE with erroneous `impl Trait` in a trait impl

Fixes rust-lang#49841.
pietroalbini pushed a commit to pietroalbini/rust that referenced this issue Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants