mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 00:56:14 +00:00
This commit is contained in:
parent
d7efdd60c8
commit
220ecdaf71
21
src/types.rs
21
src/types.rs
@ -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,
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user