SERVER-90645 Enable tidy check misc-unused-using-decls (#22430)

Co-authored-by: Benety Goh <benety@mongodb.com>
GitOrigin-RevId: e97b100882e14cca504952d321cedfb135321240
This commit is contained in:
Matt Kneiser 2024-05-23 10:17:58 -07:00 committed by MongoDB Bot
parent afbf36d56a
commit 5e886ad953
153 changed files with 4 additions and 217 deletions

View File

@ -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,

View File

@ -73,7 +73,6 @@
namespace {
using namespace mongo;
using std::endl;
using std::unique_ptr;
void appendInvalidStringElement(const char* fieldName, BufBuilder* bb) {

View File

@ -59,8 +59,6 @@
namespace mongo {
using std::dec;
using std::hex;
using std::string;
const double BSONElement::kLongLongMaxPlusOneAsDouble =

View File

@ -70,7 +70,6 @@ namespace mongo {
namespace auth {
using executor::RemoteCommandRequest;
using executor::RemoteCommandResponse;
using AuthRequest = StatusWith<RemoteCommandRequest>;

View File

@ -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;

View File

@ -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<long long> DBClientBase::ConnectionIdSequence;

View File

@ -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,

View File

@ -74,7 +74,6 @@
namespace mongo {
using std::endl;
using std::string;
using std::unique_ptr;
using std::vector;

View File

@ -67,8 +67,6 @@
namespace mongo {
using std::endl;
using std::map;
using std::set;
using std::shared_ptr;
using std::string;

View File

@ -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;

View File

@ -93,10 +93,7 @@
namespace mongo {
using std::endl;
using std::map;
using std::string;
using std::unique_ptr;
MONGO_FAIL_POINT_DEFINE(dbClientSessionDisableChecksum);

View File

@ -59,7 +59,6 @@ namespace mongo {
namespace {
using executor::RemoteCommandRequest;
using executor::RemoteCommandResponse;
using RemoteCommandCallbackArgs = executor::TaskExecutor::RemoteCommandCallbackArgs;
const char* kCursorFieldName = "cursor";

View File

@ -45,7 +45,6 @@
namespace mongo {
using std::numeric_limits;
using std::set;
using std::shared_ptr;
using std::string;

View File

@ -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 {

View File

@ -80,8 +80,6 @@
namespace mongo {
using executor::RemoteCommandRequest;
using executor::RemoteCommandResponse;
using std::endl;
namespace {

View File

@ -49,7 +49,6 @@
namespace mongo {
using std::string;
using std::unique_ptr;
StatusWith<bool> SaslSCRAMClientConversation::step(StringData inputData, std::string* outputData) {
_step++;

View File

@ -72,7 +72,6 @@ namespace {
MONGO_FAIL_POINT_DEFINE(overrideMaxAwaitTimeMS);
using executor::NetworkInterface;
using executor::NetworkInterfaceThreadPool;
using executor::TaskExecutor;
using executor::ThreadPoolTaskExecutor;

View File

@ -76,7 +76,6 @@ namespace {
using executor::NetworkInterfaceMock;
using executor::RemoteCommandResponse;
using executor::ThreadPoolExecutorTest;
using InNetworkGuard = NetworkInterfaceMock::InNetworkGuard;
class ServerDiscoveryMonitorTestFixture : public unittest::Test {

View File

@ -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;

View File

@ -75,7 +75,6 @@ namespace {
const sdam::HelloRTT initialRTT = duration_cast<Milliseconds>(Milliseconds(100));
using executor::NetworkInterfaceMock;
using executor::RemoteCommandResponse;
using executor::ThreadPoolExecutorTest;
using InNetworkGuard = NetworkInterfaceMock::InNetworkGuard;
class ServerPingMonitorTestFixture : public unittest::Test {

View File

@ -67,8 +67,6 @@
namespace mongo {
namespace {
using repl::OplogEntry;
using unittest::assertGet;
class AuthOpObserverTest : public ServiceContextMongoDTest {
public:

View File

@ -54,7 +54,6 @@
namespace mongo {
using std::min;
using std::string;
using std::stringstream;

View File

@ -92,7 +92,6 @@ namespace {
const std::string kTestingDurableHistoryPinName = "_testing";
using repl::UnreplicatedWritesBlock;
using std::endl;
using std::string;
using std::stringstream;

View File

@ -80,7 +80,6 @@
namespace mongo {
using std::set;
using std::string;
using std::unique_ptr;

View File

@ -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;

View File

@ -42,7 +42,6 @@ namespace mongo {
using std::numeric_limits;
using std::unique_ptr;
using std::vector;
// static
const char* AndSortedStage::kStageType = "AND_SORTED";

View File

@ -73,7 +73,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
namespace {
bool shouldIncludeStartRecord(const CollectionScanParams& params) {

View File

@ -38,7 +38,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
// static
const char* CountStage::kStageType = "COUNT";

View File

@ -81,7 +81,6 @@ bool isCompoundWildcardIndex(const IndexDescriptor* indexDescriptor) {
} // namespace
using std::unique_ptr;
using std::vector;
// static
const char* CountScan::kStageType = "COUNT_SCAN";

View File

@ -66,7 +66,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
namespace {

View File

@ -48,7 +48,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
// static
const char* DistinctScan::kStageType = "DISTINCT_SCAN";

View File

@ -35,7 +35,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
// static
const char* EOFStage::kStageType = "EOF";

View File

@ -42,7 +42,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
// static
const char* FetchStage::kStageType = "FETCH";

View File

@ -51,7 +51,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
// static
const char* IDHackStage::kStageType = "IDHACK";

View File

@ -36,7 +36,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
// static
const char* LimitStage::kStageType = "LIMIT";

View File

@ -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";

View File

@ -45,7 +45,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
const char* MultiIteratorStage::kStageType = "MULTI_ITERATOR";

View File

@ -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.

View File

@ -42,7 +42,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
// static
const char* OrStage::kStageType = "OR";

View File

@ -35,7 +35,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
const char* QueuedDataStage::kStageType = "QUEUED_DATA";

View File

@ -49,9 +49,7 @@
namespace mongo {
using std::shared_ptr;
using std::unique_ptr;
using std::vector;
// static
const char* ShardFilterStage::kStageType = "SHARDING_FILTER";

View File

@ -36,7 +36,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
// static
const char* SkipStage::kStageType = "SKIP";

View File

@ -56,7 +56,6 @@
namespace mongo {
using std::endl;
using std::unique_ptr;
using std::vector;

View File

@ -41,7 +41,6 @@
namespace mongo {
using std::unique_ptr;
using std::vector;
const char* TextMatchStage::kStageType = "TEXT_MATCH";

View File

@ -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";

View File

@ -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

View File

@ -53,8 +53,6 @@ namespace {
using namespace mongo;
using std::cout;
using std::endl;
using std::string;
using std::stringstream;

View File

@ -45,8 +45,6 @@
namespace mongo {
using std::unique_ptr;
namespace {
typedef unsigned char HashDigest[16];

View File

@ -53,9 +53,6 @@
using namespace mongo;
using std::cout;
using std::endl;
using std::unique_ptr;
using std::vector;
namespace {

View File

@ -48,7 +48,6 @@
namespace mongo {
using boolean_simplification::BitsetTreeNode;
using boolean_simplification::Maxterm;
using boolean_simplification::Minterm;
namespace {

View File

@ -59,7 +59,6 @@ namespace mongo {
namespace {
using unittest::assertGet;
const double kNaN = std::numeric_limits<double>::quiet_NaN();

View File

@ -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,

View File

@ -64,7 +64,6 @@
namespace mongo {
using std::endl;
using std::string;
TEST(MatchExpressionParserLeafTest, NullCollation) {

View File

@ -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:

View File

@ -38,7 +38,6 @@
namespace mongo {
using boolean_simplification::BitsetTreeNode;
using boolean_simplification::makeBitsetTerm;
using boolean_simplification::Maxterm;
using boolean_simplification::Minterm;

View File

@ -84,7 +84,6 @@
namespace mongo {
namespace {
using std::pair;
using std::string;
using std::unique_ptr;

View File

@ -48,7 +48,6 @@
namespace mongo {
namespace {
using std::unique_ptr;
TEST(InternalSchemaXorOp, MatchesNothingWhenHasNoClauses) {
InternalSchemaXorMatchExpression internalSchemaXorOp;

View File

@ -105,7 +105,6 @@
namespace mongo {
using repl::DurableOplogEntry;
using repl::MutableOplogEntry;
using ChangeStreamPreImageRecordingMode = repl::ReplOperation::ChangeStreamPreImageRecordingMode;

View File

@ -44,7 +44,6 @@
namespace mongo {
namespace {
using std::set;
using std::string;
template <size_t ArrayLen>

View File

@ -61,9 +61,7 @@
namespace mongo {
namespace {
using boost::intrusive_ptr;
using std::deque;
using std::vector;
using MockMongoInterface = StubLookupSingleDocumentProcessInterface;

View File

@ -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 {

View File

@ -94,9 +94,7 @@
namespace mongo {
namespace {
using executor::NetworkInterfaceMock;
using executor::RemoteCommandRequest;
using executor::RemoteCommandResponse;
using ResponseStatus = executor::TaskExecutor::ResponseStatus;

View File

@ -60,7 +60,6 @@
namespace mongo {
namespace {
using boost::intrusive_ptr;
using std::vector;
//

View File

@ -57,7 +57,6 @@
namespace mongo {
namespace ExpressionTests {
namespace {
using boost::intrusive_ptr;
using std::vector;
namespace Object {

View File

@ -42,7 +42,6 @@
namespace expression_tests {
using boost::intrusive_ptr;
using namespace mongo;
// assertApproxEq is a helper function for asserting approximate results.

View File

@ -55,7 +55,6 @@
namespace mongo {
namespace ExpressionTests {
namespace {
using boost::intrusive_ptr;
using std::string;
/**

View File

@ -38,7 +38,6 @@ namespace mongo {
namespace {
using std::string;
using std::vector;
/** FieldPath constructed from empty string. */
TEST(FieldPathTest, Empty) {

View File

@ -47,7 +47,6 @@
namespace mongo {
using boost::intrusive_ptr;
namespace {
const double DELTA = 0.0001;

View File

@ -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;

View File

@ -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<FindCommandRequest> createFindCommand(
const intrusive_ptr<ExpressionContext>& expCtx,

View File

@ -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,

View File

@ -41,7 +41,6 @@
namespace mongo {
namespace {
using boost::intrusive_ptr;
using DocumentSourceVectorSearchTest = AggregationContextFixture;
TEST_F(DocumentSourceVectorSearchTest, NotAllowedInTransaction) {

View File

@ -41,7 +41,6 @@
namespace mongo {
using boost::intrusive_ptr;
SingleDocumentTransformationProcessor::SingleDocumentTransformationProcessor(
std::unique_ptr<TransformerInterface> parsedTransform)

View File

@ -35,9 +35,7 @@
namespace mongo {
using boost::intrusive_ptr;
using std::string;
using std::vector;
UnwindProcessor::UnwindProcessor(const FieldPath& unwindPath,
bool preserveNullAndEmptyArrays,

View File

@ -54,7 +54,6 @@
#include "mongo/util/assert_util.h"
#include "mongo/util/str.h"
using boost::intrusive_ptr;
using boost::optional;
namespace mongo {

View File

@ -39,7 +39,6 @@ namespace mongo {
namespace process_health {
using test::FaultManagerTest;
using test::FaultManagerTestImpl;
namespace {

View File

@ -64,7 +64,6 @@ namespace mongo {
namespace process_health {
using test::FaultManagerTest;
using test::FaultManagerTestImpl;
namespace {

View File

@ -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;

View File

@ -137,7 +137,6 @@ using ce::HeuristicEstimator;
using ce::HistogramEstimator;
using ce::SamplingEstimator;
using cost_model::CostEstimatorImpl;
using cost_model::CostModelManager;
static std::pair<IndexDefinitions, MultikeynessTrie> buildIndexSpecsOptimizer(
boost::intrusive_ptr<ExpressionContext> expCtx,

View File

@ -53,7 +53,6 @@
namespace mongo {
using std::unique_ptr;
// Failpoint for checking whether we've received a getmore.
MONGO_FAIL_POINT_DEFINE(failReceivedGetmore);

View File

@ -39,7 +39,6 @@ namespace mongo::optimizer {
namespace {
using sbe::MakeObjSpec;
using sbe::value::TypeTags;
using FieldAction = MakeObjSpec::FieldAction;
using FieldActions = std::vector<std::pair<StringData, FieldAction>>;

View File

@ -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();

View File

@ -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;

View File

@ -84,7 +84,6 @@
namespace mongo {
using namespace fmt::literals;
using std::shared_ptr;
using std::string;
using std::unique_ptr;
using std::vector;

View File

@ -50,7 +50,6 @@ namespace {
using std::make_unique;
using std::string;
using std::unique_ptr;
using std::vector;
unique_ptr<PlanStageStats> makeStats(const char* name,
StageType type,

View File

@ -87,7 +87,6 @@
namespace mongo {
using std::endl;
using std::pair;
using std::string;
using std::unique_ptr;

View File

@ -62,7 +62,6 @@
namespace {
using std::string;
using std::unique_ptr;
using std::vector;
using namespace mongo;

View File

@ -594,7 +594,6 @@ StatusWith<std::unique_ptr<QuerySolution>> tryToBuildSearchQuerySolution(
}
} // namespace
using std::numeric_limits;
using std::unique_ptr;
namespace dps = ::mongo::dotted_path_support;

View File

@ -68,7 +68,6 @@
namespace mongo {
using unittest::assertGet;
void QueryPlannerTest::setUp() {
nss = NamespaceString::createNamespaceString_forTest("test.collection");

View File

@ -83,7 +83,6 @@ namespace mongo {
namespace {
using std::unique_ptr;
using unittest::assertGet;
static const NamespaceString testns =
NamespaceString::createNamespaceString_forTest("testdb.testcoll");

View File

@ -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

View File

@ -56,7 +56,6 @@ namespace mongo {
namespace repl {
namespace {
using unittest::EnsureFCV;
TEST_F(ServiceContextTest, ValidateConfigForInitiate_VersionMustBe1) {
ReplicationCoordinatorExternalStateMock rses;

View File

@ -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;

View File

@ -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<Latch>* lk, const std::function<void()>& fn) {

View File

@ -94,7 +94,6 @@ namespace {
using executor::NetworkInterfaceMock;
using executor::RemoteCommandRequest;
using executor::RemoteCommandResponse;
typedef ReplicationCoordinator::ReplSetReconfigArgs ReplSetReconfigArgs;

View File

@ -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.

View File

@ -58,7 +58,6 @@ namespace {
using namespace mongo;
using namespace mongo::repl;
using executor::NetworkInterfaceMock;
using executor::RemoteCommandRequest;
using executor::RemoteCommandResponse;

View File

@ -54,8 +54,6 @@ namespace {
using namespace mongo;
using namespace mongo::repl;
using executor::NetworkInterfaceMock;
using executor::RemoteCommandResponse;
using LockGuard = stdx::lock_guard<Latch>;

View File

@ -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;

View File

@ -70,8 +70,6 @@
namespace mongo {
using executor::TaskExecutor;
using executor::ThreadPoolExecutorTest;
namespace repl {

Some files were not shown because too many files have changed in this diff Show More