pub fn query_ensure_error_guaranteed<'tcx, Cache, T>(
    tcx: TyCtxt<'tcx>,
    execute_query: fn(_: TyCtxt<'tcx>, _: Span, _: Cache::Key, _: QueryMode) -> Option<Cache::Value>,
    query_cache: &Cache,
    key: Cache::Key,
    check_cache: bool
) -> Result<(), ErrorGuaranteed>