Skip to content

Rollup of 10 pull requests #143919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7fc2127
bootstrap/miri: avoid rebuilds for test builds
RalfJung Jul 9, 2025
ef5c209
tidy: clippy fixes
hkBst Jul 9, 2025
a4e994e
tidy: simplify fluent file extension checking
hkBst Jul 10, 2025
9bd4c90
tidy: move to edition 2024
hkBst Jul 10, 2025
6356faf
tidy: use flatten instead of manual flatten
hkBst Jul 10, 2025
8bf88a2
tidy: use write_all
hkBst Jul 10, 2025
b703451
refine comment
RalfJung Jul 12, 2025
75561c4
Port `#[link_ordinal]` to the new attribute parsing infrastructure.
Periodic1911 Jun 29, 2025
a2d4139
Use zero for initialized Once state
orlp Jul 13, 2025
f041962
Add comment why we use zero for COMPLETE
orlp Jul 13, 2025
a3c90b6
Run bootstrap tests sooner in the `x test` pipeline
Kobzol Jul 13, 2025
25794b1
Compiletest: Simplify {Html,Json}DocCk directive handling
fmease Jul 12, 2025
6b02597
update issue number for `const_trait_impl`
fee1-dead Jul 13, 2025
937ef93
Bootstrap's `tool.TOOL_NAME.features` now works on any subcommand
Stypox Jul 10, 2025
b3ed035
Only compare tool name to apply features to
Stypox Jul 13, 2025
940aa20
Add comment about features not part of "extra-features"
Stypox Jul 13, 2025
6080c75
Change "allocated object" to "allocation".
theemathas Jul 14, 2025
90660f4
tiercheck: clippy fixes
hkBst Jul 14, 2025
39059f6
tiercheck: edition 2024
hkBst Jul 14, 2025
93c1027
Rollup merge of #143217 - Periodic1911:link-ordinal, r=jdonszelmann
Kobzol Jul 14, 2025
33d477f
Rollup merge of #143681 - RalfJung:bootstrap-miri-rebuilds, r=Kobzol
Kobzol Jul 14, 2025
0d4d85b
Rollup merge of #143724 - hkBst:tidy-cleanup, r=Mark-Simulacrum
Kobzol Jul 14, 2025
197ba7e
Rollup merge of #143733 - Stypox:bootstrap-tool-config-any, r=Kobzol
Kobzol Jul 14, 2025
2ec48e0
Rollup merge of #143850 - fmease:comptest-simp-docck-handling, r=jiey…
Kobzol Jul 14, 2025
a7ad680
Rollup merge of #143875 - fee1-dead-contrib:push-zvqrmzrprpzt, r=comp…
Kobzol Jul 14, 2025
70301da
Rollup merge of #143881 - orlp:once-state-repr, r=tgross35
Kobzol Jul 14, 2025
37b5d79
Rollup merge of #143887 - Kobzol:reroder-bootstrap-tests, r=jieyouxu
Kobzol Jul 14, 2025
b5312fe
Rollup merge of #143917 - theemathas:change-allocated-object-to-alloc…
Kobzol Jul 14, 2025
0d69847
Rollup merge of #143918 - hkBst:tier-check-cleanup, r=Kobzol
Kobzol Jul 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ Similar to shell commands,
directives can extend across multiple lines if their last char is `\`.
In this case, the start of the next line should be `//`, with no `@`.

Similar to compiletest directives, besides a space you can also use a colon `:` to separate
the directive name and the arguments, however a space is preferred for HtmlDocCk directives.

Use the special string `{{channel}}` in XPaths, `PATTERN` arguments and [snapshot files](#snapshot)
if you'd like to refer to the URL `https://doc.rust-lang.org/CHANNEL` where `CHANNEL` refers to the
current release channel (e.g, `stable` or `nightly`).
Expand Down
55 changes: 8 additions & 47 deletions src/etc/htmldocck.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,48 +147,17 @@ def concat_multi_lines(f):
print_err(lineno, line, "Trailing backslash at the end of the file")


def get_known_directive_names():
def filter_line(line):
line = line.strip()
return line.startswith('"') and (line.endswith('",') or line.endswith('"'))

# Equivalent to `src/tools/compiletest/src/header.rs` constant of the same name.
with open(
os.path.join(
# We go back to `src`.
os.path.dirname(os.path.dirname(__file__)),
"tools/compiletest/src/directive-list.rs",
),
"r",
encoding="utf8",
) as fd:
content = fd.read()
return [
line.strip().replace('",', "").replace('"', "")
for line in content.split("\n")
if filter_line(line)
]


# To prevent duplicating the list of commmands between `compiletest` and `htmldocck`, we put
# it into a common file which is included in rust code and parsed here.
# FIXME: This setup is temporary until we figure out how to improve this situation.
# See <https://github.com/rust-lang/rust/issues/125813#issuecomment-2141953780>.
KNOWN_DIRECTIVE_NAMES = get_known_directive_names()

LINE_PATTERN = re.compile(
r"""
//@\s+
(?P<negated>!?)(?P<cmd>[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)
(?P<args>.*)$
(?P<negated>!?)(?P<cmd>.+?)
(?:[\s:](?P<args>.*))?$
""",
re.X | re.UNICODE,
)

DEPRECATED_LINE_PATTERN = re.compile(
r"""
//\s+@
""",
r"//\s+@",
re.X | re.UNICODE,
)

Expand All @@ -209,12 +178,7 @@ def get_commands(template):

cmd = m.group("cmd")
negated = m.group("negated") == "!"
if not negated and cmd in KNOWN_DIRECTIVE_NAMES:
continue
args = m.group("args")
if args and not args[:1].isspace():
print_err(lineno, line, "Invalid template syntax")
continue
args = m.group("args") or ""
try:
args = shlex.split(args)
except UnicodeEncodeError:
Expand Down Expand Up @@ -636,14 +600,11 @@ def check_command(c, cache):
else:
raise InvalidCheck("Invalid number of {} arguments".format(c.cmd))

elif c.cmd == "valid-html":
raise InvalidCheck("Unimplemented valid-html")

elif c.cmd == "valid-links":
raise InvalidCheck("Unimplemented valid-links")

else:
raise InvalidCheck("Unrecognized {}".format(c.cmd))
# Ignore unknown directives as they might be compiletest directives
# since they share the same `//@` prefix by convention. In any case,
# compiletest rejects unknown directives for us.
return

if ret == c.negated:
raise FailedCheck(cerr)
Expand Down
260 changes: 0 additions & 260 deletions src/tools/compiletest/src/directive-list.rs

This file was deleted.

Loading