Skip to content

Commit 75db66e

Browse files
author
Keegan McAllister
committed
---
yaml --- r: 152799 b: refs/heads/try2 c: 7e694e7 h: refs/heads/master i: 152797: bcc1e13 152795: 8932d74 152791: ae09941 152783: 5a02e13 152767: 99960f1 v: v3
1 parent 957a5b8 commit 75db66e

File tree

3 files changed

+8
-28
lines changed

3 files changed

+8
-28
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 7dc724bf8868fbcc0adf02ab644a0175273845c6
8+
refs/heads/try2: 7e694e71153ebc8d3f2be9c20783bb283e38a59e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/lint/builtin.rs

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,8 @@ impl LintPass for MissingDoc {
13581358
declare_lint!(DEPRECATED, Warn,
13591359
"detects use of #[deprecated] items")
13601360

1361-
declare_lint!(EXPERIMENTAL, Warn,
1361+
// FIXME #6875: Change to Warn after std library stabilization is complete
1362+
declare_lint!(EXPERIMENTAL, Allow,
13621363
"detects use of #[experimental] items")
13631364

13641365
declare_lint!(UNSTABLE, Allow,
@@ -1411,32 +1412,11 @@ impl LintPass for Stability {
14111412
_ => return
14121413
};
14131414

1414-
let stability = if ast_util::is_local(id) {
1415-
// this crate
1416-
let s = cx.tcx.map.with_attrs(id.node, |attrs| {
1417-
attrs.map(|a| attr::find_stability(a.as_slice()))
1418-
});
1419-
match s {
1420-
Some(s) => s,
1415+
// stability attributes are promises made across crates; do not
1416+
// check anything for crate-local usage.
1417+
if ast_util::is_local(id) { return }
14211418

1422-
// no possibility of having attributes
1423-
// (e.g. it's a local variable), so just
1424-
// ignore it.
1425-
None => return
1426-
}
1427-
} else {
1428-
// cross-crate
1429-
1430-
let mut s = None;
1431-
// run through all the attributes and take the first
1432-
// stability one.
1433-
csearch::get_item_attrs(&cx.sess().cstore, id, |attrs| {
1434-
if s.is_none() {
1435-
s = attr::find_stability(attrs.as_slice())
1436-
}
1437-
});
1438-
s
1439-
};
1419+
let stability = cx.tcx.stability.borrow_mut().lookup(&cx.tcx.sess.cstore, id);
14401420

14411421
let (lint, label) = match stability {
14421422
// no stability attributes == Unstable

branches/try2/src/librustc/lint/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ impl<'a> Context<'a> {
411411
impl<'a> AstConv for Context<'a>{
412412
fn tcx<'a>(&'a self) -> &'a ty::ctxt { self.tcx }
413413

414-
fn get_item_ty(&self, id: ast::DefId) -> ty::ty_param_bounds_and_ty {
414+
fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype {
415415
ty::lookup_item_type(self.tcx, id)
416416
}
417417

0 commit comments

Comments
 (0)