Skip to content

ICE: None != Some(()) with method call on unknown type #19297

Closed
@huonw

Description

@huonw
fn main() {
    [].sort_by(| a, b | a.partial_cmp(b))
}
ice5.rs:2:27: 2:41 error: the type of this value must be known in this context
ice5.rs:2     [].sort_by(| a, b | a.partial_cmp(b))
                                    ^~~~~~~~~~~~~~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'assertion failed: `(left == right) && (right == left)` (left: `None`, right: `Some(())`)', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librustc/middle/typeck/check/method/confirm.rs:152

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