]> git.lizzy.rs Git - rust.git/commitdiff
Rename lint::Lint to lint::LintId
authorKeegan McAllister <kmcallister@mozilla.com>
Sun, 1 Jun 2014 23:21:52 +0000 (16:21 -0700)
committerKeegan McAllister <kmcallister@mozilla.com>
Tue, 24 Jun 2014 17:24:03 +0000 (10:24 -0700)
src/librustc/driver/config.rs
src/librustc/driver/session.rs
src/librustc/lint/mod.rs
src/librustc/middle/ty.rs

index 512bdce5d88c55248b8faf74cfaba95452a14404..f56e512871204afce8e5ccef3ec33fe4cad43996 100644 (file)
@@ -70,7 +70,7 @@ pub struct Options {
     pub gc: bool,
     pub optimize: OptLevel,
     pub debuginfo: DebugInfoLevel,
-    pub lint_opts: Vec<(lint::Lint, lint::Level)> ,
+    pub lint_opts: Vec<(lint::LintId, lint::Level)> ,
     pub output_types: Vec<back::link::OutputType> ,
     // This was mutable for rustpkg, which updates search paths based on the
     // parsed code. It remains mutable in case its replacements wants to use
index 2978ff7f780aa2293910d3c72216b3b9daa4e6de..e84c356b2d8d90a8e852964101482aaab2526427 100644 (file)
@@ -43,7 +43,7 @@ pub struct Session {
     // expected to be absolute. `None` means that there is no source file.
     pub local_crate_source_file: Option<Path>,
     pub working_dir: Path,
-    pub lints: RefCell<NodeMap<Vec<(lint::Lint, codemap::Span, String)>>>,
+    pub lints: RefCell<NodeMap<Vec<(lint::LintId, codemap::Span, String)>>>,
     pub node_id: Cell<ast::NodeId>,
     pub crate_types: RefCell<Vec<config::CrateType>>,
     pub features: front::feature_gate::Features,
@@ -106,7 +106,7 @@ pub fn unimpl(&self, msg: &str) -> ! {
         self.diagnostic().handler().unimpl(msg)
     }
     pub fn add_lint(&self,
-                    lint: lint::Lint,
+                    lint: lint::LintId,
                     id: ast::NodeId,
                     sp: Span,
                     msg: String) {
index e60726f6d6b7c8cb68e4faa332d3085ba11a7640..bd3b1bc7d00bb8874938e855dd579f17baf97d90 100644 (file)
@@ -59,7 +59,7 @@
 mod builtin;
 
 #[deriving(Clone, Show, PartialEq, PartialOrd, Eq, Ord, Hash)]
-pub enum Lint {
+pub enum LintId {
     CTypes,
     UnusedImports,
     UnnecessaryQualification,
@@ -126,7 +126,7 @@ pub enum Level {
 #[deriving(Clone, PartialEq, PartialOrd, Eq, Ord)]
 pub struct LintSpec {
     pub default: Level,
-    pub lint: Lint,
+    pub lint: LintId,
     pub desc: &'static str,
 }
 
@@ -449,7 +449,7 @@ struct Context<'a> {
     /// When recursing into an attributed node of the ast which modifies lint
     /// levels, this stack keeps track of the previous lint levels of whatever
     /// was modified.
-    lint_stack: Vec<(Lint, Level, LintSource)>,
+    lint_stack: Vec<(LintId, Level, LintSource)>,
 
     /// Id of the last visited negated expression
     negated_expr_id: ast::NodeId,
@@ -459,7 +459,7 @@ struct Context<'a> {
 
     /// Level of lints for certain NodeIds, stored here because the body of
     /// the lint needs to run in trans.
-    node_levels: HashMap<(ast::NodeId, Lint), (Level, LintSource)>,
+    node_levels: HashMap<(ast::NodeId, LintId), (Level, LintSource)>,
 }
 
 pub fn emit_lint(level: Level, src: LintSource, msg: &str, span: Span,
@@ -496,7 +496,7 @@ pub fn emit_lint(level: Level, src: LintSource, msg: &str, span: Span,
     }
 }
 
-pub fn lint_to_str(lint: Lint) -> &'static str {
+pub fn lint_to_str(lint: LintId) -> &'static str {
     for &(name, lspec) in lint_table.iter() {
         if lspec.lint == lint {
             return name;
@@ -507,21 +507,21 @@ pub fn lint_to_str(lint: Lint) -> &'static str {
 }
 
 impl<'a> Context<'a> {
-    fn get_level(&self, lint: Lint) -> Level {
+    fn get_level(&self, lint: LintId) -> Level {
         match self.cur.find(&(lint as uint)) {
           Some(&(lvl, _)) => lvl,
           None => Allow
         }
     }
 
-    fn get_source(&self, lint: Lint) -> LintSource {
+    fn get_source(&self, lint: LintId) -> LintSource {
         match self.cur.find(&(lint as uint)) {
           Some(&(_, src)) => src,
           None => Default
         }
     }
 
-    fn set_level(&mut self, lint: Lint, level: Level, src: LintSource) {
+    fn set_level(&mut self, lint: LintId, level: Level, src: LintSource) {
         if level == Allow {
             self.cur.remove(&(lint as uint));
         } else {
@@ -529,7 +529,7 @@ fn set_level(&mut self, lint: Lint, level: Level, src: LintSource) {
         }
     }
 
-    fn lint_to_str(&self, lint: Lint) -> &'static str {
+    fn lint_to_str(&self, lint: LintId) -> &'static str {
         for (k, v) in self.dict.iter() {
             if v.lint == lint {
                 return *k;
@@ -538,7 +538,7 @@ fn lint_to_str(&self, lint: Lint) -> &'static str {
         fail!("unregistered lint {}", lint);
     }
 
-    fn span_lint(&self, lint: Lint, span: Span, msg: &str) {
+    fn span_lint(&self, lint: LintId, span: Span, msg: &str) {
         let (level, src) = match self.cur.find(&(lint as uint)) {
             None => { return }
             Some(&(Warn, src)) => (self.get_level(Warnings), src),
index 1284992e150576c0e24acb15ed7b9c0defdf7b7e..97a884ae11dea0c9d2797b355f6e5bf3fa11efc8 100644 (file)
@@ -367,7 +367,7 @@ pub struct ctxt {
 
     pub dependency_formats: RefCell<dependency_format::Dependencies>,
 
-    pub node_lint_levels: RefCell<HashMap<(ast::NodeId, lint::Lint),
+    pub node_lint_levels: RefCell<HashMap<(ast::NodeId, lint::LintId),
                                           (lint::Level, lint::LintSource)>>,
 
     /// The types that must be asserted to be the same size for `transmute`