Skip to content

Commit 7b382e5

Browse files
committed
Fix rustdoc bug involving PatLit
1 parent e53e86a commit 7b382e5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/librustdoc/clean.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,8 @@ fn lit_to_str(lit: &ast::lit) -> ~str {
11231123

11241124
fn name_from_pat(p: &ast::Pat) -> ~str {
11251125
use syntax::ast::*;
1126+
debug!("Trying to get a name from pattern: {:?}", p);
1127+
11261128
match p.node {
11271129
PatWild => ~"_",
11281130
PatWildMulti => ~"..",
@@ -1134,9 +1136,12 @@ fn name_from_pat(p: &ast::Pat) -> ~str {
11341136
PatBox(p) => name_from_pat(p),
11351137
PatUniq(p) => name_from_pat(p),
11361138
PatRegion(p) => name_from_pat(p),
1137-
PatLit(..) => fail!("tried to get argument name from pat_lit, \
1138-
which is not allowed in function arguments"),
1139-
PatRange(..) => fail!("tried to get argument name from pat_range, \
1139+
PatLit(..) => {
1140+
warn!("tried to get argument name from PatLit, \
1141+
which is silly in function arguments");
1142+
~"()"
1143+
},
1144+
PatRange(..) => fail!("tried to get argument name from PatRange, \
11401145
which is not allowed in function arguments"),
11411146
PatVec(..) => fail!("tried to get argument name from pat_vec, \
11421147
which is not allowed in function arguments")

0 commit comments

Comments
 (0)