-// Copyright 2012-2013 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.
-
//! Used by plugin crates to tell `rustc` about the plugins they provide.
use rustc::lint::{EarlyLintPassObject, LateLintPassObject, LintId, Lint};
#[doc(hidden)]
pub attributes: Vec<(String, AttributeType)>,
-
- whitelisted_custom_derives: Vec<ast::Name>,
}
impl<'a> Registry<'a> {
lint_groups: FxHashMap::default(),
llvm_passes: vec![],
attributes: vec![],
- whitelisted_custom_derives: Vec::new(),
}
}
edition,
}
}
- IdentTT(ext, _, allow_internal_unstable) => {
- IdentTT(ext, Some(self.krate_span), allow_internal_unstable)
+ IdentTT { expander, span: _, allow_internal_unstable } => {
+ IdentTT { expander, span: Some(self.krate_span), allow_internal_unstable }
}
_ => extension,
}));
}
- /// This can be used in place of `register_syntax_extension` to register legacy custom derives
- /// (i.e. attribute syntax extensions whose name begins with `derive_`). Legacy custom
- /// derives defined by this function do not trigger deprecation warnings when used.
- pub fn register_custom_derive(&mut self, name: ast::Name, extension: SyntaxExtension) {
- assert!(name.as_str().starts_with("derive_"));
- self.whitelisted_custom_derives.push(name);
- self.register_syntax_extension(name, extension);
- }
-
- pub fn take_whitelisted_custom_derives(&mut self) -> Vec<ast::Name> {
- ::std::mem::replace(&mut self.whitelisted_custom_derives, Vec::new())
- }
-
/// Register a macro of the usual kind.
///
/// This is a convenience wrapper for `register_syntax_extension`.
self.register_syntax_extension(Symbol::intern(name), NormalTT {
expander: Box::new(expander),
def_info: None,
- allow_internal_unstable: false,
+ allow_internal_unstable: Vec::new(),
allow_internal_unsafe: false,
local_inner_macros: false,
unstable_feature: None,