Skip to content

rustc compiler unexpectedly panicked #82629

Closed
@franklucky001

Description

@franklucky001

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions