From 5e886ad95368fafb5bf2104faf53081007654820 Mon Sep 17 00:00:00 2001 From: Matt Kneiser Date: Thu, 23 May 2024 10:17:58 -0700 Subject: [PATCH] SERVER-90645 Enable tidy check misc-unused-using-decls (#22430) Co-authored-by: Benety Goh GitOrigin-RevId: e97b100882e14cca504952d321cedfb135321240 --- .clang-tidy.in | 1 + src/mongo/bson/bson_validate_test.cpp | 1 - src/mongo/bson/bsonelement.cpp | 2 -- src/mongo/client/authenticate.cpp | 1 - src/mongo/client/connpool.cpp | 3 --- src/mongo/client/dbclient_base.cpp | 2 -- src/mongo/client/dbclient_connection.cpp | 3 --- src/mongo/client/dbclient_cursor.cpp | 1 - src/mongo/client/dbclient_rs.cpp | 2 -- src/mongo/client/dbclient_rs_test.cpp | 3 --- src/mongo/client/dbclient_session.cpp | 3 --- src/mongo/client/fetcher.cpp | 1 - src/mongo/client/replica_set_monitor.cpp | 1 - src/mongo/client/replica_set_monitor_manager.cpp | 2 -- src/mongo/client/sasl_client_authenticate_impl.cpp | 2 -- src/mongo/client/sasl_scram_client_conversation.cpp | 1 - src/mongo/client/server_discovery_monitor.cpp | 1 - src/mongo/client/server_discovery_monitor_test.cpp | 1 - src/mongo/client/server_ping_monitor.cpp | 3 --- src/mongo/client/server_ping_monitor_test.cpp | 1 - src/mongo/db/auth/auth_op_observer_test.cpp | 2 -- src/mongo/db/commands/rename_collection_cmd.cpp | 1 - src/mongo/db/commands/test_commands.cpp | 1 - src/mongo/db/dbhelpers.cpp | 1 - src/mongo/db/exec/and_hash.cpp | 1 - src/mongo/db/exec/and_sorted.cpp | 1 - src/mongo/db/exec/collection_scan.cpp | 1 - src/mongo/db/exec/count.cpp | 1 - src/mongo/db/exec/count_scan.cpp | 1 - src/mongo/db/exec/delete_stage.cpp | 1 - src/mongo/db/exec/distinct_scan.cpp | 1 - src/mongo/db/exec/eof.cpp | 1 - src/mongo/db/exec/fetch.cpp | 1 - src/mongo/db/exec/idhack.cpp | 1 - src/mongo/db/exec/limit.cpp | 1 - src/mongo/db/exec/merge_sort.cpp | 2 -- src/mongo/db/exec/multi_iterator.cpp | 1 - src/mongo/db/exec/near.cpp | 1 - src/mongo/db/exec/or.cpp | 1 - src/mongo/db/exec/queued_data_stage.cpp | 1 - src/mongo/db/exec/shard_filter.cpp | 2 -- src/mongo/db/exec/skip.cpp | 1 - src/mongo/db/exec/subplan.cpp | 1 - src/mongo/db/exec/text_match.cpp | 1 - src/mongo/db/exec/text_or.cpp | 2 -- src/mongo/db/geo/big_polygon_test.cpp | 1 - src/mongo/db/geo/hash_test.cpp | 2 -- src/mongo/db/hasher.cpp | 2 -- src/mongo/db/index/btree_key_generator_test.cpp | 3 --- src/mongo/db/matcher/expression_bitset_tree_converter.cpp | 1 - src/mongo/db/matcher/expression_expr_test.cpp | 1 - src/mongo/db/matcher/expression_optimize_test.cpp | 1 - src/mongo/db/matcher/expression_parser_leaf_test.cpp | 1 - src/mongo/db/matcher/expression_restorer.cpp | 1 - src/mongo/db/matcher/expression_restorer_test.cpp | 1 - src/mongo/db/matcher/expression_serialization_test.cpp | 1 - .../schema/expression_internal_schema_xor_test.cpp | 1 - src/mongo/db/op_observer/op_observer_impl.cpp | 1 - src/mongo/db/pipeline/dependencies_test.cpp | 1 - .../document_source_change_stream_add_post_image_test.cpp | 2 -- src/mongo/db/pipeline/document_source_cursor.cpp | 1 - .../db/pipeline/document_source_merge_cursors_test.cpp | 2 -- src/mongo/db/pipeline/document_source_project_test.cpp | 1 - src/mongo/db/pipeline/expression_object_test.cpp | 1 - src/mongo/db/pipeline/expression_trigonometric_test.cpp | 1 - src/mongo/db/pipeline/expression_trim_test.cpp | 1 - src/mongo/db/pipeline/field_path_test.cpp | 1 - .../pipeline/granularity_rounder_powers_of_two_test.cpp | 1 - src/mongo/db/pipeline/pipeline.cpp | 1 - src/mongo/db/pipeline/pipeline_d.cpp | 2 -- .../db/pipeline/search/document_source_vector_search.cpp | 1 - .../search/document_source_vector_search_test.cpp | 1 - .../pipeline/single_document_transformation_processor.cpp | 1 - src/mongo/db/pipeline/unwind_processor.cpp | 2 -- src/mongo/db/pipeline/window_function/window_bounds.cpp | 1 - src/mongo/db/process_health/fault_manager_test.cpp | 1 - src/mongo/db/process_health/fault_state_machine_test.cpp | 1 - src/mongo/db/query/ce/maxdiff_histogram_test.cpp | 2 -- src/mongo/db/query/cqf_get_executor.cpp | 1 - src/mongo/db/query/find.cpp | 1 - src/mongo/db/query/optimizer/rewrites/proj_spec_test.cpp | 1 - src/mongo/db/query/plan_cache_key_info_test.cpp | 1 - src/mongo/db/query/plan_enumerator/plan_enumerator.cpp | 1 - src/mongo/db/query/plan_executor_impl.cpp | 1 - src/mongo/db/query/plan_ranker_test.cpp | 1 - src/mongo/db/query/planner_analysis.cpp | 1 - src/mongo/db/query/projection_test.cpp | 1 - src/mongo/db/query/query_planner.cpp | 1 - src/mongo/db/query/query_planner_test_fixture.cpp | 1 - src/mongo/db/query/query_request_test.cpp | 1 - src/mongo/db/query/stats/stats_cache_test.cpp | 1 - src/mongo/db/repl/repl_set_config_checks_test.cpp | 1 - src/mongo/db/repl/repl_set_heartbeat_response_test.cpp | 1 - src/mongo/db/repl/replication_coordinator_impl.cpp | 1 - .../repl/replication_coordinator_impl_reconfig_test.cpp | 1 - src/mongo/db/repl/replication_coordinator_impl_test.cpp | 1 - src/mongo/db/repl/reporter_test.cpp | 1 - src/mongo/db/repl/rollback_checker_test.cpp | 2 -- src/mongo/db/repl/rs_rollback.cpp | 2 -- src/mongo/db/repl/tenant_file_importer_service_test.cpp | 2 -- .../db/repl/tenant_oplog_applier_shard_merge_test.cpp | 2 -- src/mongo/db/repl/tenant_oplog_applier_test.cpp | 2 -- src/mongo/db/repl/tenant_oplog_batcher_test.cpp | 2 -- src/mongo/db/repl/vote_requester_test.cpp | 1 - .../db/s/balancer/balancer_commands_scheduler_test.cpp | 1 - src/mongo/db/s/balancer/balancer_policy.cpp | 2 -- src/mongo/db/s/balancer/migration_test_fixture.cpp | 1 - src/mongo/db/s/collection_metadata_test.cpp | 1 - src/mongo/db/s/config/config_server_test_fixture.cpp | 3 --- src/mongo/db/s/config/initial_split_policy.cpp | 1 - .../s/config/sharding_catalog_manager_add_shard_test.cpp | 1 - .../sharding_catalog_manager_clear_jumbo_flag_test.cpp | 1 - .../config/sharding_catalog_manager_remove_shard_test.cpp | 3 --- src/mongo/db/s/metadata_manager_test.cpp | 1 - src/mongo/db/s/migration_destination_manager_test.cpp | 1 - src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp | 2 -- src/mongo/db/s/sharding_mongod_test_fixture.cpp | 2 -- src/mongo/db/s/type_shard_collection_test.cpp | 1 - src/mongo/db/session/logical_session_cache_test.cpp | 1 - src/mongo/db/update/addtoset_node_test.cpp | 2 -- src/mongo/db/update/compare_node_test.cpp | 2 -- src/mongo/db/update/field_checker_test.cpp | 1 - src/mongo/db/update/modifier_table_test.cpp | 1 - src/mongo/db/update/object_replace_executor_test.cpp | 2 -- src/mongo/db/update/object_transform_executor_test.cpp | 2 -- src/mongo/db/update/pullall_node_test.cpp | 2 -- src/mongo/db/update/push_node_test.cpp | 2 -- src/mongo/db/update/rename_node_test.cpp | 2 -- src/mongo/db/update/set_node_test.cpp | 1 - src/mongo/dbtests/basictests.cpp | 2 -- src/mongo/dbtests/documentsourcetests.cpp | 1 - src/mongo/dbtests/mock_replica_set_test.cpp | 1 - src/mongo/dbtests/query_plan_executor.cpp | 1 - src/mongo/rpc/metadata_test.cpp | 1 - src/mongo/rpc/object_check_test.cpp | 1 - src/mongo/s/catalog/sharding_catalog_client_test.cpp | 3 --- src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp | 5 ----- src/mongo/s/catalog/type_collection_test.cpp | 1 - src/mongo/s/cluster_identity_loader_test.cpp | 3 --- src/mongo/s/collection_routing_info_targeter_test.cpp | 1 - src/mongo/s/commands/cluster_user_management_commands.cpp | 1 - src/mongo/s/request_types/merge_chunks_request_test.cpp | 1 - src/mongo/s/routing_table_history_test.cpp | 1 - src/mongo/s/sharding_mongos_test_fixture.cpp | 2 -- src/mongo/s/sharding_test_fixture_common.cpp | 1 - src/mongo/shell/linenoise.cpp | 1 - src/mongo/shell/program_runner.cpp | 3 +-- src/mongo/shell/shell_utils_launcher.cpp | 8 ++------ src/mongo/transport/service_executor_test.cpp | 1 - src/mongo/util/options_parser/environment.cpp | 1 - src/mongo/util/options_parser/environment_test.cpp | 1 - src/mongo/util/processinfo_test.cpp | 1 - src/mongo/util/read_through_cache_test.cpp | 2 -- 153 files changed, 4 insertions(+), 217 deletions(-) diff --git a/.clang-tidy.in b/.clang-tidy.in index a3c570bf646..d5d71725e5e 100644 --- a/.clang-tidy.in +++ b/.clang-tidy.in @@ -37,6 +37,7 @@ Checks: '-*, misc-static-assert, misc-unconventional-assign-operator, misc-uniqueptr-reset-release, + misc-unused-using-decls, modernize-avoid-bind, modernize-deprecated-headers, modernize-make-shared, diff --git a/src/mongo/bson/bson_validate_test.cpp b/src/mongo/bson/bson_validate_test.cpp index a08d97b8913..dd190d4f3b0 100644 --- a/src/mongo/bson/bson_validate_test.cpp +++ b/src/mongo/bson/bson_validate_test.cpp @@ -73,7 +73,6 @@ namespace { using namespace mongo; -using std::endl; using std::unique_ptr; void appendInvalidStringElement(const char* fieldName, BufBuilder* bb) { diff --git a/src/mongo/bson/bsonelement.cpp b/src/mongo/bson/bsonelement.cpp index a72f59e3d00..a036d031a06 100644 --- a/src/mongo/bson/bsonelement.cpp +++ b/src/mongo/bson/bsonelement.cpp @@ -59,8 +59,6 @@ namespace mongo { -using std::dec; -using std::hex; using std::string; const double BSONElement::kLongLongMaxPlusOneAsDouble = diff --git a/src/mongo/client/authenticate.cpp b/src/mongo/client/authenticate.cpp index 50dfebd60db..cc8069b9cf8 100644 --- a/src/mongo/client/authenticate.cpp +++ b/src/mongo/client/authenticate.cpp @@ -70,7 +70,6 @@ namespace mongo { namespace auth { using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; using AuthRequest = StatusWith; diff --git a/src/mongo/client/connpool.cpp b/src/mongo/client/connpool.cpp index 713d2b3c619..5dfc98570b4 100644 --- a/src/mongo/client/connpool.cpp +++ b/src/mongo/client/connpool.cpp @@ -95,10 +95,7 @@ void recordWaitTime(PoolForHost& p, DBClientBase* conn, Date_t connRequestedAt) MONGO_FAIL_POINT_DEFINE(injectWaitTimeForConnpoolAcquisition); -using std::endl; using std::list; -using std::map; -using std::set; using std::string; using std::vector; diff --git a/src/mongo/client/dbclient_base.cpp b/src/mongo/client/dbclient_base.cpp index b34a3efc491..92a8410e95d 100644 --- a/src/mongo/client/dbclient_base.cpp +++ b/src/mongo/client/dbclient_base.cpp @@ -87,7 +87,6 @@ namespace mongo { -using std::endl; using std::list; using std::string; using std::stringstream; @@ -95,7 +94,6 @@ using std::unique_ptr; using std::vector; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; AtomicWord DBClientBase::ConnectionIdSequence; diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp index e657434f307..4602d4ce667 100644 --- a/src/mongo/client/dbclient_connection.cpp +++ b/src/mongo/client/dbclient_connection.cpp @@ -93,10 +93,7 @@ namespace mongo { -using std::endl; -using std::map; using std::string; -using std::unique_ptr; DBClientConnection::DBClientConnection(bool autoReconnect, double soTimeout, diff --git a/src/mongo/client/dbclient_cursor.cpp b/src/mongo/client/dbclient_cursor.cpp index 1b108912fff..5f8f14991b4 100644 --- a/src/mongo/client/dbclient_cursor.cpp +++ b/src/mongo/client/dbclient_cursor.cpp @@ -74,7 +74,6 @@ namespace mongo { -using std::endl; using std::string; using std::unique_ptr; using std::vector; diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp index d111d340433..99be4ee601b 100644 --- a/src/mongo/client/dbclient_rs.cpp +++ b/src/mongo/client/dbclient_rs.cpp @@ -67,8 +67,6 @@ namespace mongo { -using std::endl; -using std::map; using std::set; using std::shared_ptr; using std::string; diff --git a/src/mongo/client/dbclient_rs_test.cpp b/src/mongo/client/dbclient_rs_test.cpp index 4ee99461f1e..677faddf025 100644 --- a/src/mongo/client/dbclient_rs_test.cpp +++ b/src/mongo/client/dbclient_rs_test.cpp @@ -70,9 +70,6 @@ namespace mongo { namespace { -using std::make_pair; -using std::map; -using std::pair; using std::string; using std::unique_ptr; using std::vector; diff --git a/src/mongo/client/dbclient_session.cpp b/src/mongo/client/dbclient_session.cpp index ca1592af285..41dc28c1c8b 100644 --- a/src/mongo/client/dbclient_session.cpp +++ b/src/mongo/client/dbclient_session.cpp @@ -93,10 +93,7 @@ namespace mongo { -using std::endl; -using std::map; using std::string; -using std::unique_ptr; MONGO_FAIL_POINT_DEFINE(dbClientSessionDisableChecksum); diff --git a/src/mongo/client/fetcher.cpp b/src/mongo/client/fetcher.cpp index 9b20ff33eb9..54add4f7d0f 100644 --- a/src/mongo/client/fetcher.cpp +++ b/src/mongo/client/fetcher.cpp @@ -59,7 +59,6 @@ namespace mongo { namespace { using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; using RemoteCommandCallbackArgs = executor::TaskExecutor::RemoteCommandCallbackArgs; const char* kCursorFieldName = "cursor"; diff --git a/src/mongo/client/replica_set_monitor.cpp b/src/mongo/client/replica_set_monitor.cpp index 523a8be5493..24fb463f335 100644 --- a/src/mongo/client/replica_set_monitor.cpp +++ b/src/mongo/client/replica_set_monitor.cpp @@ -45,7 +45,6 @@ namespace mongo { -using std::numeric_limits; using std::set; using std::shared_ptr; using std::string; diff --git a/src/mongo/client/replica_set_monitor_manager.cpp b/src/mongo/client/replica_set_monitor_manager.cpp index 9c3973f770b..6c77c695d09 100644 --- a/src/mongo/client/replica_set_monitor_manager.cpp +++ b/src/mongo/client/replica_set_monitor_manager.cpp @@ -70,7 +70,6 @@ namespace mongo { -using std::set; using std::shared_ptr; using std::string; using std::vector; @@ -78,7 +77,6 @@ using std::vector; using executor::NetworkInterface; using executor::NetworkInterfaceThreadPool; using executor::TaskExecutor; -using executor::TaskExecutorPool; using executor::ThreadPoolTaskExecutor; namespace { diff --git a/src/mongo/client/sasl_client_authenticate_impl.cpp b/src/mongo/client/sasl_client_authenticate_impl.cpp index 2da9833e92d..49c45b9119c 100644 --- a/src/mongo/client/sasl_client_authenticate_impl.cpp +++ b/src/mongo/client/sasl_client_authenticate_impl.cpp @@ -80,8 +80,6 @@ namespace mongo { using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; -using std::endl; namespace { diff --git a/src/mongo/client/sasl_scram_client_conversation.cpp b/src/mongo/client/sasl_scram_client_conversation.cpp index e7ccae8ed5e..ed98bab7d27 100644 --- a/src/mongo/client/sasl_scram_client_conversation.cpp +++ b/src/mongo/client/sasl_scram_client_conversation.cpp @@ -49,7 +49,6 @@ namespace mongo { using std::string; -using std::unique_ptr; StatusWith SaslSCRAMClientConversation::step(StringData inputData, std::string* outputData) { _step++; diff --git a/src/mongo/client/server_discovery_monitor.cpp b/src/mongo/client/server_discovery_monitor.cpp index f32747f5110..d087ba574ca 100644 --- a/src/mongo/client/server_discovery_monitor.cpp +++ b/src/mongo/client/server_discovery_monitor.cpp @@ -72,7 +72,6 @@ namespace { MONGO_FAIL_POINT_DEFINE(overrideMaxAwaitTimeMS); -using executor::NetworkInterface; using executor::NetworkInterfaceThreadPool; using executor::TaskExecutor; using executor::ThreadPoolTaskExecutor; diff --git a/src/mongo/client/server_discovery_monitor_test.cpp b/src/mongo/client/server_discovery_monitor_test.cpp index 66e34fc50c2..bc7021763e2 100644 --- a/src/mongo/client/server_discovery_monitor_test.cpp +++ b/src/mongo/client/server_discovery_monitor_test.cpp @@ -76,7 +76,6 @@ namespace { using executor::NetworkInterfaceMock; using executor::RemoteCommandResponse; -using executor::ThreadPoolExecutorTest; using InNetworkGuard = NetworkInterfaceMock::InNetworkGuard; class ServerDiscoveryMonitorTestFixture : public unittest::Test { diff --git a/src/mongo/client/server_ping_monitor.cpp b/src/mongo/client/server_ping_monitor.cpp index 5d18183dc25..3c289226607 100644 --- a/src/mongo/client/server_ping_monitor.cpp +++ b/src/mongo/client/server_ping_monitor.cpp @@ -69,10 +69,7 @@ namespace mongo { MONGO_FAIL_POINT_DEFINE(serverPingMonitorFailWithHostUnreachable); MONGO_FAIL_POINT_DEFINE(serverPingMonitorSetRTT); -using executor::NetworkInterface; -using executor::NetworkInterfaceThreadPool; using executor::TaskExecutor; -using executor::ThreadPoolTaskExecutor; using CallbackArgs = TaskExecutor::CallbackArgs; using CallbackHandle = TaskExecutor::CallbackHandle; diff --git a/src/mongo/client/server_ping_monitor_test.cpp b/src/mongo/client/server_ping_monitor_test.cpp index 17224d41647..06cece1c767 100644 --- a/src/mongo/client/server_ping_monitor_test.cpp +++ b/src/mongo/client/server_ping_monitor_test.cpp @@ -75,7 +75,6 @@ namespace { const sdam::HelloRTT initialRTT = duration_cast(Milliseconds(100)); using executor::NetworkInterfaceMock; using executor::RemoteCommandResponse; -using executor::ThreadPoolExecutorTest; using InNetworkGuard = NetworkInterfaceMock::InNetworkGuard; class ServerPingMonitorTestFixture : public unittest::Test { diff --git a/src/mongo/db/auth/auth_op_observer_test.cpp b/src/mongo/db/auth/auth_op_observer_test.cpp index 488a7b59fa3..e00c80db6eb 100644 --- a/src/mongo/db/auth/auth_op_observer_test.cpp +++ b/src/mongo/db/auth/auth_op_observer_test.cpp @@ -67,8 +67,6 @@ namespace mongo { namespace { -using repl::OplogEntry; -using unittest::assertGet; class AuthOpObserverTest : public ServiceContextMongoDTest { public: diff --git a/src/mongo/db/commands/rename_collection_cmd.cpp b/src/mongo/db/commands/rename_collection_cmd.cpp index 56a97de26a5..c9166c4d7af 100644 --- a/src/mongo/db/commands/rename_collection_cmd.cpp +++ b/src/mongo/db/commands/rename_collection_cmd.cpp @@ -54,7 +54,6 @@ namespace mongo { -using std::min; using std::string; using std::stringstream; diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp index 22f6376992e..73550ad153f 100644 --- a/src/mongo/db/commands/test_commands.cpp +++ b/src/mongo/db/commands/test_commands.cpp @@ -92,7 +92,6 @@ namespace { const std::string kTestingDurableHistoryPinName = "_testing"; using repl::UnreplicatedWritesBlock; -using std::endl; using std::string; using std::stringstream; diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 65e0ee71d8c..b01f89531cc 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -80,7 +80,6 @@ namespace mongo { -using std::set; using std::string; using std::unique_ptr; diff --git a/src/mongo/db/exec/and_hash.cpp b/src/mongo/db/exec/and_hash.cpp index 34ade944a26..0dcf9baecda 100644 --- a/src/mongo/db/exec/and_hash.cpp +++ b/src/mongo/db/exec/and_hash.cpp @@ -53,7 +53,6 @@ const size_t kDefaultMaxMemUsageBytes = 32 * 1024 * 1024; namespace mongo { using std::unique_ptr; -using std::vector; const size_t AndHashStage::kLookAheadWorks = 10; diff --git a/src/mongo/db/exec/and_sorted.cpp b/src/mongo/db/exec/and_sorted.cpp index ba61aeb4d91..fff65c4402d 100644 --- a/src/mongo/db/exec/and_sorted.cpp +++ b/src/mongo/db/exec/and_sorted.cpp @@ -42,7 +42,6 @@ namespace mongo { using std::numeric_limits; using std::unique_ptr; -using std::vector; // static const char* AndSortedStage::kStageType = "AND_SORTED"; diff --git a/src/mongo/db/exec/collection_scan.cpp b/src/mongo/db/exec/collection_scan.cpp index afa0dc1b9f7..681a65f654f 100644 --- a/src/mongo/db/exec/collection_scan.cpp +++ b/src/mongo/db/exec/collection_scan.cpp @@ -73,7 +73,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; namespace { bool shouldIncludeStartRecord(const CollectionScanParams& params) { diff --git a/src/mongo/db/exec/count.cpp b/src/mongo/db/exec/count.cpp index 5fda174541e..5c7c72ecf86 100644 --- a/src/mongo/db/exec/count.cpp +++ b/src/mongo/db/exec/count.cpp @@ -38,7 +38,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; // static const char* CountStage::kStageType = "COUNT"; diff --git a/src/mongo/db/exec/count_scan.cpp b/src/mongo/db/exec/count_scan.cpp index f2974274b9f..24f7705961c 100644 --- a/src/mongo/db/exec/count_scan.cpp +++ b/src/mongo/db/exec/count_scan.cpp @@ -81,7 +81,6 @@ bool isCompoundWildcardIndex(const IndexDescriptor* indexDescriptor) { } // namespace using std::unique_ptr; -using std::vector; // static const char* CountScan::kStageType = "COUNT_SCAN"; diff --git a/src/mongo/db/exec/delete_stage.cpp b/src/mongo/db/exec/delete_stage.cpp index bb2a484e755..963b8197b29 100644 --- a/src/mongo/db/exec/delete_stage.cpp +++ b/src/mongo/db/exec/delete_stage.cpp @@ -66,7 +66,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; namespace { diff --git a/src/mongo/db/exec/distinct_scan.cpp b/src/mongo/db/exec/distinct_scan.cpp index a288a0abf7c..a24edf94b48 100644 --- a/src/mongo/db/exec/distinct_scan.cpp +++ b/src/mongo/db/exec/distinct_scan.cpp @@ -48,7 +48,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; // static const char* DistinctScan::kStageType = "DISTINCT_SCAN"; diff --git a/src/mongo/db/exec/eof.cpp b/src/mongo/db/exec/eof.cpp index d9c4dcb6402..6fb5d76c441 100644 --- a/src/mongo/db/exec/eof.cpp +++ b/src/mongo/db/exec/eof.cpp @@ -35,7 +35,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; // static const char* EOFStage::kStageType = "EOF"; diff --git a/src/mongo/db/exec/fetch.cpp b/src/mongo/db/exec/fetch.cpp index c627121fa7b..6d4b23d46ef 100644 --- a/src/mongo/db/exec/fetch.cpp +++ b/src/mongo/db/exec/fetch.cpp @@ -42,7 +42,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; // static const char* FetchStage::kStageType = "FETCH"; diff --git a/src/mongo/db/exec/idhack.cpp b/src/mongo/db/exec/idhack.cpp index 84aec981fc0..e4cce7ae8f1 100644 --- a/src/mongo/db/exec/idhack.cpp +++ b/src/mongo/db/exec/idhack.cpp @@ -51,7 +51,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; // static const char* IDHackStage::kStageType = "IDHACK"; diff --git a/src/mongo/db/exec/limit.cpp b/src/mongo/db/exec/limit.cpp index cdb43abe29b..c9d77081b9a 100644 --- a/src/mongo/db/exec/limit.cpp +++ b/src/mongo/db/exec/limit.cpp @@ -36,7 +36,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; // static const char* LimitStage::kStageType = "LIMIT"; diff --git a/src/mongo/db/exec/merge_sort.cpp b/src/mongo/db/exec/merge_sort.cpp index 30848069fc2..d8a7e0e1c12 100644 --- a/src/mongo/db/exec/merge_sort.cpp +++ b/src/mongo/db/exec/merge_sort.cpp @@ -44,10 +44,8 @@ namespace mongo { -using std::list; using std::string; using std::unique_ptr; -using std::vector; // static const char* MergeSortStage::kStageType = "SORT_MERGE"; diff --git a/src/mongo/db/exec/multi_iterator.cpp b/src/mongo/db/exec/multi_iterator.cpp index b725ba17218..65881166dff 100644 --- a/src/mongo/db/exec/multi_iterator.cpp +++ b/src/mongo/db/exec/multi_iterator.cpp @@ -45,7 +45,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; const char* MultiIteratorStage::kStageType = "MULTI_ITERATOR"; diff --git a/src/mongo/db/exec/near.cpp b/src/mongo/db/exec/near.cpp index c0862fdd063..432048bd1b8 100644 --- a/src/mongo/db/exec/near.cpp +++ b/src/mongo/db/exec/near.cpp @@ -40,7 +40,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; /** * Holds a generic search result with a distance computed in some fashion. diff --git a/src/mongo/db/exec/or.cpp b/src/mongo/db/exec/or.cpp index 00c21ecbb0c..831b0973b01 100644 --- a/src/mongo/db/exec/or.cpp +++ b/src/mongo/db/exec/or.cpp @@ -42,7 +42,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; // static const char* OrStage::kStageType = "OR"; diff --git a/src/mongo/db/exec/queued_data_stage.cpp b/src/mongo/db/exec/queued_data_stage.cpp index d2f183263db..f58cc598501 100644 --- a/src/mongo/db/exec/queued_data_stage.cpp +++ b/src/mongo/db/exec/queued_data_stage.cpp @@ -35,7 +35,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; const char* QueuedDataStage::kStageType = "QUEUED_DATA"; diff --git a/src/mongo/db/exec/shard_filter.cpp b/src/mongo/db/exec/shard_filter.cpp index 118da657790..40bde1c6897 100644 --- a/src/mongo/db/exec/shard_filter.cpp +++ b/src/mongo/db/exec/shard_filter.cpp @@ -49,9 +49,7 @@ namespace mongo { -using std::shared_ptr; using std::unique_ptr; -using std::vector; // static const char* ShardFilterStage::kStageType = "SHARDING_FILTER"; diff --git a/src/mongo/db/exec/skip.cpp b/src/mongo/db/exec/skip.cpp index 578582c09c8..c65f8e2f953 100644 --- a/src/mongo/db/exec/skip.cpp +++ b/src/mongo/db/exec/skip.cpp @@ -36,7 +36,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; // static const char* SkipStage::kStageType = "SKIP"; diff --git a/src/mongo/db/exec/subplan.cpp b/src/mongo/db/exec/subplan.cpp index 9349c9ca46e..7bdaa07b9a7 100644 --- a/src/mongo/db/exec/subplan.cpp +++ b/src/mongo/db/exec/subplan.cpp @@ -56,7 +56,6 @@ namespace mongo { -using std::endl; using std::unique_ptr; using std::vector; diff --git a/src/mongo/db/exec/text_match.cpp b/src/mongo/db/exec/text_match.cpp index b36c1c413d6..d81ff99810d 100644 --- a/src/mongo/db/exec/text_match.cpp +++ b/src/mongo/db/exec/text_match.cpp @@ -41,7 +41,6 @@ namespace mongo { using std::unique_ptr; -using std::vector; const char* TextMatchStage::kStageType = "TEXT_MATCH"; diff --git a/src/mongo/db/exec/text_or.cpp b/src/mongo/db/exec/text_or.cpp index 7f8c2ff0740..40a13b6daa3 100644 --- a/src/mongo/db/exec/text_or.cpp +++ b/src/mongo/db/exec/text_or.cpp @@ -52,9 +52,7 @@ namespace mongo { using std::string; using std::unique_ptr; -using std::vector; -using fts::FTSSpec; const char* TextOrStage::kStageType = "TEXT_OR"; diff --git a/src/mongo/db/geo/big_polygon_test.cpp b/src/mongo/db/geo/big_polygon_test.cpp index 9889ddca06a..b97af58ba38 100644 --- a/src/mongo/db/geo/big_polygon_test.cpp +++ b/src/mongo/db/geo/big_polygon_test.cpp @@ -49,7 +49,6 @@ namespace { using namespace mongo; using std::string; -using std::unique_ptr; using std::vector; // Helper to build a vector of S2Point diff --git a/src/mongo/db/geo/hash_test.cpp b/src/mongo/db/geo/hash_test.cpp index 93096a66de3..958eae367d0 100644 --- a/src/mongo/db/geo/hash_test.cpp +++ b/src/mongo/db/geo/hash_test.cpp @@ -53,8 +53,6 @@ namespace { using namespace mongo; -using std::cout; -using std::endl; using std::string; using std::stringstream; diff --git a/src/mongo/db/hasher.cpp b/src/mongo/db/hasher.cpp index 08f33e8f46c..ea77d21b9b1 100644 --- a/src/mongo/db/hasher.cpp +++ b/src/mongo/db/hasher.cpp @@ -45,8 +45,6 @@ namespace mongo { -using std::unique_ptr; - namespace { typedef unsigned char HashDigest[16]; diff --git a/src/mongo/db/index/btree_key_generator_test.cpp b/src/mongo/db/index/btree_key_generator_test.cpp index d063d9ee6d8..1c11032eeb1 100644 --- a/src/mongo/db/index/btree_key_generator_test.cpp +++ b/src/mongo/db/index/btree_key_generator_test.cpp @@ -53,9 +53,6 @@ using namespace mongo; -using std::cout; -using std::endl; -using std::unique_ptr; using std::vector; namespace { diff --git a/src/mongo/db/matcher/expression_bitset_tree_converter.cpp b/src/mongo/db/matcher/expression_bitset_tree_converter.cpp index ef883a82930..8d888cfc123 100644 --- a/src/mongo/db/matcher/expression_bitset_tree_converter.cpp +++ b/src/mongo/db/matcher/expression_bitset_tree_converter.cpp @@ -48,7 +48,6 @@ namespace mongo { using boolean_simplification::BitsetTreeNode; -using boolean_simplification::Maxterm; using boolean_simplification::Minterm; namespace { diff --git a/src/mongo/db/matcher/expression_expr_test.cpp b/src/mongo/db/matcher/expression_expr_test.cpp index 16affbe11fd..3bffc45e1d9 100644 --- a/src/mongo/db/matcher/expression_expr_test.cpp +++ b/src/mongo/db/matcher/expression_expr_test.cpp @@ -59,7 +59,6 @@ namespace mongo { namespace { -using unittest::assertGet; const double kNaN = std::numeric_limits::quiet_NaN(); diff --git a/src/mongo/db/matcher/expression_optimize_test.cpp b/src/mongo/db/matcher/expression_optimize_test.cpp index 574b77e48a6..911a46dd0aa 100644 --- a/src/mongo/db/matcher/expression_optimize_test.cpp +++ b/src/mongo/db/matcher/expression_optimize_test.cpp @@ -68,7 +68,6 @@ namespace { static const NamespaceString nss = NamespaceString::createNamespaceString_forTest("testdb.testcoll"); -using unittest::assertGet; /** * Helper function to parse the given BSON object as a MatchExpression, checks the status, diff --git a/src/mongo/db/matcher/expression_parser_leaf_test.cpp b/src/mongo/db/matcher/expression_parser_leaf_test.cpp index 25050997aac..46a56043017 100644 --- a/src/mongo/db/matcher/expression_parser_leaf_test.cpp +++ b/src/mongo/db/matcher/expression_parser_leaf_test.cpp @@ -64,7 +64,6 @@ namespace mongo { -using std::endl; using std::string; TEST(MatchExpressionParserLeafTest, NullCollation) { diff --git a/src/mongo/db/matcher/expression_restorer.cpp b/src/mongo/db/matcher/expression_restorer.cpp index e3ab2f2625a..741461a1d53 100644 --- a/src/mongo/db/matcher/expression_restorer.cpp +++ b/src/mongo/db/matcher/expression_restorer.cpp @@ -38,7 +38,6 @@ namespace mongo { namespace { using boolean_simplification::BitsetTerm; using boolean_simplification::BitsetTreeNode; -using boolean_simplification::Maxterm; using boolean_simplification::Minterm; class MatchExpressionRestorer { public: diff --git a/src/mongo/db/matcher/expression_restorer_test.cpp b/src/mongo/db/matcher/expression_restorer_test.cpp index ae6c562760d..d32b3416c61 100644 --- a/src/mongo/db/matcher/expression_restorer_test.cpp +++ b/src/mongo/db/matcher/expression_restorer_test.cpp @@ -38,7 +38,6 @@ namespace mongo { using boolean_simplification::BitsetTreeNode; -using boolean_simplification::makeBitsetTerm; using boolean_simplification::Maxterm; using boolean_simplification::Minterm; diff --git a/src/mongo/db/matcher/expression_serialization_test.cpp b/src/mongo/db/matcher/expression_serialization_test.cpp index 2c29327653e..d36b1a1695d 100644 --- a/src/mongo/db/matcher/expression_serialization_test.cpp +++ b/src/mongo/db/matcher/expression_serialization_test.cpp @@ -84,7 +84,6 @@ namespace mongo { namespace { -using std::pair; using std::string; using std::unique_ptr; diff --git a/src/mongo/db/matcher/schema/expression_internal_schema_xor_test.cpp b/src/mongo/db/matcher/schema/expression_internal_schema_xor_test.cpp index a5d840e15f0..a2bd0a154e4 100644 --- a/src/mongo/db/matcher/schema/expression_internal_schema_xor_test.cpp +++ b/src/mongo/db/matcher/schema/expression_internal_schema_xor_test.cpp @@ -48,7 +48,6 @@ namespace mongo { namespace { -using std::unique_ptr; TEST(InternalSchemaXorOp, MatchesNothingWhenHasNoClauses) { InternalSchemaXorMatchExpression internalSchemaXorOp; diff --git a/src/mongo/db/op_observer/op_observer_impl.cpp b/src/mongo/db/op_observer/op_observer_impl.cpp index 579e691f326..a12f14f785c 100644 --- a/src/mongo/db/op_observer/op_observer_impl.cpp +++ b/src/mongo/db/op_observer/op_observer_impl.cpp @@ -105,7 +105,6 @@ namespace mongo { -using repl::DurableOplogEntry; using repl::MutableOplogEntry; using ChangeStreamPreImageRecordingMode = repl::ReplOperation::ChangeStreamPreImageRecordingMode; diff --git a/src/mongo/db/pipeline/dependencies_test.cpp b/src/mongo/db/pipeline/dependencies_test.cpp index 467810d2ccb..d98f8fd737c 100644 --- a/src/mongo/db/pipeline/dependencies_test.cpp +++ b/src/mongo/db/pipeline/dependencies_test.cpp @@ -44,7 +44,6 @@ namespace mongo { namespace { -using std::set; using std::string; template diff --git a/src/mongo/db/pipeline/document_source_change_stream_add_post_image_test.cpp b/src/mongo/db/pipeline/document_source_change_stream_add_post_image_test.cpp index c4d07e44783..b5b9eb8c5bb 100644 --- a/src/mongo/db/pipeline/document_source_change_stream_add_post_image_test.cpp +++ b/src/mongo/db/pipeline/document_source_change_stream_add_post_image_test.cpp @@ -61,9 +61,7 @@ namespace mongo { namespace { -using boost::intrusive_ptr; using std::deque; -using std::vector; using MockMongoInterface = StubLookupSingleDocumentProcessInterface; diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp index eff87bd9aa1..eace9c9ae41 100644 --- a/src/mongo/db/pipeline/document_source_cursor.cpp +++ b/src/mongo/db/pipeline/document_source_cursor.cpp @@ -71,7 +71,6 @@ namespace mongo { MONGO_FAIL_POINT_DEFINE(hangBeforeDocumentSourceCursorLoadBatch); using boost::intrusive_ptr; -using std::shared_ptr; using std::string; const char* DocumentSourceCursor::getSourceName() const { diff --git a/src/mongo/db/pipeline/document_source_merge_cursors_test.cpp b/src/mongo/db/pipeline/document_source_merge_cursors_test.cpp index 0074e51f8ea..bd46b86c44e 100644 --- a/src/mongo/db/pipeline/document_source_merge_cursors_test.cpp +++ b/src/mongo/db/pipeline/document_source_merge_cursors_test.cpp @@ -94,9 +94,7 @@ namespace mongo { namespace { -using executor::NetworkInterfaceMock; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; using ResponseStatus = executor::TaskExecutor::ResponseStatus; diff --git a/src/mongo/db/pipeline/document_source_project_test.cpp b/src/mongo/db/pipeline/document_source_project_test.cpp index c518f10fe5a..3bf0928177c 100644 --- a/src/mongo/db/pipeline/document_source_project_test.cpp +++ b/src/mongo/db/pipeline/document_source_project_test.cpp @@ -60,7 +60,6 @@ namespace mongo { namespace { -using boost::intrusive_ptr; using std::vector; // diff --git a/src/mongo/db/pipeline/expression_object_test.cpp b/src/mongo/db/pipeline/expression_object_test.cpp index 337fe2355fc..a01c9a4e334 100644 --- a/src/mongo/db/pipeline/expression_object_test.cpp +++ b/src/mongo/db/pipeline/expression_object_test.cpp @@ -57,7 +57,6 @@ namespace mongo { namespace ExpressionTests { namespace { -using boost::intrusive_ptr; using std::vector; namespace Object { diff --git a/src/mongo/db/pipeline/expression_trigonometric_test.cpp b/src/mongo/db/pipeline/expression_trigonometric_test.cpp index f5a4cc7032c..166f7846416 100644 --- a/src/mongo/db/pipeline/expression_trigonometric_test.cpp +++ b/src/mongo/db/pipeline/expression_trigonometric_test.cpp @@ -42,7 +42,6 @@ namespace expression_tests { -using boost::intrusive_ptr; using namespace mongo; // assertApproxEq is a helper function for asserting approximate results. diff --git a/src/mongo/db/pipeline/expression_trim_test.cpp b/src/mongo/db/pipeline/expression_trim_test.cpp index 0f678547618..eac5a5114c2 100644 --- a/src/mongo/db/pipeline/expression_trim_test.cpp +++ b/src/mongo/db/pipeline/expression_trim_test.cpp @@ -55,7 +55,6 @@ namespace mongo { namespace ExpressionTests { namespace { -using boost::intrusive_ptr; using std::string; /** diff --git a/src/mongo/db/pipeline/field_path_test.cpp b/src/mongo/db/pipeline/field_path_test.cpp index be561ad63a6..5034e5012ac 100644 --- a/src/mongo/db/pipeline/field_path_test.cpp +++ b/src/mongo/db/pipeline/field_path_test.cpp @@ -38,7 +38,6 @@ namespace mongo { namespace { using std::string; -using std::vector; /** FieldPath constructed from empty string. */ TEST(FieldPathTest, Empty) { diff --git a/src/mongo/db/pipeline/granularity_rounder_powers_of_two_test.cpp b/src/mongo/db/pipeline/granularity_rounder_powers_of_two_test.cpp index 7a997504b57..98d1b6ddb2d 100644 --- a/src/mongo/db/pipeline/granularity_rounder_powers_of_two_test.cpp +++ b/src/mongo/db/pipeline/granularity_rounder_powers_of_two_test.cpp @@ -47,7 +47,6 @@ namespace mongo { -using boost::intrusive_ptr; namespace { const double DELTA = 0.0001; diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp index 2e35fd12a92..6a16e4f9a9c 100644 --- a/src/mongo/db/pipeline/pipeline.cpp +++ b/src/mongo/db/pipeline/pipeline.cpp @@ -181,7 +181,6 @@ void validateTopLevelPipeline(const Pipeline& pipeline) { MONGO_FAIL_POINT_DEFINE(disablePipelineOptimization); using boost::intrusive_ptr; -using std::endl; using std::ostringstream; using std::string; using std::vector; diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index 2270799e83e..40e4613ff33 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -162,10 +162,8 @@ namespace mongo { using boost::intrusive_ptr; -using std::shared_ptr; using std::string; using std::unique_ptr; -using write_ops::InsertCommandRequest; namespace { std::unique_ptr createFindCommand( const intrusive_ptr& expCtx, diff --git a/src/mongo/db/pipeline/search/document_source_vector_search.cpp b/src/mongo/db/pipeline/search/document_source_vector_search.cpp index ee7b28aa84a..053bb7d018f 100644 --- a/src/mongo/db/pipeline/search/document_source_vector_search.cpp +++ b/src/mongo/db/pipeline/search/document_source_vector_search.cpp @@ -45,7 +45,6 @@ namespace mongo { using boost::intrusive_ptr; using executor::RemoteCommandRequest; -using executor::TaskExecutorCursor; REGISTER_DOCUMENT_SOURCE_WITH_FEATURE_FLAG(vectorSearch, LiteParsedSearchStage::parse, diff --git a/src/mongo/db/pipeline/search/document_source_vector_search_test.cpp b/src/mongo/db/pipeline/search/document_source_vector_search_test.cpp index 6491aecba11..0b2e592dfa1 100644 --- a/src/mongo/db/pipeline/search/document_source_vector_search_test.cpp +++ b/src/mongo/db/pipeline/search/document_source_vector_search_test.cpp @@ -41,7 +41,6 @@ namespace mongo { namespace { -using boost::intrusive_ptr; using DocumentSourceVectorSearchTest = AggregationContextFixture; TEST_F(DocumentSourceVectorSearchTest, NotAllowedInTransaction) { diff --git a/src/mongo/db/pipeline/single_document_transformation_processor.cpp b/src/mongo/db/pipeline/single_document_transformation_processor.cpp index 18fd0e36a2c..c8a0caa49e9 100644 --- a/src/mongo/db/pipeline/single_document_transformation_processor.cpp +++ b/src/mongo/db/pipeline/single_document_transformation_processor.cpp @@ -41,7 +41,6 @@ namespace mongo { -using boost::intrusive_ptr; SingleDocumentTransformationProcessor::SingleDocumentTransformationProcessor( std::unique_ptr parsedTransform) diff --git a/src/mongo/db/pipeline/unwind_processor.cpp b/src/mongo/db/pipeline/unwind_processor.cpp index 3b3d911ea05..9bb1f1549d5 100644 --- a/src/mongo/db/pipeline/unwind_processor.cpp +++ b/src/mongo/db/pipeline/unwind_processor.cpp @@ -35,9 +35,7 @@ namespace mongo { -using boost::intrusive_ptr; using std::string; -using std::vector; UnwindProcessor::UnwindProcessor(const FieldPath& unwindPath, bool preserveNullAndEmptyArrays, diff --git a/src/mongo/db/pipeline/window_function/window_bounds.cpp b/src/mongo/db/pipeline/window_function/window_bounds.cpp index bbbb1c813cd..b8c0158ec02 100644 --- a/src/mongo/db/pipeline/window_function/window_bounds.cpp +++ b/src/mongo/db/pipeline/window_function/window_bounds.cpp @@ -54,7 +54,6 @@ #include "mongo/util/assert_util.h" #include "mongo/util/str.h" -using boost::intrusive_ptr; using boost::optional; namespace mongo { diff --git a/src/mongo/db/process_health/fault_manager_test.cpp b/src/mongo/db/process_health/fault_manager_test.cpp index 6ee2ca58467..29e2661b544 100644 --- a/src/mongo/db/process_health/fault_manager_test.cpp +++ b/src/mongo/db/process_health/fault_manager_test.cpp @@ -39,7 +39,6 @@ namespace mongo { namespace process_health { using test::FaultManagerTest; -using test::FaultManagerTestImpl; namespace { diff --git a/src/mongo/db/process_health/fault_state_machine_test.cpp b/src/mongo/db/process_health/fault_state_machine_test.cpp index 7040e984dcc..1d389414831 100644 --- a/src/mongo/db/process_health/fault_state_machine_test.cpp +++ b/src/mongo/db/process_health/fault_state_machine_test.cpp @@ -64,7 +64,6 @@ namespace mongo { namespace process_health { using test::FaultManagerTest; -using test::FaultManagerTestImpl; namespace { diff --git a/src/mongo/db/query/ce/maxdiff_histogram_test.cpp b/src/mongo/db/query/ce/maxdiff_histogram_test.cpp index 28a696a342e..a61039094a1 100644 --- a/src/mongo/db/query/ce/maxdiff_histogram_test.cpp +++ b/src/mongo/db/query/ce/maxdiff_histogram_test.cpp @@ -53,8 +53,6 @@ namespace mongo::optimizer::ce { namespace { namespace value = sbe::value; -using stats::ArrayHistogram; -using stats::Bucket; using stats::DataDistribution; using stats::genFixedValueArray; using stats::getDataDistribution; diff --git a/src/mongo/db/query/cqf_get_executor.cpp b/src/mongo/db/query/cqf_get_executor.cpp index bb155992ce8..96b4184aca6 100644 --- a/src/mongo/db/query/cqf_get_executor.cpp +++ b/src/mongo/db/query/cqf_get_executor.cpp @@ -137,7 +137,6 @@ using ce::HeuristicEstimator; using ce::HistogramEstimator; using ce::SamplingEstimator; using cost_model::CostEstimatorImpl; -using cost_model::CostModelManager; static std::pair buildIndexSpecsOptimizer( boost::intrusive_ptr expCtx, diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index 5d72bf1abae..e460c4ccf34 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -53,7 +53,6 @@ namespace mongo { -using std::unique_ptr; // Failpoint for checking whether we've received a getmore. MONGO_FAIL_POINT_DEFINE(failReceivedGetmore); diff --git a/src/mongo/db/query/optimizer/rewrites/proj_spec_test.cpp b/src/mongo/db/query/optimizer/rewrites/proj_spec_test.cpp index 21eeb1110b6..792bb9bd9fe 100644 --- a/src/mongo/db/query/optimizer/rewrites/proj_spec_test.cpp +++ b/src/mongo/db/query/optimizer/rewrites/proj_spec_test.cpp @@ -39,7 +39,6 @@ namespace mongo::optimizer { namespace { using sbe::MakeObjSpec; -using sbe::value::TypeTags; using FieldAction = MakeObjSpec::FieldAction; using FieldActions = std::vector>; diff --git a/src/mongo/db/query/plan_cache_key_info_test.cpp b/src/mongo/db/query/plan_cache_key_info_test.cpp index be5b2fb49a2..37c92dcd77c 100644 --- a/src/mongo/db/query/plan_cache_key_info_test.cpp +++ b/src/mongo/db/query/plan_cache_key_info_test.cpp @@ -65,7 +65,6 @@ using std::string; using std::unique_ptr; using std::vector; -using unittest::assertGet; std::ostream& operator<<(std::ostream& stream, const PlanCacheKeyInfo& key) { stream << key.toString() << " settings: " << key.querySettings().toBSON().toString(); diff --git a/src/mongo/db/query/plan_enumerator/plan_enumerator.cpp b/src/mongo/db/query/plan_enumerator/plan_enumerator.cpp index b17fd0f06cc..662cac1f383 100644 --- a/src/mongo/db/query/plan_enumerator/plan_enumerator.cpp +++ b/src/mongo/db/query/plan_enumerator/plan_enumerator.cpp @@ -70,7 +70,6 @@ namespace { using namespace mongo; using namespace plan_enumerator; -using std::endl; using std::set; using std::string; using std::unique_ptr; diff --git a/src/mongo/db/query/plan_executor_impl.cpp b/src/mongo/db/query/plan_executor_impl.cpp index 50ae190fb82..e3e8f11bf4e 100644 --- a/src/mongo/db/query/plan_executor_impl.cpp +++ b/src/mongo/db/query/plan_executor_impl.cpp @@ -84,7 +84,6 @@ namespace mongo { using namespace fmt::literals; -using std::shared_ptr; using std::string; using std::unique_ptr; using std::vector; diff --git a/src/mongo/db/query/plan_ranker_test.cpp b/src/mongo/db/query/plan_ranker_test.cpp index f57c97ace8f..36b8911e866 100644 --- a/src/mongo/db/query/plan_ranker_test.cpp +++ b/src/mongo/db/query/plan_ranker_test.cpp @@ -50,7 +50,6 @@ namespace { using std::make_unique; using std::string; using std::unique_ptr; -using std::vector; unique_ptr makeStats(const char* name, StageType type, diff --git a/src/mongo/db/query/planner_analysis.cpp b/src/mongo/db/query/planner_analysis.cpp index 2374da8557e..98a46387556 100644 --- a/src/mongo/db/query/planner_analysis.cpp +++ b/src/mongo/db/query/planner_analysis.cpp @@ -87,7 +87,6 @@ namespace mongo { -using std::endl; using std::pair; using std::string; using std::unique_ptr; diff --git a/src/mongo/db/query/projection_test.cpp b/src/mongo/db/query/projection_test.cpp index 2eede8f6323..11de88a07ad 100644 --- a/src/mongo/db/query/projection_test.cpp +++ b/src/mongo/db/query/projection_test.cpp @@ -62,7 +62,6 @@ namespace { using std::string; using std::unique_ptr; -using std::vector; using namespace mongo; diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp index 5040f31fc09..78b43ad6322 100644 --- a/src/mongo/db/query/query_planner.cpp +++ b/src/mongo/db/query/query_planner.cpp @@ -594,7 +594,6 @@ StatusWith> tryToBuildSearchQuerySolution( } } // namespace -using std::numeric_limits; using std::unique_ptr; namespace dps = ::mongo::dotted_path_support; diff --git a/src/mongo/db/query/query_planner_test_fixture.cpp b/src/mongo/db/query/query_planner_test_fixture.cpp index de5a7e14a50..1db6d11cfe9 100644 --- a/src/mongo/db/query/query_planner_test_fixture.cpp +++ b/src/mongo/db/query/query_planner_test_fixture.cpp @@ -68,7 +68,6 @@ namespace mongo { -using unittest::assertGet; void QueryPlannerTest::setUp() { nss = NamespaceString::createNamespaceString_forTest("test.collection"); diff --git a/src/mongo/db/query/query_request_test.cpp b/src/mongo/db/query/query_request_test.cpp index 48201191f60..26351c87b0e 100644 --- a/src/mongo/db/query/query_request_test.cpp +++ b/src/mongo/db/query/query_request_test.cpp @@ -83,7 +83,6 @@ namespace mongo { namespace { using std::unique_ptr; -using unittest::assertGet; static const NamespaceString testns = NamespaceString::createNamespaceString_forTest("testdb.testcoll"); diff --git a/src/mongo/db/query/stats/stats_cache_test.cpp b/src/mongo/db/query/stats/stats_cache_test.cpp index 0e55e9a3680..4508913ce44 100644 --- a/src/mongo/db/query/stats/stats_cache_test.cpp +++ b/src/mongo/db/query/stats/stats_cache_test.cpp @@ -54,7 +54,6 @@ namespace mongo::stats { namespace { -using unittest::assertGet; /** * Fixture for tests, which do not need to exercise the multi-threading capabilities of the cache diff --git a/src/mongo/db/repl/repl_set_config_checks_test.cpp b/src/mongo/db/repl/repl_set_config_checks_test.cpp index 2bc8fba50be..61488c678b9 100644 --- a/src/mongo/db/repl/repl_set_config_checks_test.cpp +++ b/src/mongo/db/repl/repl_set_config_checks_test.cpp @@ -56,7 +56,6 @@ namespace mongo { namespace repl { namespace { -using unittest::EnsureFCV; TEST_F(ServiceContextTest, ValidateConfigForInitiate_VersionMustBe1) { ReplicationCoordinatorExternalStateMock rses; diff --git a/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp b/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp index d034f78da7c..90676ceb326 100644 --- a/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp +++ b/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp @@ -42,7 +42,6 @@ namespace mongo { namespace repl { namespace { -using std::unique_ptr; bool stringContains(const std::string& haystack, const std::string& needle) { return haystack.find(needle) != std::string::npos; diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index 35f73102b16..d1ae8d5f940 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -239,7 +239,6 @@ using CallbackArgs = executor::TaskExecutor::CallbackArgs; using CallbackFn = executor::TaskExecutor::CallbackFn; using CallbackHandle = executor::TaskExecutor::CallbackHandle; using EventHandle = executor::TaskExecutor::EventHandle; -using executor::NetworkInterface; using NextAction = Fetcher::NextAction; void lockAndCall(stdx::unique_lock* lk, const std::function& fn) { diff --git a/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp index 428de7da3ea..4ad1e8ba5b0 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp @@ -94,7 +94,6 @@ namespace { using executor::NetworkInterfaceMock; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; typedef ReplicationCoordinator::ReplSetReconfigArgs ReplSetReconfigArgs; diff --git a/src/mongo/db/repl/replication_coordinator_impl_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_test.cpp index c8742cc1791..1d08726464f 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_test.cpp @@ -111,7 +111,6 @@ using executor::RemoteCommandResponse; using rpc::OplogQueryMetadata; using rpc::ReplSetMetadata; using unittest::assertGet; -using unittest::EnsureFCV; typedef ReplicationCoordinator::ReplSetReconfigArgs ReplSetReconfigArgs; // Helper class to wrap Timestamp as an OpTime with term 1. diff --git a/src/mongo/db/repl/reporter_test.cpp b/src/mongo/db/repl/reporter_test.cpp index 11b80663b28..9e28f85914a 100644 --- a/src/mongo/db/repl/reporter_test.cpp +++ b/src/mongo/db/repl/reporter_test.cpp @@ -58,7 +58,6 @@ namespace { using namespace mongo; using namespace mongo::repl; -using executor::NetworkInterfaceMock; using executor::RemoteCommandRequest; using executor::RemoteCommandResponse; diff --git a/src/mongo/db/repl/rollback_checker_test.cpp b/src/mongo/db/repl/rollback_checker_test.cpp index 2ce64a25cb2..010b2d39b86 100644 --- a/src/mongo/db/repl/rollback_checker_test.cpp +++ b/src/mongo/db/repl/rollback_checker_test.cpp @@ -54,8 +54,6 @@ namespace { using namespace mongo; using namespace mongo::repl; -using executor::NetworkInterfaceMock; -using executor::RemoteCommandResponse; using LockGuard = stdx::lock_guard; diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index b5b2413f703..46be3241f60 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -126,11 +126,9 @@ namespace mongo { -using std::list; using std::map; using std::pair; using std::set; -using std::shared_ptr; using std::string; using std::unique_ptr; diff --git a/src/mongo/db/repl/tenant_file_importer_service_test.cpp b/src/mongo/db/repl/tenant_file_importer_service_test.cpp index f8b858a88b0..1853ea2f191 100644 --- a/src/mongo/db/repl/tenant_file_importer_service_test.cpp +++ b/src/mongo/db/repl/tenant_file_importer_service_test.cpp @@ -70,8 +70,6 @@ namespace mongo { -using executor::TaskExecutor; -using executor::ThreadPoolExecutorTest; namespace repl { diff --git a/src/mongo/db/repl/tenant_oplog_applier_shard_merge_test.cpp b/src/mongo/db/repl/tenant_oplog_applier_shard_merge_test.cpp index a42c0f1dd19..e539e693113 100644 --- a/src/mongo/db/repl/tenant_oplog_applier_shard_merge_test.cpp +++ b/src/mongo/db/repl/tenant_oplog_applier_shard_merge_test.cpp @@ -61,8 +61,6 @@ namespace mongo { -using executor::TaskExecutor; -using executor::ThreadPoolExecutorTest; namespace repl { diff --git a/src/mongo/db/repl/tenant_oplog_applier_test.cpp b/src/mongo/db/repl/tenant_oplog_applier_test.cpp index 98f7425b547..8af486e4765 100644 --- a/src/mongo/db/repl/tenant_oplog_applier_test.cpp +++ b/src/mongo/db/repl/tenant_oplog_applier_test.cpp @@ -93,8 +93,6 @@ namespace mongo { -using executor::TaskExecutor; -using executor::ThreadPoolExecutorTest; namespace repl { diff --git a/src/mongo/db/repl/tenant_oplog_batcher_test.cpp b/src/mongo/db/repl/tenant_oplog_batcher_test.cpp index 29b5cbd4adc..e28c1f59c19 100644 --- a/src/mongo/db/repl/tenant_oplog_batcher_test.cpp +++ b/src/mongo/db/repl/tenant_oplog_batcher_test.cpp @@ -66,8 +66,6 @@ namespace mongo { -using executor::TaskExecutor; -using executor::ThreadPoolExecutorTest; namespace repl { diff --git a/src/mongo/db/repl/vote_requester_test.cpp b/src/mongo/db/repl/vote_requester_test.cpp index 1d98fb2d7b6..518f8b4eb1f 100644 --- a/src/mongo/db/repl/vote_requester_test.cpp +++ b/src/mongo/db/repl/vote_requester_test.cpp @@ -55,7 +55,6 @@ namespace { using executor::RemoteCommandRequest; using executor::RemoteCommandResponse; -using unittest::assertGet; bool stringContains(const std::string& haystack, const std::string& needle) { return haystack.find(needle) != std::string::npos; diff --git a/src/mongo/db/s/balancer/balancer_commands_scheduler_test.cpp b/src/mongo/db/s/balancer/balancer_commands_scheduler_test.cpp index 7843942c09c..a15d7200f3a 100644 --- a/src/mongo/db/s/balancer/balancer_commands_scheduler_test.cpp +++ b/src/mongo/db/s/balancer/balancer_commands_scheduler_test.cpp @@ -72,7 +72,6 @@ namespace mongo { namespace { -using unittest::assertGet; class BalancerCommandsSchedulerTest : public ConfigServerTestFixture { public: diff --git a/src/mongo/db/s/balancer/balancer_policy.cpp b/src/mongo/db/s/balancer/balancer_policy.cpp index 9cc761c2946..281d5d6b9e2 100644 --- a/src/mongo/db/s/balancer/balancer_policy.cpp +++ b/src/mongo/db/s/balancer/balancer_policy.cpp @@ -71,9 +71,7 @@ namespace mongo { MONGO_FAIL_POINT_DEFINE(balancerShouldReturnRandomMigrations); -using std::map; using std::numeric_limits; -using std::set; using std::string; using std::vector; using namespace fmt::literals; diff --git a/src/mongo/db/s/balancer/migration_test_fixture.cpp b/src/mongo/db/s/balancer/migration_test_fixture.cpp index 63086b8665f..cc52a5dd046 100644 --- a/src/mongo/db/s/balancer/migration_test_fixture.cpp +++ b/src/mongo/db/s/balancer/migration_test_fixture.cpp @@ -46,7 +46,6 @@ namespace mongo { -using unittest::assertGet; void MigrationTestFixture::setUp() { setUpAndInitializeConfigDb(); diff --git a/src/mongo/db/s/collection_metadata_test.cpp b/src/mongo/db/s/collection_metadata_test.cpp index c6727f10e31..9535fe7c35b 100644 --- a/src/mongo/db/s/collection_metadata_test.cpp +++ b/src/mongo/db/s/collection_metadata_test.cpp @@ -54,7 +54,6 @@ namespace mongo { namespace { -using unittest::assertGet; const NamespaceString kNss = NamespaceString::createNamespaceString_forTest("test.foo"); const ShardId kThisShard("thisShard"); diff --git a/src/mongo/db/s/config/config_server_test_fixture.cpp b/src/mongo/db/s/config/config_server_test_fixture.cpp index ae70b402fad..afb4dae40b3 100644 --- a/src/mongo/db/s/config/config_server_test_fixture.cpp +++ b/src/mongo/db/s/config/config_server_test_fixture.cpp @@ -88,12 +88,9 @@ namespace mongo { using executor::NetworkInterfaceMock; using executor::NetworkTestEnv; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; -using unittest::assertGet; using std::string; using std::vector; -using unittest::assertGet; namespace { ReadPreferenceSetting kReadPref(ReadPreference::PrimaryOnly); diff --git a/src/mongo/db/s/config/initial_split_policy.cpp b/src/mongo/db/s/config/initial_split_policy.cpp index 4ba61d3cd85..731d1c59e4c 100644 --- a/src/mongo/db/s/config/initial_split_policy.cpp +++ b/src/mongo/db/s/config/initial_split_policy.cpp @@ -87,7 +87,6 @@ namespace { using ChunkDistributionMap = stdx::unordered_map; using ZoneShardMap = StringMap>; -using boost::intrusive_ptr; std::vector getAllNonDrainingShardIdsShuffled(OperationContext* opCtx) { const auto shardsAndOpTime = uassertStatusOKWithContext( diff --git a/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp b/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp index 4c6e1aa47f0..a4b319538aa 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_add_shard_test.cpp @@ -127,7 +127,6 @@ namespace mongo { namespace { using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; using std::vector; using unittest::assertGet; diff --git a/src/mongo/db/s/config/sharding_catalog_manager_clear_jumbo_flag_test.cpp b/src/mongo/db/s/config/sharding_catalog_manager_clear_jumbo_flag_test.cpp index 29d5795fc43..a1da7789c9c 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_clear_jumbo_flag_test.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_clear_jumbo_flag_test.cpp @@ -51,7 +51,6 @@ namespace mongo { namespace { -using unittest::assertGet; const KeyPattern kKeyPattern(BSON("x" << 1)); diff --git a/src/mongo/db/s/config/sharding_catalog_manager_remove_shard_test.cpp b/src/mongo/db/s/config/sharding_catalog_manager_remove_shard_test.cpp index 28d4900e2fb..aef9fbd1e81 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_remove_shard_test.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_remove_shard_test.cpp @@ -81,10 +81,7 @@ namespace mongo { namespace { -using executor::NetworkInterfaceMock; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; -using executor::TaskExecutor; using std::string; using std::vector; using unittest::assertGet; diff --git a/src/mongo/db/s/metadata_manager_test.cpp b/src/mongo/db/s/metadata_manager_test.cpp index 9a896f86b65..c6cae727fde 100644 --- a/src/mongo/db/s/metadata_manager_test.cpp +++ b/src/mongo/db/s/metadata_manager_test.cpp @@ -63,7 +63,6 @@ namespace mongo { namespace { -using unittest::assertGet; const NamespaceString kNss = NamespaceString::createNamespaceString_forTest("TestDB", "TestColl"); const std::string kPattern = "key"; diff --git a/src/mongo/db/s/migration_destination_manager_test.cpp b/src/mongo/db/s/migration_destination_manager_test.cpp index 1361a2fb3b8..b7987b93d3c 100644 --- a/src/mongo/db/s/migration_destination_manager_test.cpp +++ b/src/mongo/db/s/migration_destination_manager_test.cpp @@ -51,7 +51,6 @@ namespace mongo { namespace { -using unittest::assertGet; class MigrationDestinationManagerTest : public ShardServerTestFixture { protected: diff --git a/src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp b/src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp index 7be01e8a84a..b6193d7579a 100644 --- a/src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp +++ b/src/mongo/db/s/shard_server_catalog_cache_loader_test.cpp @@ -70,9 +70,7 @@ namespace mongo { namespace { using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; using std::vector; -using unittest::assertGet; using CollectionAndChangedChunks = CatalogCacheLoader::CollectionAndChangedChunks; const NamespaceString kNss = NamespaceString::createNamespaceString_forTest("foo.bar"); diff --git a/src/mongo/db/s/sharding_mongod_test_fixture.cpp b/src/mongo/db/s/sharding_mongod_test_fixture.cpp index ed8aa82c352..199167824c0 100644 --- a/src/mongo/db/s/sharding_mongod_test_fixture.cpp +++ b/src/mongo/db/s/sharding_mongod_test_fixture.cpp @@ -91,11 +91,9 @@ namespace mongo { using executor::NetworkInterfaceMock; using executor::NetworkTestEnv; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; using repl::ReplicationCoordinator; using repl::ReplicationCoordinatorMock; using repl::ReplSettings; -using unittest::assertGet; ShardingMongoDTestFixture::ShardingMongoDTestFixture(Options options, bool setUpMajorityReads) : ServiceContextMongoDTest(std::move(options)), _setUpMajorityReads(setUpMajorityReads) {} diff --git a/src/mongo/db/s/type_shard_collection_test.cpp b/src/mongo/db/s/type_shard_collection_test.cpp index c22bd10c707..6d2f957ed62 100644 --- a/src/mongo/db/s/type_shard_collection_test.cpp +++ b/src/mongo/db/s/type_shard_collection_test.cpp @@ -48,7 +48,6 @@ namespace mongo { namespace { -using unittest::assertGet; const NamespaceString kNss = NamespaceString::createNamespaceString_forTest("db.coll"); const BSONObj kKeyPattern = BSON("a" << 1); diff --git a/src/mongo/db/session/logical_session_cache_test.cpp b/src/mongo/db/session/logical_session_cache_test.cpp index 5807b24a031..9d843044a81 100644 --- a/src/mongo/db/session/logical_session_cache_test.cpp +++ b/src/mongo/db/session/logical_session_cache_test.cpp @@ -69,7 +69,6 @@ const Milliseconds kSessionTimeout = const Milliseconds kForceRefresh{kLogicalSessionRefreshMillisDefault}; using SessionList = std::list; -using unittest::EnsureFCV; /** * Test fixture that sets up a session cache attached to a mock service liaison diff --git a/src/mongo/db/update/addtoset_node_test.cpp b/src/mongo/db/update/addtoset_node_test.cpp index 4b351b1c127..d8eaac82490 100644 --- a/src/mongo/db/update/addtoset_node_test.cpp +++ b/src/mongo/db/update/addtoset_node_test.cpp @@ -51,8 +51,6 @@ namespace mongo { namespace { using AddToSetNodeTest = UpdateTestFixture; -using mongo::mutablebson::countChildren; -using mongo::mutablebson::Element; DEATH_TEST_REGEX(AddToSetNodeTest, InitFailsForEmptyElement, diff --git a/src/mongo/db/update/compare_node_test.cpp b/src/mongo/db/update/compare_node_test.cpp index 5a877223f74..1ba8226dbd1 100644 --- a/src/mongo/db/update/compare_node_test.cpp +++ b/src/mongo/db/update/compare_node_test.cpp @@ -50,8 +50,6 @@ namespace mongo { namespace { using CompareNodeTest = UpdateTestFixture; -using mongo::mutablebson::countChildren; -using mongo::mutablebson::Element; DEATH_TEST_REGEX(CompareNodeTest, InitFailsForEmptyElement, diff --git a/src/mongo/db/update/field_checker_test.cpp b/src/mongo/db/update/field_checker_test.cpp index 99d13afdf4d..85365930d9b 100644 --- a/src/mongo/db/update/field_checker_test.cpp +++ b/src/mongo/db/update/field_checker_test.cpp @@ -39,7 +39,6 @@ namespace { -using mongo::ErrorCodes; using mongo::FieldRef; using mongo::Status; using mongo::fieldchecker::isPositional; diff --git a/src/mongo/db/update/modifier_table_test.cpp b/src/mongo/db/update/modifier_table_test.cpp index 5efca5a3a1d..2e6b4a135c6 100644 --- a/src/mongo/db/update/modifier_table_test.cpp +++ b/src/mongo/db/update/modifier_table_test.cpp @@ -38,7 +38,6 @@ namespace { using namespace mongo::modifiertable; -using std::unique_ptr; TEST(getType, Normal) { ASSERT_EQUALS(getType("$set"), MOD_SET); diff --git a/src/mongo/db/update/object_replace_executor_test.cpp b/src/mongo/db/update/object_replace_executor_test.cpp index 9b97daf02de..38228708553 100644 --- a/src/mongo/db/update/object_replace_executor_test.cpp +++ b/src/mongo/db/update/object_replace_executor_test.cpp @@ -50,8 +50,6 @@ namespace mongo { namespace { using ObjectReplaceExecutorTest = UpdateTestFixture; -using mongo::mutablebson::countChildren; -using mongo::mutablebson::Element; TEST_F(ObjectReplaceExecutorTest, Noop) { auto obj = fromjson("{a: 1, b: 2}"); diff --git a/src/mongo/db/update/object_transform_executor_test.cpp b/src/mongo/db/update/object_transform_executor_test.cpp index 0ec74a30b27..09a7e521998 100644 --- a/src/mongo/db/update/object_transform_executor_test.cpp +++ b/src/mongo/db/update/object_transform_executor_test.cpp @@ -49,8 +49,6 @@ namespace mongo { namespace { using ObjectTransformExecutorTest = UpdateTestFixture; -using mongo::mutablebson::countChildren; -using mongo::mutablebson::Element; TEST_F(ObjectTransformExecutorTest, Noop) { BSONObj input = fromjson("{a: 1, b: 2}"); diff --git a/src/mongo/db/update/pullall_node_test.cpp b/src/mongo/db/update/pullall_node_test.cpp index f01c82c3337..2cb501ae4e3 100644 --- a/src/mongo/db/update/pullall_node_test.cpp +++ b/src/mongo/db/update/pullall_node_test.cpp @@ -51,8 +51,6 @@ namespace mongo { namespace { using PullAllNodeTest = UpdateTestFixture; -using mongo::mutablebson::countChildren; -using mongo::mutablebson::Element; TEST(PullAllNodeTest, InitWithIntFails) { auto update = fromjson("{$pullAll: {a: 1}}"); diff --git a/src/mongo/db/update/push_node_test.cpp b/src/mongo/db/update/push_node_test.cpp index fd4718a6f8b..d119ed11f0b 100644 --- a/src/mongo/db/update/push_node_test.cpp +++ b/src/mongo/db/update/push_node_test.cpp @@ -59,8 +59,6 @@ namespace mongo { namespace { using PushNodeTest = UpdateTestFixture; -using mongo::mutablebson::countChildren; -using mongo::mutablebson::Element; TEST(PushNodeTest, EachClauseWithNonArrayObjectFails) { auto update = fromjson("{$push: {x: {$each: {'0': 1}}}}"); diff --git a/src/mongo/db/update/rename_node_test.cpp b/src/mongo/db/update/rename_node_test.cpp index bb3363ebc29..c33dda9e660 100644 --- a/src/mongo/db/update/rename_node_test.cpp +++ b/src/mongo/db/update/rename_node_test.cpp @@ -47,8 +47,6 @@ namespace mongo { namespace { using RenameNodeTest = UpdateTestFixture; -using mongo::mutablebson::countChildren; -using mongo::mutablebson::Element; TEST(RenameNodeTest, PositionalNotAllowedInFromField) { auto update = fromjson("{$rename: {'a.$': 'b'}}"); diff --git a/src/mongo/db/update/set_node_test.cpp b/src/mongo/db/update/set_node_test.cpp index d5550115dd0..9303ea828e8 100644 --- a/src/mongo/db/update/set_node_test.cpp +++ b/src/mongo/db/update/set_node_test.cpp @@ -50,7 +50,6 @@ namespace mongo { namespace { using SetNodeTest = UpdateTestFixture; -using mongo::mutablebson::countChildren; using mongo::mutablebson::Element; DEATH_TEST_REGEX(SetNodeTest, InitFailsForEmptyElement, R"#(Invariant failure.*modExpr.ok\(\))#") { diff --git a/src/mongo/dbtests/basictests.cpp b/src/mongo/dbtests/basictests.cpp index 77e449119e3..8dfe162358c 100644 --- a/src/mongo/dbtests/basictests.cpp +++ b/src/mongo/dbtests/basictests.cpp @@ -55,10 +55,8 @@ using std::cout; using std::dec; using std::endl; using std::hex; -using std::shared_ptr; using std::string; using std::stringstream; -using std::unique_ptr; using std::vector; class RarelyTest { diff --git a/src/mongo/dbtests/documentsourcetests.cpp b/src/mongo/dbtests/documentsourcetests.cpp index 3e39546244c..90e5c99d205 100644 --- a/src/mongo/dbtests/documentsourcetests.cpp +++ b/src/mongo/dbtests/documentsourcetests.cpp @@ -96,7 +96,6 @@ namespace mongo { namespace { using boost::intrusive_ptr; -using std::unique_ptr; using std::vector; static const NamespaceString nss = diff --git a/src/mongo/dbtests/mock_replica_set_test.cpp b/src/mongo/dbtests/mock_replica_set_test.cpp index 049f8411f10..7f85b12bb53 100644 --- a/src/mongo/dbtests/mock_replica_set_test.cpp +++ b/src/mongo/dbtests/mock_replica_set_test.cpp @@ -60,7 +60,6 @@ using mongo::BSONElement; using mongo::BSONObj; using mongo::BSONObjBuilder; using mongo::BSONObjIterator; -using mongo::ConnectionString; using mongo::HostAndPort; using mongo::MockDBClientConnection; using mongo::MockRemoteDBServer; diff --git a/src/mongo/dbtests/query_plan_executor.cpp b/src/mongo/dbtests/query_plan_executor.cpp index 6c0fba729ac..ce707b8bc92 100644 --- a/src/mongo/dbtests/query_plan_executor.cpp +++ b/src/mongo/dbtests/query_plan_executor.cpp @@ -84,7 +84,6 @@ namespace mongo { namespace { -using std::shared_ptr; using std::string; using std::unique_ptr; diff --git a/src/mongo/rpc/metadata_test.cpp b/src/mongo/rpc/metadata_test.cpp index 6c7e4299a34..ecb33efa6ef 100644 --- a/src/mongo/rpc/metadata_test.cpp +++ b/src/mongo/rpc/metadata_test.cpp @@ -52,7 +52,6 @@ namespace { using namespace mongo; using namespace mongo::rpc; -using mongo::unittest::assertGet; BSONObj addDollarDB(BSONObj command, StringData db) { return BSONObjBuilder(std::move(command)).append("$db", db).obj(); diff --git a/src/mongo/rpc/object_check_test.cpp b/src/mongo/rpc/object_check_test.cpp index 7846c0e408f..30e74c515bc 100644 --- a/src/mongo/rpc/object_check_test.cpp +++ b/src/mongo/rpc/object_check_test.cpp @@ -46,7 +46,6 @@ namespace { using namespace mongo; using std::begin; using std::end; -using std::swap; TEST(DataTypeValidated, BSONValidationEnabled) { bool wasEnabled = serverGlobalParams.objcheck; diff --git a/src/mongo/s/catalog/sharding_catalog_client_test.cpp b/src/mongo/s/catalog/sharding_catalog_client_test.cpp index 621130edfdf..56353cbf010 100644 --- a/src/mongo/s/catalog/sharding_catalog_client_test.cpp +++ b/src/mongo/s/catalog/sharding_catalog_client_test.cpp @@ -85,10 +85,7 @@ namespace mongo { namespace { -using executor::NetworkInterfaceMock; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; -using executor::TaskExecutor; using repl::OpTime; using rpc::ReplSetMetadata; using std::vector; diff --git a/src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp b/src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp index 75f58e0e7a3..78b490f4b87 100644 --- a/src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp +++ b/src/mongo/s/catalog/sharding_catalog_write_retry_test.cpp @@ -81,14 +81,9 @@ namespace mongo { namespace { -using executor::NetworkInterfaceMock; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; -using executor::TaskExecutor; -using std::set; using std::string; using std::vector; -using unittest::assertGet; using InsertRetryTest = ShardingTestFixture; using UpdateRetryTest = ShardingTestFixture; diff --git a/src/mongo/s/catalog/type_collection_test.cpp b/src/mongo/s/catalog/type_collection_test.cpp index e179333ca5f..4e6e1413ab1 100644 --- a/src/mongo/s/catalog/type_collection_test.cpp +++ b/src/mongo/s/catalog/type_collection_test.cpp @@ -43,7 +43,6 @@ namespace mongo { namespace { -using unittest::assertGet; TEST(CollectionType, Empty) { ASSERT_THROWS(CollectionType(BSONObj()), DBException); diff --git a/src/mongo/s/cluster_identity_loader_test.cpp b/src/mongo/s/cluster_identity_loader_test.cpp index 56272304239..15208e428ae 100644 --- a/src/mongo/s/cluster_identity_loader_test.cpp +++ b/src/mongo/s/cluster_identity_loader_test.cpp @@ -65,10 +65,7 @@ namespace mongo { namespace { -using executor::NetworkInterfaceMock; using executor::RemoteCommandRequest; -using executor::TaskExecutor; -using unittest::assertGet; BSONObj getReplSecondaryOkMetadata() { BSONObjBuilder o; diff --git a/src/mongo/s/collection_routing_info_targeter_test.cpp b/src/mongo/s/collection_routing_info_targeter_test.cpp index e626b9f7801..90a7c7f8468 100644 --- a/src/mongo/s/collection_routing_info_targeter_test.cpp +++ b/src/mongo/s/collection_routing_info_targeter_test.cpp @@ -75,7 +75,6 @@ namespace mongo { namespace { -using unittest::assertGet; const NamespaceString kNss = NamespaceString::createNamespaceString_forTest("TestDB", "TestColl"); diff --git a/src/mongo/s/commands/cluster_user_management_commands.cpp b/src/mongo/s/commands/cluster_user_management_commands.cpp index 645c0ee508f..bb45dce1052 100644 --- a/src/mongo/s/commands/cluster_user_management_commands.cpp +++ b/src/mongo/s/commands/cluster_user_management_commands.cpp @@ -72,7 +72,6 @@ namespace mongo { using std::string; using std::stringstream; -using std::vector; using namespace fmt::literals; namespace { diff --git a/src/mongo/s/request_types/merge_chunks_request_test.cpp b/src/mongo/s/request_types/merge_chunks_request_test.cpp index 7f3870c201b..0b8734926f9 100644 --- a/src/mongo/s/request_types/merge_chunks_request_test.cpp +++ b/src/mongo/s/request_types/merge_chunks_request_test.cpp @@ -48,7 +48,6 @@ namespace mongo { namespace { -using unittest::assertGet; ChunkRange chunkRange(BSON("a" << 1), BSON("a" << 10)); IDLParserContext ctx("_configsvrCommitChunksMerge"); diff --git a/src/mongo/s/routing_table_history_test.cpp b/src/mongo/s/routing_table_history_test.cpp index 0734683e8bf..977239a1eeb 100644 --- a/src/mongo/s/routing_table_history_test.cpp +++ b/src/mongo/s/routing_table_history_test.cpp @@ -82,7 +82,6 @@ using chunks_test_util::calculateShardsMaxValidAfter; using chunks_test_util::calculateShardVersions; using chunks_test_util::genChunkVector; using chunks_test_util::genRandomChunkVector; -using chunks_test_util::getShardId; using chunks_test_util::performRandomChunkOperations; namespace { diff --git a/src/mongo/s/sharding_mongos_test_fixture.cpp b/src/mongo/s/sharding_mongos_test_fixture.cpp index eae8af039f2..73a920c4207 100644 --- a/src/mongo/s/sharding_mongos_test_fixture.cpp +++ b/src/mongo/s/sharding_mongos_test_fixture.cpp @@ -106,9 +106,7 @@ namespace mongo { using executor::NetworkInterfaceMock; using executor::NetworkTestEnv; using executor::RemoteCommandRequest; -using executor::RemoteCommandResponse; using executor::ShardingTaskExecutor; -using unittest::assertGet; namespace { diff --git a/src/mongo/s/sharding_test_fixture_common.cpp b/src/mongo/s/sharding_test_fixture_common.cpp index a5741c12573..54d1a54b027 100644 --- a/src/mongo/s/sharding_test_fixture_common.cpp +++ b/src/mongo/s/sharding_test_fixture_common.cpp @@ -59,7 +59,6 @@ namespace mongo { using executor::NetworkTestEnv; -using unittest::assertGet; ShardingTestFixtureCommon::ShardingTestFixtureCommon() = default; diff --git a/src/mongo/shell/linenoise.cpp b/src/mongo/shell/linenoise.cpp index 3a347f95696..f3af0454c41 100644 --- a/src/mongo/shell/linenoise.cpp +++ b/src/mongo/shell/linenoise.cpp @@ -141,7 +141,6 @@ using std::unique_ptr; using linenoise_utf8::copyString32; using linenoise_utf8::copyString32to8; using linenoise_utf8::copyString8to32; -using linenoise_utf8::strlen32; using linenoise_utf8::strncmp32; using linenoise_utf8::UChar32; using linenoise_utf8::UChar8; diff --git a/src/mongo/shell/program_runner.cpp b/src/mongo/shell/program_runner.cpp index 27e08e59d21..3af80a292ae 100644 --- a/src/mongo/shell/program_runner.cpp +++ b/src/mongo/shell/program_runner.cpp @@ -94,8 +94,7 @@ namespace mongo::shell_utils { using std::cout; using std::endl; -using std::make_pair; -using std::pair; +using std::make_pair; // NOLINT(misc-unused-using-decls) - used on Windows using std::string; using std::stringstream; using std::vector; diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp index 347621e7332..ae5175a2a6d 100644 --- a/src/mongo/shell/shell_utils_launcher.cpp +++ b/src/mongo/shell/shell_utils_launcher.cpp @@ -99,14 +99,10 @@ namespace mongo { -using std::cout; -using std::endl; -using std::make_pair; -using std::map; -using std::pair; +using std::cout; // NOLINT(misc-unused-using-decls) - used on Windows +using std::endl; // NOLINT(misc-unused-using-decls) - used on Windows using std::string; using std::stringstream; -using std::unique_ptr; using std::vector; /** diff --git a/src/mongo/transport/service_executor_test.cpp b/src/mongo/transport/service_executor_test.cpp index b80537ea379..062ae1347a2 100644 --- a/src/mongo/transport/service_executor_test.cpp +++ b/src/mongo/transport/service_executor_test.cpp @@ -90,7 +90,6 @@ constexpr auto kWorkerThreadRunTime = Milliseconds{1000}; // Run time + generous scheduling time slice constexpr auto kShutdownTime = Milliseconds{kWorkerThreadRunTime.count() + 50}; -using unittest::JoinThread; /* This implements the portions of the transport::Reactor based on ASIO, but leaves out * the methods not needed by ServiceExecutors. diff --git a/src/mongo/util/options_parser/environment.cpp b/src/mongo/util/options_parser/environment.cpp index fba63ec9492..8f8c02dcb12 100644 --- a/src/mongo/util/options_parser/environment.cpp +++ b/src/mongo/util/options_parser/environment.cpp @@ -39,7 +39,6 @@ namespace mongo { namespace optionenvironment { -using std::shared_ptr; using std::string; using std::type_info; diff --git a/src/mongo/util/options_parser/environment_test.cpp b/src/mongo/util/options_parser/environment_test.cpp index 09e2333d1e7..fbaaf49238e 100644 --- a/src/mongo/util/options_parser/environment_test.cpp +++ b/src/mongo/util/options_parser/environment_test.cpp @@ -38,7 +38,6 @@ namespace { -using mongo::ErrorCodes; using mongo::Status; namespace moe = mongo::optionenvironment; diff --git a/src/mongo/util/processinfo_test.cpp b/src/mongo/util/processinfo_test.cpp index b58006683f9..724b98ac53f 100644 --- a/src/mongo/util/processinfo_test.cpp +++ b/src/mongo/util/processinfo_test.cpp @@ -42,7 +42,6 @@ #include "mongo/unittest/temp_dir.h" #include "mongo/util/processinfo.h" -using boost::optional; using mongo::unittest::TempDir; namespace mongo { diff --git a/src/mongo/util/read_through_cache_test.cpp b/src/mongo/util/read_through_cache_test.cpp index 2d026ad874a..696789406e1 100644 --- a/src/mongo/util/read_through_cache_test.cpp +++ b/src/mongo/util/read_through_cache_test.cpp @@ -56,8 +56,6 @@ namespace mongo { namespace { -using unittest::assertGet; - // The structure for testing is intentionally made movable, but non-copyable struct CachedValue { CachedValue(int counter) : counter(counter) {}