Skip to content

"internal compiler error: trans_lvalue reached fall-through case" with tuple assignment #9330

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

Closed
jorendorff opened this issue Sep 19, 2013 · 1 comment

Comments

@jorendorff
Copy link
Contributor

This program triggers an ICE:

fn main() {
    let mut a = 1;
    let mut b = 1;
    (a, b) = (b, a + b);
}

The output is:

$ rustc --version
rustc 0.8-pre (8f65529 2013-09-18 15:05:56 -0700)
host: x86_64-apple-darwin
$ rustc -o err err.rs
err.rs:2:12: 2:13 warning: variable does not need to be mutable [-W unused-mut (default)]
err.rs:2     let mut a = 1;
                     ^
err.rs:3:12: 3:13 warning: variable does not need to be mutable [-W unused-mut (default)]
err.rs:3     let mut b = 1;
                     ^
err.rs:4:4: 4:10 error: internal compiler error: trans_lvalue reached fall-through case: ExprTup(~[@syntax::ast::Expr{id: 17, node: ExprPath(syntax::ast::Path{span: syntax::codemap::Span{lo: syntax::codemap::BytePos(55u), hi: syntax::codemap::BytePos(56u), expn_info: None}, global: false, segments: ~[syntax::ast::PathSegment{identifier: syntax::ast::Ident{name: 68u, ctxt: 59u}, lifetime: None, types: Empty}]}), span: syntax::codemap::Span{lo: syntax::codemap::BytePos(55u), hi: syntax::codemap::BytePos(56u), expn_info: None}}, @syntax::ast::Expr{id: 18, node: ExprPath(syntax::ast::Path{span: syntax::codemap::Span{lo: syntax::codemap::BytePos(58u), hi: syntax::codemap::BytePos(59u), expn_info: None}, global: false, segments: ~[syntax::ast::PathSegment{identifier: syntax::ast::Ident{name: 69u, ctxt: 59u}, lifetime: None, types: Empty}]}), span: syntax::codemap::Span{lo: syntax::codemap::BytePos(58u), hi: syntax::codemap::BytePos(59u), expn_info: None}}])
err.rs:4     (a, b) = (b, a + b);
             ^~~~~~
@alexcrichton
Copy link
Member

Closing as a dupe of #7507. (this should be a legit compiler error I believe, not an internal compiler error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants