Skip to content

Commit 52b9688

Browse files
committed
auto merge of #9176 : brson/rust/issue-9129, r=catamorphism
Servo is hitting this problem, so this is a workaround for lack of a real solution. No tests because I couldn't actually reproduce the problem with either of the testcases in #9129
2 parents a241deb + c62919f commit 52b9688

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/libsyntax/fold.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,19 @@ pub fn noop_fold_expr(e: &Expr_, fld: @ast_fold) -> Expr_ {
690690
ExprBreak(ref opt_ident) => {
691691
// FIXME #6993: add fold_name to fold.... then cut out the
692692
// bogus Name->Ident->Name conversion.
693-
ExprBreak(opt_ident.map_move(|x| fld.fold_ident(Ident::new(x)).name))
693+
ExprBreak(opt_ident.map_move(|x| {
694+
// FIXME #9129: Assigning the new ident to a temporary to work around codegen bug
695+
let newx = Ident::new(x);
696+
fld.fold_ident(newx).name
697+
}))
694698
}
695699
ExprAgain(ref opt_ident) => {
696700
// FIXME #6993: add fold_name to fold....
697-
ExprAgain(opt_ident.map_move(|x| fld.fold_ident(Ident::new(x)).name))
701+
ExprAgain(opt_ident.map_move(|x| {
702+
// FIXME #9129: Assigning the new ident to a temporary to work around codegen bug
703+
let newx = Ident::new(x);
704+
fld.fold_ident(newx).name
705+
}))
698706
}
699707
ExprRet(ref e) => {
700708
ExprRet(e.map_move(|x| fld.fold_expr(x)))

0 commit comments

Comments
 (0)