Skip to content

Commit 72d3d26

Browse files
author
Keegan McAllister
committed
---
yaml --- r: 118961 b: refs/heads/master c: 7e694e7 h: refs/heads/master i: 118959: eed1b69 v: v3
1 parent cc0391e commit 72d3d26

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7dc724bf8868fbcc0adf02ab644a0175273845c6
2+
refs/heads/master: 7e694e71153ebc8d3f2be9c20783bb283e38a59e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 71fe44def9676d519f5ce5d7304e581a42cf2c70
55
refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f

trunk/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

trunk/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)