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

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

Closed
defuz opened this issue Dec 27, 2014 · 3 comments
Closed
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@defuz
Copy link
Contributor

defuz commented Dec 27, 2014

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
@barosl
Copy link
Contributor

barosl commented Dec 28, 2014

This seems to have been fixed by #19813.

@jdm jdm added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Dec 29, 2014
@defuz
Copy link
Contributor Author

defuz commented Dec 29, 2014

@barosl, indeed, you are right.

@defuz defuz closed this as completed Feb 22, 2015
@defuz
Copy link
Contributor Author

defuz commented Feb 22, 2015

Sorry, I haven't seen label E-needstest.

@defuz defuz reopened this Feb 22, 2015
@bors bors closed this as completed in 1d31f31 Mar 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

3 participants