Skip to content

Revert performing basic const checks in typeck on stable#154930

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
oli-obk:revert-const-check
Apr 9, 2026
Merged

Revert performing basic const checks in typeck on stable#154930
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
oli-obk:revert-const-check

Conversation

@oli-obk
Copy link
Copy Markdown
Contributor

@oli-obk oli-obk commented Apr 7, 2026

Revert #149375, it caused a (desirable, but unintended) change where we now emit errors about constants in dead code. This was due to mir never seeing dead code, so no const checks being run on it. But typeck sees all written code and will check it.

We'll land this again, with a proper types FCP and everything

fixes #153765

see #t-types/nominated > #153765: 1.95 beta regression: trait method calls in dead c… for discussions

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 7, 2026

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

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

rustbot commented Apr 7, 2026

r? @chenyukang

rustbot has assigned @chenyukang.
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 11 candidates

@theemathas theemathas added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 7, 2026
@chenyukang
Copy link
Copy Markdown
Member

@bors r=chenyukang

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 7, 2026

📌 Commit fe1e292 has been approved by chenyukang

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 Apr 7, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…yukang

Revert performing basic const checks in typeck on stable

Revert rust-lang#149375, it caused a (desirable, but unintended) change where we now emit errors about constants in dead code. This was due to mir never seeing dead code, so no const checks being run on it. But typeck sees all written code and will check it.

We'll land this again, with a proper types FCP and everything

fixes rust-lang#153765

