Skip to content

turn some long-deprecated -C options into errors#154498

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
RalfJung:option-deprecations
May 8, 2026
Merged

turn some long-deprecated -C options into errors#154498
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
RalfJung:option-deprecations

Conversation

@RalfJung
Copy link
Copy Markdown
Member

@RalfJung RalfJung commented Mar 28, 2026

With them being ignored there's always a risk someone thinks they'll do something and they don't notice the warning. I think these have been deprecated for long enough that we can turn them into hard errors.

Also change the type of these fields to () so there's no information here that the rest of the compiler could use. This supersedes the rustc_lint_opt_deny_field_access trick.

MCP: rust-lang/compiler-team#978

@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 Mar 28, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 28, 2026

r? @fmease

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 12 candidates

@rust-log-analyzer

This comment has been minimized.

@RalfJung RalfJung force-pushed the option-deprecations branch from 8826f95 to e754f88 Compare March 28, 2026 09:21
@rust-log-analyzer

This comment has been minimized.

@RalfJung RalfJung force-pushed the option-deprecations branch from e754f88 to 8813c8c Compare March 28, 2026 10:17
@rust-log-analyzer

This comment has been minimized.

@RalfJung RalfJung force-pushed the option-deprecations branch from 8813c8c to 957ca22 Compare March 28, 2026 11:13
@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented Mar 28, 2026

@Mark-Simulacrum
Copy link
Copy Markdown
Member

A GitHub search finds a bunch of cases of inline-threshold, from a quick skim it looks like it's set in two relatively popular fuzzing/coverage related libraries:

-Cno-stack-check appears in:

-Car is much harder to search for, I didn't find any cases, but I think we should cut PRs and get them merged at least against the above cases. Doing a rg against crates.io would probably also be good (cc https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Put.20all.20crates.20on.20dev.20desktops/with/581193254...)

@RalfJung
Copy link
Copy Markdown
Member Author

Thanks for the search!

  • I filed an issue for honggfuzz
  • cov seems to be unmaintained (last update 8 years ago)
  • The occurrence in cc-rs is just a list of all flags to aid in parsing command-line invocations

@RalfJung RalfJung added the S-waiting-on-MCP Status: PR has a compiler MCP and is waiting for the compiler MCP to complete. label Mar 28, 2026
@RalfJung RalfJung force-pushed the option-deprecations branch from fd0b941 to d78c023 Compare March 28, 2026 17:39
@rustbot

This comment has been minimized.

@RalfJung RalfJung force-pushed the option-deprecations branch from d78c023 to e49e85b Compare March 28, 2026 19:20
Copy link
Copy Markdown
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

r=me once MCP completes @bors rollup

View changes since this review

@fmease fmease removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2026
@@ -1,2 +0,0 @@
warning: `-C ar`: this option is deprecated and does nothing
Copy link
Copy Markdown
Member

@chenyukang chenyukang May 8, 2026

Choose a reason for hiding this comment

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

Could we keep test for the new hard errors instead of deleting these tests outright?

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I could add one of them back, but it seems kinda pointless to me to test the same thing 4 times.

@RalfJung RalfJung force-pushed the option-deprecations branch from e49e85b to 9af2553 Compare May 8, 2026 06:40
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 8, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@RalfJung
Copy link
Copy Markdown
Member Author

RalfJung commented May 8, 2026

@bors r=fmease

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 8, 2026

📋 This PR cannot be approved because it currently has the following label: S-waiting-on-MCP.

@fmease fmease removed the S-waiting-on-MCP Status: PR has a compiler MCP and is waiting for the compiler MCP to complete. label May 8, 2026
@fmease
Copy link
Copy Markdown
Member

fmease commented May 8, 2026

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 8, 2026

📌 Commit 9af2553 has been approved by fmease

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 8, 2026
rust-bors Bot pushed a commit that referenced this pull request May 8, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #156236 (resolve: Remove `MacroData`)
 - #156298 (Rename the unstable integer `extend` function to `widen`)
 - #154498 (turn some long-deprecated -C options into errors)
 - #155734 (Reject outer attributes on `cfg_select` branches)
 - #156123 (Simplify the creation of synthetic HIR.)
 - #156175 (Dep graph cleanups)
 - #156214 (Do not cache `lints_that_dont_need_to_run` across sessions)
rust-bors Bot pushed a commit that referenced this pull request May 8, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #156236 (resolve: Remove `MacroData`)
 - #156298 (Rename the unstable integer `extend` function to `widen`)
 - #154498 (turn some long-deprecated -C options into errors)
 - #155734 (Reject outer attributes on `cfg_select` branches)
 - #156123 (Simplify the creation of synthetic HIR.)
 - #156175 (Dep graph cleanups)
 - #156214 (Do not cache `lints_that_dont_need_to_run` across sessions)
@rust-bors rust-bors Bot merged commit c6fbd9f into rust-lang:main May 8, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 8, 2026
rust-timer added a commit that referenced this pull request May 8, 2026
Rollup merge of #154498 - RalfJung:option-deprecations, r=fmease

turn some long-deprecated -C options into errors

- `-Car` has been documented to do nothing for more than 8 years (691ab6c)  and causes a warning for more than a year (#135126).
- `-Cno-stack-check` has been made a NOP and deprecated with a warning more than 9 years ago (c670293)
- `-Cinline-threshold` has been made a NOP and deprecated with a warning almost 2 years ago (#124712).

With them being ignored there's always a risk someone thinks they'll do something and they don't notice the warning. I think these have been deprecated for long enough that we can turn them into hard errors.

Also change the type of these fields to `()` so there's no information here that the rest of the compiler could use. This supersedes the `rustc_lint_opt_deny_field_access` trick.

MCP: rust-lang/compiler-team#978
@RalfJung RalfJung deleted the option-deprecations branch May 9, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

7 participants