From 18e41299f9368c593be688792962a6d0c299c9bc Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 10 Oct 2014 08:31:13 -0700 Subject: rustc: Warn about dead constants A few catch-all blocks ended up not having this case for constants. Closes #17925 --- src/libsyntax/ast.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 274bb2e39e0..be79b18bfe9 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1334,6 +1334,7 @@ impl Item_ { pub fn descriptive_variant(&self) -> &str { match *self { ItemStatic(..) => "static item", + ItemConst(..) => "constant item", ItemFn(..) => "function", ItemMod(..) => "module", ItemForeignMod(..) => "foreign module", @@ -1341,7 +1342,8 @@ impl Item_ { ItemEnum(..) => "enum", ItemStruct(..) => "struct", ItemTrait(..) => "trait", - _ => "item" + ItemMac(..) | + ItemImpl(..) => "item" } } } -- cgit 1.4.1-3-g733a5