Change:
Rustc version: rustc 1.0.0-nightly ( 2015-03-22) (built 2015-03-23)
Hmm, I am not sure if this is a bug or not. I can see it both ways.
As I understand, this error is related to the situation like this

Discussion:
/// error E0416: identifier is bound more than once in the same pattern IdentifierBoundMoreThanOnceInSamePattern(&'a str), /// error E0417: static variables cannot be referenced in a pattern <del> StaticVariableReference, </del> <ins> StaticVariableReference(DefId, Option<Name>), </ins> /// error E0418: is not an enum variant, struct or const NotAnEnumVariantStructOrConst(&'a str), /// error E0419: unresolved enum variant, struct or const

"identifier `{}` is bound more than once in the same pattern", identifier) } <del> ResolutionError::StaticVariableReference => { struct_span_err!(resolver.session, span, E0417, "static variables cannot be referenced in a pattern, use a  `const` instead") </del> <ins> ResolutionError::StaticVariableReference(did, name) => { let mut err = struct_span_err!(resolver.session, span, E0417, "static variables cannot be referenced in a  pattern, use a `const` instead"); if let Some(sp) = resolver.ast_map.span_if_local(did) { err.span_note(sp, "static variable defined here"); } if let Some(name) = name { if let Some(binding) = resolver.current_module .resolve_name_in_lexical_scope(name, ValueNS) { if binding.is_import() { err.span_note(binding.span, "static variable imported here"); } } } err </ins> } ResolutionError::NotAnEnumVariantStructOrConst(name) => { struct_span_err!(resolver.session,

Def::Variant(..) | Def::Const(..) => { self.record_def(pattern.id, path_res); } <del> Def::Static(..) => { </del> <ins> Def::Static(did, _) => { </ins> resolve_error(&self, path.span, <del> ResolutionError::StaticVariableReference); </del> <ins> ResolutionError::StaticVariableReference( did, None)); </ins> self.record_def(pattern.id, err_path_resolution()); } _ => {

Some(def @ Def::Const(..)) | Some(def @ Def::AssociatedConst(..)) => { FoundConst(def, ident.unhygienic_name) } <del> Some(Def::Static(..)) => { resolve_error(self, span, ResolutionError::StaticVariableReference); </del> <ins> Some(Def::Static(did, _)) => { resolve_error(self, span, ResolutionError::StaticVariableReference( did, Some(ident.unhygienic_name))); </ins> BareIdentifierPatternUnresolved } _ => BareIdentifierPatternUnresolved,

<ins> // Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. static foo: i32 = 0; //~^ NOTE static variable defined here fn bar(foo: i32) {} //~^ ERROR static variables cannot be referenced in a pattern, use a `const` instead mod submod { pub static answer: i32 = 42; //~^ NOTE static variable defined here } use self::submod::answer; //~^ NOTE static variable imported here fn question(answer: i32) {} //~^ ERROR static variables cannot be referenced in a pattern, use a `const` instead fn main() { } </ins>