-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Generate macro expansion for rust compiler crates docs #150022
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
base: main
Are you sure you want to change the base?
Generate macro expansion for rust compiler crates docs #150022
Conversation
|
Failed to set assignee to
|
|
Huuuum. Interesting. r? kobzol |
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, let's test it on rustc.
|
@bors r+ |
…on, r=Kobzol Generate macro expansion for rust compiler crates docs This enables the `--generate-macro-expansion` rustdoc flag, generating possibility to expand macros directly in source code pages (rust-lang#137229). Needed this new feature when I was working on rust-lang#149919 and I thought "why not enable it by default?". So here we go. Not too sure who to r? here so: r? `@kobzol`
Rollup of 14 pull requests Successful merges: - #148756 (Warn on codegen attributes on required trait methods) - #148790 (Add new Tier-3 target: riscv64im-unknown-none-elf) - #149271 (feat: dlopen Enzyme) - #149459 (std: sys: fs: uefi: Implement set_times and set_perm) - #149771 (bootstrap readme: make easy to read when editor wrapping is not enabled) - #149856 (Provide an extended framework for type visit, for use in rust-analyzer) - #149950 (Simplify how inline asm handles `MaybeUninit`) - #150014 (Metadata loader cleanups) - #150021 (document that mpmc channels deliver an item to (at most) one receiver) - #150022 (Generate macro expansion for rust compiler crates docs) - #150029 (Update books) - #150031 (assert impossible branch is impossible) - #150034 (do not add `I-prioritize` when `F-*` labels are present) - #150036 (Use the embeddable filename for coverage artifacts) r? `@ghost` `@rustbot` modify labels: rollup
|
Possibly failed in rollup? #150039 (comment) @bors r- |
|
@bors try jobs=dist-x86_64-linux-alt |
This comment has been minimized.
This comment has been minimized.
Generate macro expansion for rust compiler crates docs try-job: dist-x86_64-linux-alt
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for 0ac0f58 failed: CI. Failed jobs:
|
|
Was able to write a minified code to reproduce the bug: struct Bar {
bla: bool,
}
macro_rules! f {
() => {{ false }}
}
const X: Bar = Bar {
bla: !f!(),
};Just need to run it with |
…otamofek [rustdoc] Fix invalid handling of field followed by negated macro call This is the bug uncovered in rust-lang#150022. Once fixed Ill rebuild all compiler docs and see if we can enable the option for compiler docs. =D It's a weird case where we extracted some tokens out of the iterator and then, when checking next items (from this iterator), it didn't find the `:` token, and therefore badly assumed the token kind. The solution I came up with is to instead not extract tokens from the iterator and to count how many tokens are in the current path. So when iterate over the items, instead of having a mix of extracted tokens and tokens still inside the iterator, we now only iterate over the iterator. The biggest change here is that `get_full_ident_path` will return an option instead of a `Vec`, and if it's contains `:` (one, not two), then it will return `None` and the `:` will be handled like any token and not like a path (which is more correct imo). r? `@yotamofek`
This enables the
--generate-macro-expansionrustdoc flag, generating possibility to expand macros directly in source code pages (#137229).Needed this new feature when I was working on #149919 and I thought "why not enable it by default?". So here we go.
Not too sure who to r? here so:
r? @Kobzol