about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKeegan McAllister <kmcallister@mozilla.com>2014-06-24 10:29:08 -0700
committerKeegan McAllister <kmcallister@mozilla.com>2014-06-24 11:36:28 -0700
commit7e694e71153ebc8d3f2be9c20783bb283e38a59e (patch)
tree5c1f1efdc66935e86702633cd880a0afebc94acb /src
parent7dc724bf8868fbcc0adf02ab644a0175273845c6 (diff)
downloadrust-7e694e71153ebc8d3f2be9c20783bb283e38a59e.tar.gz
rust-7e694e71153ebc8d3f2be9c20783bb283e38a59e.zip
More upstream lint changes
Diffstat (limited to 'src')
-rw-r--r--src/librustc/lint/builtin.rs32
-rw-r--r--src/librustc/lint/context.rs2
2 files changed, 7 insertions, 27 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs
index 0a1f83fc79d..5078ae80d75 100644
--- a/src/librustc/lint/builtin.rs
+++ b/src/librustc/lint/builtin.rs
@@ -1358,7 +1358,8 @@ impl LintPass for MissingDoc {
 declare_lint!(DEPRECATED, Warn,
               "detects use of #[deprecated] items")
 
-declare_lint!(EXPERIMENTAL, Warn,
+// FIXME #6875: Change to Warn after std library stabilization is complete
+declare_lint!(EXPERIMENTAL, Allow,
               "detects use of #[experimental] items")
 
 declare_lint!(UNSTABLE, Allow,
@@ -1411,32 +1412,11 @@ impl LintPass for Stability {
             _ => return
         };
 
-        let stability = if ast_util::is_local(id) {
-            // this crate
-            let s = cx.tcx.map.with_attrs(id.node, |attrs| {
-                attrs.map(|a| attr::find_stability(a.as_slice()))
-            });
-            match s {
-                Some(s) => s,
+        // stability attributes are promises made across crates; do not
+        // check anything for crate-local usage.
+        if ast_util::is_local(id) { return }
 
-                // no possibility of having attributes
-                // (e.g. it's a local variable), so just
-                // ignore it.
-                None => return
-            }
-        } else {
-            // cross-crate
-
-            let mut s = None;
-            // run through all the attributes and take the first
-            // stability one.
-            csearch::get_item_attrs(&cx.sess().cstore, id, |attrs| {
-                if s.is_none() {
-                    s = attr::find_stability(attrs.as_slice())
-                }
-            });
-            s
-        };
+        let stability = cx.tcx.stability.borrow_mut().lookup(&cx.tcx.sess.cstore, id);
 
         let (lint, label) = match stability {
             // no stability attributes == Unstable
diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs
index 3ba948786d0..79fbd73c23d 100644
--- a/src/librustc/lint/context.rs
+++ b/src/librustc/lint/context.rs
@@ -411,7 +411,7 @@ impl<'a> Context<'a> {
 impl<'a> AstConv for Context<'a>{
     fn tcx<'a>(&'a self) -> &'a ty::ctxt { self.tcx }
 
-    fn get_item_ty(&self, id: ast::DefId) -> ty::ty_param_bounds_and_ty {
+    fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype {
         ty::lookup_item_type(self.tcx, id)
     }