@@ -61,7 +61,7 @@ use rustc_hir::def_id::{DefId, LOCAL_CRATE};
6161use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
6262use rustc_hir:: Node ;
6363use rustc_hir:: {
64- def, Arm , Block , Body , Constness , Crate , Expr , ExprKind , FnDecl , HirId , ImplItem , ImplItemKind , Item , ItemKind ,
64+ def, Arm , Block , Body , Constness , Expr , ExprKind , FnDecl , HirId , ImplItem , ImplItemKind , Item , ItemKind ,
6565 MatchSource , Param , Pat , PatKind , Path , PathSegment , QPath , TraitItem , TraitItemKind , TraitRef , TyKind , Unsafety ,
6666} ;
6767use rustc_infer:: infer:: TyCtxtInferExt ;
@@ -1510,8 +1510,8 @@ pub fn is_must_use_func_call(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
15101510 did. map_or ( false , |did| must_use_attr ( & cx. tcx . get_attrs ( did) ) . is_some ( ) )
15111511}
15121512
1513- pub fn is_no_std_crate ( krate : & Crate < ' _ > ) -> bool {
1514- krate . item . attrs . iter ( ) . any ( |attr| {
1513+ pub fn is_no_std_crate ( cx : & LateContext < ' _ > ) -> bool {
1514+ cx . tcx . hir ( ) . attrs ( hir :: CRATE_HIR_ID ) . iter ( ) . any ( |attr| {
15151515 if let ast:: AttrKind :: Normal ( ref attr, _) = attr. kind {
15161516 attr. path == sym:: no_std
15171517 } else {
0 commit comments