@@ -26,7 +26,7 @@ use lint::{self, Lint};
26
26
use ich:: { StableHashingContext , NodeIdHashingMode } ;
27
27
use infer:: canonical:: { CanonicalVarInfo , CanonicalVarInfos } ;
28
28
use infer:: outlives:: free_region_map:: FreeRegionMap ;
29
- use middle:: cstore:: { CrateStore , LinkMeta } ;
29
+ use middle:: cstore:: { CrateStoreDyn , LinkMeta } ;
30
30
use middle:: cstore:: EncodedMetadata ;
31
31
use middle:: lang_items;
32
32
use middle:: resolve_lifetime:: { self , ObjectLifetimeDefault } ;
@@ -852,7 +852,7 @@ pub struct GlobalCtxt<'tcx> {
852
852
global_arenas : & ' tcx GlobalArenas < ' tcx > ,
853
853
global_interners : CtxtInterners < ' tcx > ,
854
854
855
- cstore : & ' tcx dyn CrateStore ,
855
+ cstore : & ' tcx CrateStoreDyn ,
856
856
857
857
pub sess : & ' tcx Session ,
858
858
@@ -1188,7 +1188,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
1188
1188
/// value (types, substs, etc.) can only be used while `ty::tls` has a valid
1189
1189
/// reference to the context, to allow formatting values that need it.
1190
1190
pub fn create_and_enter < F , R > ( s : & ' tcx Session ,
1191
- cstore : & ' tcx dyn CrateStore ,
1191
+ cstore : & ' tcx CrateStoreDyn ,
1192
1192
local_providers : ty:: maps:: Providers < ' tcx > ,
1193
1193
extern_providers : ty:: maps:: Providers < ' tcx > ,
1194
1194
arenas : & ' tcx AllArenas < ' tcx > ,
@@ -1800,9 +1800,11 @@ pub mod tls {
1800
1800
/// in librustc otherwise. It is used to when diagnostic messages are
1801
1801
/// emitted and stores them in the current query, if there is one.
1802
1802
fn track_diagnostic ( diagnostic : & Diagnostic ) {
1803
- with_context ( |context| {
1804
- if let Some ( ref query) = context. query {
1805
- query. diagnostics . lock ( ) . push ( diagnostic. clone ( ) ) ;
1803
+ with_context_opt ( |icx| {
1804
+ if let Some ( icx) = icx {
1805
+ if let Some ( ref query) = icx. query {
1806
+ query. diagnostics . lock ( ) . push ( diagnostic. clone ( ) ) ;
1807
+ }
1806
1808
}
1807
1809
} )
1808
1810
}
0 commit comments