Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 38bc544

Browse files
committed
Enable f16 and f128 when creating the API change list
Additionally, read glob output as absoulte paths. This enables the script to work properly even when invoked from a different directory.
1 parent ab5f7bd commit 38bc544

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

etc/update-api-list.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from typing import Any, TypeAlias
1414

1515
ETC_DIR = Path(__file__).parent
16+
ROOT_DIR = ETC_DIR.parent
1617

1718
IndexTy: TypeAlias = dict[str, dict[str, Any]]
1819
"""Type of the `index` item in rustdoc's JSON output"""
@@ -56,10 +57,12 @@ def get_rustdoc_json() -> dict[Any, Any]:
5657
"--edition=2021",
5758
"--document-private-items",
5859
"--output-format=json",
60+
"--cfg=f16_enabled",
61+
"--cfg=f128_enabled",
5962
"-Zunstable-options",
6063
"-o-",
6164
],
62-
cwd=ETC_DIR.parent,
65+
cwd=ROOT_DIR,
6366
text=True,
6467
)
6568
j = json.loads(j)
@@ -105,8 +108,8 @@ def _init_defs(self, index: IndexTy) -> None:
105108

106109
# A lot of the `arch` module is often configured out so doesn't show up in docs. Use
107110
# string matching as a fallback.
108-
for fname in glob("src/math/arch/**.rs", root_dir=ETC_DIR.parent):
109-
contents = Path(fname).read_text()
111+
for fname in glob("src/math/arch/**.rs", root_dir=ROOT_DIR):
112+
contents = (ROOT_DIR.joinpath(fname)).read_text()
110113

111114
for name in self.public_functions:
112115
if f"fn {name}" in contents:

0 commit comments

Comments
 (0)