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

rustc compiler unexpectedly panicked #82629

Closed
franklucky001 opened this issue Feb 28, 2021 · 3 comments
Closed

rustc compiler unexpectedly panicked #82629

franklucky001 opened this issue Feb 28, 2021 · 3 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@franklucky001
Copy link

franklucky001 commented Feb 28, 2021

Code

trait UseA{
    fn use_a(&self);
}
trait A {
    fn hello(&self) {
        println!("hello A ");
    }
}
#[derive(Debug)]
struct Base{
    name: String,
}
impl UseA for  Base {
    fn use_a(&self) {
        println!("aaaa");
    }
}
impl<T: UseA> A for T {
    fn hello(&self) {
        self.use_a();
        super().hello();
    }
}

fn main() {
   let base = Base{name: String::from("base")};
   base.hello();
}

Meta

rustc --version: rustc 1.50.0 (cb75ad5 2021-02-10) running on x86_64-pc-windows-msvc

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler\rustc_resolve\src\late\diagnostics.rs:138:36
error: internal compiler error: unexpected panic
error: could not compile `hello`
Backtrace

@franklucky001 franklucky001 added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 28, 2021
@jonas-schievink
Copy link
Contributor

This is fixed on nightly

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 28, 2021

super().hello();

Could be a duplicate of #82156

@jonas-schievink
Copy link
Contributor

looks like it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants