@@ -1358,7 +1358,8 @@ impl LintPass for MissingDoc {
1358
1358
declare_lint ! ( DEPRECATED , Warn ,
1359
1359
"detects use of #[deprecated] items" )
1360
1360
1361
- declare_lint ! ( EXPERIMENTAL , Warn ,
1361
+ // FIXME #6875: Change to Warn after std library stabilization is complete
1362
+ declare_lint ! ( EXPERIMENTAL , Allow ,
1362
1363
"detects use of #[experimental] items" )
1363
1364
1364
1365
declare_lint ! ( UNSTABLE , Allow ,
@@ -1411,32 +1412,11 @@ impl LintPass for Stability {
1411
1412
_ => return
1412
1413
} ;
1413
1414
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 }
1421
1418
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) ;
1440
1420
1441
1421
let ( lint, label) = match stability {
1442
1422
// no stability attributes == Unstable
0 commit comments