This commit is contained in:
Sinh Pham 2015-09-27 16:32:07 -04:00
parent d7efdd60c8
commit 220ecdaf71
2 changed files with 24 additions and 0 deletions

View File

@ -482,6 +482,27 @@ impl Rewrite for ast::Ty {
let budget = try_opt!(width.checked_sub(2));
ty.rewrite(context, budget, offset + 1).map(|ty_str| format!("({})", ty_str))
}
ast::TyTup(ref tup_ret) => {
let inner = try_opt!(tup_ret.iter()
.map(|item| item.rewrite(context, width, offset))
.fold(Some("".to_owned()),
|sum, x| {
match (sum, x) {
(Some(sum), Some(x)) => {
if sum == "" {
// First item.
Some(x)
} else {
Some(sum + ", " + &x)
}
}
_ => None,
}
}));
let ret = format!("({})", inner);
wrap_str(ret, context.config.max_width, width, offset)
}
_ => wrap_str(pprust::ty_to_string(self),
context.config.max_width,
width,

View File

@ -79,6 +79,9 @@ fn homura<T: Deref<Target = i32>>(_: T) {
}
fn issue377() -> (Box<CompositorProxy + Send>, Box<CompositorReceiver>) {
}
fn main() {
let _ = function(move || 5);
let _ = move || 42;