We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30f168e commit ca64815Copy full SHA for ca64815
compiler/rustc_middle/src/ty/context.rs
@@ -1327,6 +1327,9 @@ pub struct TyCtxt<'tcx> {
1327
gcx: &'tcx GlobalCtxt<'tcx>,
1328
}
1329
1330
+// Explicitly implement `DynSync` and `DynSend` for `TyCtxt` to short circuit trait resolution.
1331
+unsafe impl DynSend for TyCtxt<'_> {}
1332
+unsafe impl DynSync for TyCtxt<'_> {}
1333
fn _assert_tcx_fields() {
1334
sync::assert_dyn_sync::<&'_ GlobalCtxt<'_>>();
1335
sync::assert_dyn_send::<&'_ GlobalCtxt<'_>>();
0 commit comments