Skip to content

Compiler panic on assertion when check::autoderef return result with None #20261

Closed
@defuz

Description

@defuz

Minimal [invalid] code to reproduce bug:

fn main() {
    for (ref i,) in [].iter() {
        i.clone();
    }
}

What I see:

$ rustc src/bug.rs
src/bug.rs:2:9: 2:17 error: mismatched types: expected `&_`, found `(_,)` (expected &-ptr, found tuple)
src/bug.rs:2     for (ref i,) in [].iter() {
                     ^~~~~~~~
src/bug.rs:3:11: 3:18 error: the type of this value must be known in this context
src/bug.rs:3         i.clone();
                       ^~~~~~~
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
thread 'rustc' panicked at 'assertion failed: `(left == right) && (right == left)` (left: `None`, right: `Some(())`)', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/librustc_typeck/check/method/confirm.rs:153

Rust version:

$ rustc --version --verbose
rustc 0.13.0-nightly (96a3c7c6a 2014-12-23 22:21:10 +0000)
binary: rustc
commit-hash: 96a3c7c6a051ab2f5fc01fe9e686f7fffcc87c61
commit-date: 2014-12-23 22:21:10 +0000
host: x86_64-apple-darwin
release: 0.13.0-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions