From 7d6bbe2df788d9c23aef1384bc1c8b240253ae7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Thu, 6 Mar 2025 09:21:37 +0000 Subject: [PATCH] expand comments of `TyCtxt` impl of `DynSync`/`DynSend` so that it doesn't get removed again --- compiler/rustc_middle/src/ty/context.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 2d2bbd22b98..4013f7b2c85 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1327,7 +1327,9 @@ pub struct TyCtxt<'tcx> { gcx: &'tcx GlobalCtxt<'tcx>, } -// Explicitly implement `DynSync` and `DynSend` for `TyCtxt` to short circuit trait resolution. +// Explicitly implement `DynSync` and `DynSend` for `TyCtxt` to short circuit trait resolution. Its +// field are asserted to implement these traits below, so this is trivially safe, and it greatly +// speeds-up compilation of this crate and its dependents. unsafe impl DynSend for TyCtxt<'_> {} unsafe impl DynSync for TyCtxt<'_> {} fn _assert_tcx_fields() {