Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2243,8 +2243,12 @@ fn name_from_pat(p: &ast::Pat) -> String {
},
PatRange(..) => panic!("tried to get argument name from PatRange, \
which is not allowed in function arguments"),
PatVec(..) => panic!("tried to get argument name from pat_vec, \
which is not allowed in function arguments"),
PatVec(ref begin, ref mid, ref end) => {
let begin = begin.iter().map(|p| name_from_pat(&**p));
let mid = mid.as_ref().map(|p| format!("..{}", name_from_pat(&**p))).into_iter();
let end = end.iter().map(|p| name_from_pat(&**p));
format!("[{}]", begin.chain(mid).chain(end).collect::<Vec<_>>().connect(", "))
},
PatMac(..) => {
warn!("can't document the name of a function argument \
produced by a pattern macro");
Expand Down