Skip to content

fix: Include frontmatter in -Zunpretty output #143708

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

epage
Copy link
Contributor

@epage epage commented Jul 9, 2025

In the implementation (#140035), this was left as an open question for
the tracking issue (#136889). My assumption is that this should be
carried over.

The test was carried over from #137193 which was superseded by #140035.

Thankfully, either way, -Zunpretty is unstable and we can always
change it even if we stabilize frontmatter.

@rustbot
Copy link
Collaborator

rustbot commented Jul 9, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 9, 2025
/// Creates an iterator that produces tokens from the input string.
///
/// Be sure to call [`strip_shebang`] first
pub fn tokenize_document(input: &str) -> impl Iterator<Item = Token> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this name + doc comment be more descriptive? i don't think it's obvious from the name or the doc comment that this one allows front-matter and the one above does not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively, tokenize could just take FrontmatterAllowed as an argument

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating tokenize looks to be a cross-repo change, also affecting clippy.

Looking over the external repos docs, it sounds like I'm free to make those updates in this PR and the maintainers of those subtrees will sync those back to the external repos?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, anything that you need to do to unbreak subrepos can be done in-tree.

epage added 2 commits July 9, 2025 16:42
In the implementation (rust-lang#140035), this was left as an open question for
the tracking issue (rust-lang#136889).  My assumption is that this should be
carried over.

Thankfully, either way, `-Zunpretty` is unstable and we can always
change it even if we stabilize frontmatter.
@rustbot
Copy link
Collaborator

rustbot commented Jul 9, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@compiler-errors
Copy link
Member

r=me when CI is green

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

Pls fix compiler/rustc_lexer/src/tests.rs, but maybe that's a good place to place a test too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants