@@ -8,7 +8,6 @@ use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceC
88use rustc_middle:: mir:: * ;
99use rustc_middle:: ty:: cast:: CastTy ;
1010use rustc_middle:: ty:: { self , Instance , InstanceDef , TyCtxt } ;
11- use rustc_span:: symbol:: sym;
1211use rustc_span:: Span ;
1312use rustc_trait_selection:: traits:: error_reporting:: InferCtxtExt ;
1413use rustc_trait_selection:: traits:: { self , TraitEngine } ;
@@ -224,7 +223,7 @@ impl Validator<'mir, 'tcx> {
224223
225224 // Ensure that the end result is `Sync` in a non-thread local `static`.
226225 let should_check_for_sync =
227- const_kind == Some ( ConstKind :: Static ) && !tcx. has_attr ( def_id, sym :: thread_local ) ;
226+ const_kind == Some ( ConstKind :: Static ) && !tcx. is_thread_local_static ( def_id) ;
228227
229228 if should_check_for_sync {
230229 let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
@@ -267,8 +266,7 @@ impl Validator<'mir, 'tcx> {
267266 }
268267
269268 fn check_static ( & mut self , def_id : DefId , span : Span ) {
270- let is_thread_local = self . tcx . has_attr ( def_id, sym:: thread_local) ;
271- if is_thread_local {
269+ if self . tcx . is_thread_local_static ( def_id) {
272270 self . check_op_spanned ( ops:: ThreadLocalAccess , span)
273271 } else {
274272 self . check_op_spanned ( ops:: StaticAccess , span)
0 commit comments