Merge pull request #198 from marcusklaas/parameterized-paths-matter

Fix bug in path formatting
This commit is contained in:
Nick Cameron 2015-08-23 19:52:39 +12:00
commit 8319e33573
3 changed files with 20 additions and 2 deletions

View file

@ -231,7 +231,7 @@ fn rewrite_segment(segment: &ast::PathSegment,
None => String::new(),
};
let list_lo = span_after(codemap::mk_sp(*span_lo, span_hi), "(", context.codemap);
let list_lo = span_after(data.span, "(", context.codemap);
let items = itemize_list(context.codemap,
data.inputs.iter(),
")",
@ -248,7 +248,7 @@ fn rewrite_segment(segment: &ast::PathSegment,
let fmt = ListFormatting::for_fn(budget, offset + 1);
// update pos
*span_lo = data.inputs.last().unwrap().span.hi + BytePos(1);
*span_lo = data.span.hi + BytePos(1);
format!("({}){}", write_list(&items.collect::<Vec<_>>(), &fmt), output)
}

View file

@ -68,3 +68,9 @@ struct Tuple(
A, //Comment
B
);
pub struct State<F: FnMut() -> time::Timespec> { now: F }
pub struct State<F: FnMut() -> ()> { now: F }
pub struct State<F: FnMut()> { now: F }

View file

@ -65,3 +65,15 @@ struct Baz {
// Will this be a one-liner?
struct Tuple(A /* Comment */, B);
pub struct State<F: FnMut() -> time::Timespec> {
now: F,
}
pub struct State<F: FnMut() -> ()> {
now: F,
}
pub struct State<F: FnMut()> {
now: F,
}