Skip to content

Commit 1a852a6

Browse files
committed
librustc: Remove useless code to handle let _ = ...
This code didn't do anything, but was a vestige of the old semantics for `let _ = ...`. Closes rust-lang#10488. (As near as I can tell anyhow.)
1 parent 3851d68 commit 1a852a6

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/librustc/middle/trans/base.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -969,23 +969,9 @@ pub fn ignore_lhs(_bcx: &Block, local: &ast::Local) -> bool {
969969

970970
pub fn init_local<'a>(bcx: &'a Block<'a>, local: &ast::Local)
971971
-> &'a Block<'a> {
972-
973-
debug!("init_local(bcx={}, local.id={:?})",
974-
bcx.to_str(), local.id);
972+
debug!("init_local(bcx={}, local.id={:?})", bcx.to_str(), local.id);
975973
let _indenter = indenter();
976-
977974
let _icx = push_ctxt("init_local");
978-
979-
if ignore_lhs(bcx, local) {
980-
// Handle let _ = e; just like e;
981-
match local.init {
982-
Some(ref init) => {
983-
return controlflow::trans_stmt_semi(bcx, &**init)
984-
}
985-
None => { return bcx; }
986-
}
987-
}
988-
989975
_match::store_local(bcx, local)
990976
}
991977

0 commit comments

Comments
 (0)