@@ -1358,7 +1358,8 @@ impl LintPass for MissingDoc {
13581358declare_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
13641365declare_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
0 commit comments