Skip to content

Commit 230ed1b

Browse files
Takuto Ikutacopybara-github
Takuto Ikuta
authored andcommitted
build: apply clang-tidy's misc-include-cleaner
Bug: 336474469 Change-Id: Ie3c4bbdde52c656736ea7237d2aa1122846ca779 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5514337 Auto-Submit: Takuto Ikuta <[email protected]> Reviewed-by: Nico Weber <[email protected]> Commit-Queue: Nico Weber <[email protected]> Cr-Commit-Position: refs/heads/main@{#1297491} NOKEYCHECK=True GitOrigin-RevId: 086c477041403d554cb3e54bea78ea4d17ec3d62
1 parent 9adbdbf commit 230ed1b

File tree

6 files changed

+25
-10
lines changed

6 files changed

+25
-10
lines changed

.clang-tidy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TODO(crbug.com/336474469): remove this after enabling the check in parent dir.
2+
InheritParentConfig: true
3+
Checks: misc-include-cleaner

.clangd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# TODO(crbug.com/336474469): remove this after enabling the check in parent dir.
2+
Diagnostics:
3+
UnusedIncludes: Strict
4+
MissingIncludes: Strict

rust/std/remap_alloc.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
#include <stdlib.h>
6+
57
#include <algorithm>
68
#include <cstddef>
79
#include <cstdlib>

rust/tests/test_cpp_including_rust/shared_unittests.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66

77
#include <memory>
88

9-
#include "base/allocator/buildflags.h"
10-
#include "base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.h"
11-
#include "base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h"
12-
#include "build/build_config.h"
9+
#include "base/allocator/partition_allocator/src/partition_alloc/partition_alloc_buildflags.h"
1310
#include "build/buildflag.h"
11+
#include "build/rust/tests/test_rust_shared_library/src/lib.rs.h"
1412
#include "testing/gtest/include/gtest/gtest.h"
1513

16-
#include "build/rust/tests/test_rust_shared_library/src/lib.rs.h"
14+
#if BUILDFLAG(HAS_64_BIT_POINTERS)
15+
#include "base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h"
16+
#else
17+
#include "base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.h"
18+
#endif
1719

1820
TEST(RustSharedTest, CppCallingIntoRust_BasicFFI) {
1921
EXPECT_EQ(7, add_two_ints_via_rust(3, 4));

rust/tests/test_cpp_including_rust/static_unittests.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66

77
#include <memory>
88

9-
#include "base/allocator/buildflags.h"
10-
#include "base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.h"
11-
#include "base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h"
12-
#include "build/build_config.h"
9+
#include "base/allocator/partition_allocator/src/partition_alloc/partition_alloc_buildflags.h"
1310
#include "build/buildflag.h"
11+
#include "build/rust/tests/test_rust_static_library/src/lib.rs.h"
1412
#include "testing/gtest/include/gtest/gtest.h"
1513

16-
#include "build/rust/tests/test_rust_static_library/src/lib.rs.h"
14+
#if BUILDFLAG(HAS_64_BIT_POINTERS)
15+
#include "base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h"
16+
#else
17+
#include "base/allocator/partition_allocator/src/partition_alloc/address_pool_manager_bitmap.h"
18+
#endif
1719

1820
TEST(RustStaticTest, CppCallingIntoRust_BasicFFI) {
1921
EXPECT_EQ(7, add_two_ints_via_rust(3, 4));

rust/tests/test_rust_calling_cpp/cpp_library.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "build/rust/tests/test_rust_calling_cpp/cpp_library.h"
66

7+
#include <cstdint>
8+
79
int32_t mul_by_2_in_cpp_library(int32_t a) {
810
return a * 2;
911
}

0 commit comments

Comments
 (0)