Skip to content

Commit

Permalink
Don't ICE if an argument in a default method doesn't have a name. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
msullivan committed Aug 22, 2013
1 parent 5003f60 commit 48a6823
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,7 @@ impl Liveness {

pub fn should_warn(&self, var: Variable) -> Option<@str> {
let name = self.ir.variable_name(var);
if name[0] == ('_' as u8) { None } else { Some(name) }
if name.len() == 0 || name[0] == ('_' as u8) { None } else { Some(name) }
}

pub fn warn_about_unused_args(&self, decl: &fn_decl, entry_ln: LiveNode) {
Expand Down

0 comments on commit 48a6823

Please sign in to comment.