see [#t-types/nominated > rust-lang#153765: 1.95 beta regression: trait method calls in dead c…](https://rust-lang.zulipchat.com/#narrow/channel/326866-t-types.2Fnominated/topic/.23153765.3A.201.2E95.20beta.20regression.3A.20trait.20method.20calls.20in.20dead.20c.E2.80.A6/with/580203072) for discussions
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…yukang

Revert performing basic const checks in typeck on stable

Revert rust-lang#149375, it caused a (desirable, but unintended) change where we now emit errors about constants in dead code. This was due to mir never seeing dead code, so no const checks being run on it. But typeck sees all written code and will check it.

We'll land this again, with a proper types FCP and everything

fixes rust-lang#153765

see [#t-types/nominated > rust-lang#153765: 1.95 beta regression: trait method calls in dead c…](https://rust-lang.zulipchat.com/#narrow/channel/326866-t-types.2Fnominated/topic/.23153765.3A.201.2E95.20beta.20regression.3A.20trait.20method.20calls.20in.20dead.20c.E2.80.A6/with/580203072) for discussions
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…yukang

Revert performing basic const checks in typeck on stable

Revert rust-lang#149375, it caused a (desirable, but unintended) change where we now emit errors about constants in dead code. This was due to mir never seeing dead code, so no const checks being run on it. But typeck sees all written code and will check it.

We'll land this again, with a proper types FCP and everything

fixes rust-lang#153765

see [#t-types/nominated > rust-lang#153765: 1.95 beta regression: trait method calls in dead c…](https://rust-lang.zulipchat.com/#narrow/channel/326866-t-types.2Fnominated/topic/.23153765.3A.201.2E95.20beta.20regression.3A.20trait.20method.20calls.20in.20dead.20c.E2.80.A6/with/580203072) for discussions
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors try jobs=x86_64-gnu-llvm-21-3

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Apr 7, 2026
Revert performing basic const checks in typeck on stable


try-job: x86_64-gnu-llvm-21-3
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r-
Probably caused #154953 (comment)

@rust-bors rust-bors bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 7, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 7, 2026

This pull request was unapproved.

This PR was contained in a rollup (#154953), which was unapproved.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 7, 2026

💔 Test for 44ed07e failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

JonathanBrouwer commented Apr 7, 2026

Wait for #154609 before reapproving this because of soft conflicts independently from the problem above

@mejrs
Copy link
Copy Markdown
Contributor

mejrs commented Apr 8, 2026

Wait for #154609 before reapproving this because of soft conflicts independently from the problem above

It has merged, this PR can land now.

@jieyouxu jieyouxu assigned jieyouxu and unassigned jieyouxu Apr 8, 2026
@oli-obk oli-obk force-pushed the revert-const-check branch from fe1e292 to d37d2be Compare April 9, 2026 09:37
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 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.

@oli-obk
Copy link
Copy Markdown
Contributor Author

oli-obk commented Apr 9, 2026

@bors r=chenyukang

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

📌 Commit d37d2be has been approved by chenyukang

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 9, 2026
@wesleywiser
Copy link
Copy Markdown
Member

@bors p=1

beta nominated backport

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

beta backport approved as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle. Backport labels are handled by them.

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Apr 9, 2026
@lqd
Copy link
Copy Markdown
Member

lqd commented Apr 9, 2026

A backport PR will be authored by the release team at the end of the current development cycle

just noting: a backport PR is already open in #155033, but we haven't removed the nomination label yet.

@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 9, 2026
This was referenced Apr 9, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 9, 2026
[beta] reverts and backports

This reverts two `dbg!` changes to avoid regressions[^1][^2] in the upcoming 1.95 release:

- std: avoid tearing `dbg!` prints #149869
- don't drop arguments' temporaries in `dbg!` #154074
  - ... which was previously backported in #154725

This also reverts a stabilization over a late issue[^3] of semantics:

- Stabilize `assert_matches` #137487

And a few other backport/reverts from `main`:

- Revert performing basic const checks in typeck on stable #154930 / #155033
- Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph" #154712
- Clarify that core::range ranges do not have special syntax #155002
  
[^1]: #153850
[^2]: #154988
[^3]: #154406
rust-bors bot pushed a commit that referenced this pull request Apr 9, 2026
…uwer

Rollup of 2 pull requests

Successful merges:

 - #155042 (Update cargo submodule)
 - #154930 (Revert performing basic const checks in typeck on stable)
rust-timer added a commit that referenced this pull request Apr 9, 2026
Rollup merge of #154930 - oli-obk:revert-const-check, r=chenyukang

Revert performing basic const checks in typeck on stable

Revert #149375, it caused a (desirable, but unintended) change where we now emit errors about constants in dead code. This was due to mir never seeing dead code, so no const checks being run on it. But typeck sees all written code and will check it.

We'll land this again, with a proper types FCP and everything

fixes #153765

see [#t-types/nominated > #153765: 1.95 beta regression: trait method calls in dead c…](https://rust-lang.zulipchat.com/#narrow/channel/326866-t-types.2Fnominated/topic/.23153765.3A.201.2E95.20beta.20regression.3A.20trait.20method.20calls.20in.20dead.20c.E2.80.A6/with/580203072) for discussions
@rust-bors rust-bors bot merged commit db99e16 into rust-lang:main Apr 9, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 9, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 9, 2026
[beta] reverts and backports

This reverts two `dbg!` changes to avoid regressions[^1][^2] in the upcoming 1.95 release:

- std: avoid tearing `dbg!` prints #149869
- don't drop arguments' temporaries in `dbg!` #154074
  - ... which was previously backported in #154725

This also reverts a stabilization over a late issue[^3] of semantics:

- Stabilize `assert_matches` #137487

And a few other backport/reverts from `main`:

- Revert performing basic const checks in typeck on stable #154930 / #155033
- Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph" #154712
- Clarify that core::range ranges do not have special syntax #155002

Clippy is backporting 2 ICE fixes and 1 perf regression (via #155051):

- rust-lang/rust-clippy#16685 already backported in #154211 to stable. This makes sure that it doesn't regress again in beta/next stable
- rust-lang/rust-clippy#16659 The ICE that is being fixed here was introduced in the 1.95 release cycle
- rust-lang/rust-clippy#16652 Perf regression introduced in the 1.95 release cycle.
  
[^1]: #153850
[^2]: #154988
[^3]: #154406
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-accepted Accepted for backporting to the compiler in the beta channel. 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.

1.95 beta regression: trait method calls in dead code in const contexts started being rejected if the impl is not const