Skip to content

Conversation

@jkelley129
Copy link

@jkelley129 jkelley129 commented Dec 12, 2025

This PR updates the rustc.1 manpage to reflect that the -O flag is equivalent to -C opt-level=3 (matching rustc --help). It also adds a maintenance script to keep this documentation in sync with the compiler.

Documentation

  • Updated the description of -O in rustc.1 to state that it corresponds to -C opt-level=3.

Tooling

Added a new script: src/tools/update-rustc-man-opt-level.py, which:

  • Extracts the -Oopt-level mapping from rustc --help (or a provided expected level).
  • Updates the manpage accordingly, with a conservative heuristic to avoid unrelated rewrites.
  • Supports dry-run by default and optional apply mode with automatic backups.
  • Displays colored unified diffs for review.
  • Allows specifying a custom rustc binary.

Fixes: #149875

Copilot AI review requested due to automatic review settings December 12, 2025 04:40
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 12, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2025

r? @GuillaumeGomez

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

This comment was marked as spam.

@rust-log-analyzer

This comment has been minimized.

@jkelley129 jkelley129 marked this pull request as draft December 12, 2025 04:55
@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 12, 2025
@bjorn3
Copy link
Member

bjorn3 commented Dec 12, 2025

Would you mind disabling the option in your user profile to automatically request copilot reviews?

@GuillaumeGomez
Copy link
Member

r? compiler

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 12, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jkelley129 jkelley129 closed this Dec 16, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

rustc man page does not match rustc --help output

6 participants