Skip to content

Conversation

@epage
Copy link
Contributor

@epage epage commented Dec 9, 2025

T-lang came back on the stabilization PR (#148051) asking for CR to be disallowed
to leave room for all stray CRs to be rejected in the future.
At that point, the test can remain but the implementation can be
removed.

If that plan does not go through, we'll need to re-evaluate

  • whether this is more lint-like and should defer to the calling tool
    that is managing the frontmatter
  • how much Rust should treat the frontmatter as Rust and apply the same
    grammar restrictions of "no stray CR" (like raw string literals)

Part of #136889

@epage epage added the F-frontmatter `#![feature(frontmatter)]` label Dec 9, 2025
@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 Dec 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 9, 2025

r? @lcnr

rustbot has assigned @lcnr.
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

@epage epage mentioned this pull request Dec 9, 2025
10 tasks
@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Dec 10, 2025
@joshtriplett
Copy link
Member

joshtriplett commented Dec 10, 2025

Given that text-direction-codepoint-in-literal and text-direction-codepoint-in-comment are lints, I do think it makes sense for this and the similar error in raw strings to be a lint as well. I doubt that anyone is going to allow it, but I still think it makes sense to not be a hard error.

That said, I don't think switching this from a hard error to a lint should be a blocker. Let's go ahead with the simple version of this change to unblock stabilization.

@epage
Copy link
Contributor Author

epage commented Dec 10, 2025

@joshtriplett this only prevents the use of CR and not the text direction code points.

However, this is making me more against doing CR in the first place if CR as an error is just a "simple version" of what we actually want.

If these should be lints, they should be lints in the tool that owns processing the frontmatter. If we have them as lints in rustc, we then have both tools running those lints as they likely have a format outside of the frontmatter that should also lint and that would be generic code across the files. Having both lint can lead to a bad user experience including:

  • disagreeing on lint levels and the user having to manage that
  • potentially showing duplicate warnings

If we error on CR now and then remove it because tools should do it, that is a subtle change that could easily get lost in communicating back out to those tools.

@epage epage marked this pull request as draft December 10, 2025 17:40
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 10, 2025
@epage
Copy link
Contributor Author

epage commented Dec 10, 2025

I've moved this to a draft until this is sorted out so we don't accidentally merge this

@Kivooeo
Copy link
Member

Kivooeo commented Dec 10, 2025

r? me

epage added 5 commits January 28, 2026 13:01
T-lang came back on the stabilization PR asking for CR to be disallowed
to leave room for all stray CRs to be rejected in the future.
At that point, the test can remain but the implementation can be
removed.

If that plan does not go through, we'll need to re-evaluate
- whether this is more lint-like and should defer to the calling tool
  that is managing the frontmatter
- how much Rust should treat the frontmatter as Rust and apply the same
  grammar restrictions of "no stray CR" (like raw string literals)
@epage epage force-pushed the f branch 2 times, most recently from 54dbfe1 to 52d4ef1 Compare January 28, 2026 19:04
@epage epage marked this pull request as ready for review January 28, 2026 19:05
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 28, 2026
@epage
Copy link
Contributor Author

epage commented Jan 28, 2026

This was discussed on the stabilization PR starting at #148051 (comment). Between there and the T-lang meeting discussions, a new reason for rejecting CRs came up: potentially changing CRLF normalization to reject all stray CRs. This is now viewed as a stop gap until then and not a final statement on what should be done if that CRLF normalization change is not made.

@Kivooeo
Copy link
Member

Kivooeo commented Jan 28, 2026

This is now viewed as a stop gap until then and not a final statement on what should be done if that CRLF normalization change is not made

according to this, would it be reasonable to place a FIXME in code for future? like "remove it once CRLF normalization change been made"

@epage
Copy link
Contributor Author

epage commented Jan 28, 2026

Personally, I'm against FIXMEs. They represent a hidden, stale backlog.

But if the local way of doings things is to have one I can add it.

@Kivooeo
Copy link
Member

Kivooeo commented Jan 29, 2026

fine, otherwise everything looks good

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 29, 2026

📌 Commit 52d4ef1 has been approved by Kivooeo

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 29, 2026
Rollup of 5 pull requests

Successful merges:

 - #151775 (Portable SIMD subtree update)
 - #151488 (Tweak E0599 to consolidate unsatisfied trait bound messages)
 - #149823 (fix(parser): Disallow CR in frontmatter )
 - #151475 (add foregin type tests for issue 64458)
 - #151657 (Cleanup of `#[derive(Diagnostic)]` attribute parsers)
@rust-bors rust-bors bot merged commit b6ce0c0 into rust-lang:main Jan 29, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 29, 2026
rust-timer added a commit that referenced this pull request Jan 29, 2026
Rollup merge of #149823 - epage:f, r=Kivooeo

fix(parser): Disallow CR in frontmatter

T-lang came back on the stabilization PR (#148051) asking for CR to be disallowed
to leave room for all stray CRs to be rejected in the future.
At that point, the test can remain but the implementation can be
removed.

If that plan does not go through, we'll need to re-evaluate
- whether this is more lint-like and should defer to the calling tool
  that is managing the frontmatter
- how much Rust should treat the frontmatter as Rust and apply the same
  grammar restrictions of "no stray CR" (like raw string literals)

Part of #136889
@epage epage deleted the f branch January 29, 2026 15:40
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 30, 2026
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151775 (Portable SIMD subtree update)
 - rust-lang/rust#151488 (Tweak E0599 to consolidate unsatisfied trait bound messages)
 - rust-lang/rust#149823 (fix(parser): Disallow CR in frontmatter )
 - rust-lang/rust#151475 (add foregin type tests for issue 64458)
 - rust-lang/rust#151657 (Cleanup of `#[derive(Diagnostic)]` attribute parsers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-frontmatter `#![feature(frontmatter)]` I-lang-radar Items that are on lang's radar and will need eventual work or consideration. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants