Skip to content

trans monomorphizes dtors that have a different parameter order wrong #27997

Closed
@arielb1

Description

@arielb1

STR

use std::fmt;
struct T2<U,V: fmt::Display>(U,V);

impl<V: fmt::Display, U> Drop for T2<U,V> {
    fn drop(&mut self) {
        println!("{}", self.1);
    }
}
fn main() {
    let _ = T2((), 1);
}

Expected result

Should print 1 (or fail to compile)

Actual result


<anon>:1:1: 1:1 error: internal compiler error: Encountered error `Unimplemented` selecting `Binder(<() as core::fmt::Display>)` during trans
<anon>:1 use std::fmt;
         ^
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', ../src/libsyntax/diagnostic.rs:176


playpen: application terminated with error code 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    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

    Issue actions