Skip to content

Conversation

@Kivooeo
Copy link
Member

@Kivooeo Kivooeo commented Dec 4, 2025

For some reason it works, it checks function output type and suppress warning if type is uninhabited

This double negations in code breaks my mind actually

I'd love to revisit this part in future and try to find a proper solution maybe, but for now I feel like it's enough before release to fix the issue? I really wonder what team does think, especially @cjgillot and other people who are more confident in this part of compiler than I do

I tried a lot of things here, it's only approach that pass all tests included new regression one

fixes #149571

r? compiler

@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 4, 2025
@apiraino
Copy link
Contributor

apiraino commented Dec 5, 2025

PR has been just opened so probably still early to evaluate a backport but I'll add the nomination just in case, so we don't overlook this patch - we're getting very close to the release deadline.

Thank you @Kivooeo !

@rustbot label beta-nominated

@rustbot rustbot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 5, 2025
Copy link
Member

@davidtwco davidtwco 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 after fixing nit

View changes since this review

@rust-cloud-vms rust-cloud-vms bot force-pushed the infallible-type-unreachable-code branch 2 times, most recently from bc43cdc to 7160ae5 Compare December 9, 2025 12:49
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the infallible-type-unreachable-code branch from 7160ae5 to 2a2da78 Compare December 9, 2025 13:18
@Kivooeo
Copy link
Member Author

Kivooeo commented Dec 9, 2025

@bors r=davidtwco

@bors
Copy link
Collaborator

bors commented Dec 9, 2025

📌 Commit 2a2da78 has been approved by davidtwco

It is now in the queue for this repository.

@bors bors 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 Dec 9, 2025
bors added a commit that referenced this pull request Dec 9, 2025
Rollup of 5 pull requests

Successful merges:

 - #144938 (Enable `outline-atomics` by default on more AArch64 platforms)
 - #146579 (Handle macro invocation in attribute during parse)
 - #149400 (unstable proc_macro tracked::* rename/restructure)
 - #149664 (attempt to fix unreachable code regression )
 - #149806 (Mirror `ubuntu:24.04` on ghcr)

Failed merges:

 - #149789 (Cleanup in the attribute parsers)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Dec 9, 2025
Rollup of 5 pull requests

Successful merges:

 - #144938 (Enable `outline-atomics` by default on more AArch64 platforms)
 - #146579 (Handle macro invocation in attribute during parse)
 - #149400 (unstable proc_macro tracked::* rename/restructure)
 - #149664 (attempt to fix unreachable code regression )
 - #149806 (Mirror `ubuntu:24.04` on ghcr)

Failed merges:

 - #149789 (Cleanup in the attribute parsers)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6188f82 into rust-lang:main Dec 10, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 10, 2025
rust-timer added a commit that referenced this pull request Dec 10, 2025
Rollup merge of #149664 - Kivooeo:infallible-type-unreachable-code, r=davidtwco

attempt to fix unreachable code regression

For some reason it works, it checks function output type and suppress warning if type is uninhabited

~~This double negations in code breaks my mind actually~~

I'd love to revisit this part in future and try to find a proper solution maybe, but for now I feel like it's enough before release to fix the issue? I really wonder what team does think, especially `@cjgillot` and other people who are more confident in this part of compiler than I do

I tried a lot of things here, it's only approach that pass all tests included new regression one

fixes #149571

r? compiler
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Dec 11, 2025
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144938 (Enable `outline-atomics` by default on more AArch64 platforms)
 - rust-lang/rust#146579 (Handle macro invocation in attribute during parse)
 - rust-lang/rust#149400 (unstable proc_macro tracked::* rename/restructure)
 - rust-lang/rust#149664 (attempt to fix unreachable code regression )
 - rust-lang/rust#149806 (Mirror `ubuntu:24.04` on ghcr)

Failed merges:

 - rust-lang/rust#149789 (Cleanup in the attribute parsers)

r? `@ghost`
`@rustbot` modify labels: rollup
@apiraino
Copy link
Contributor

Beta backport accepted 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 handled by them.

(As the milestone label implies, this is a backport for 1.93)

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Dec 11, 2025
@Kobzol
Copy link
Member

Kobzol commented Dec 16, 2025

@rust-timer build 2fe9b51

Trying if this regressed perf. in #149818.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2fe9b51): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.3%] 16
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 14
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.3%] 16

Max RSS (memory usage)

Results (primary 1.4%, secondary 1.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
1.3% [1.3%, 1.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [1.4%, 1.4%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 471.772s -> 476.618s (1.03%)
Artifact size: 389.00 MiB -> 389.02 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Dec 16, 2025
@Kobzol
Copy link
Member

Kobzol commented Dec 16, 2025

It seems like this caused a perf. regression. Do you think something could be done to reduce it?

@Kivooeo
Copy link
Member Author

Kivooeo commented Dec 16, 2025

Hmm, I think that I can try (not sure if it help or not)

What will happen if I push changes to this merged branch?

@Kobzol
Copy link
Member

Kobzol commented Dec 16, 2025

That's not really useful for anything, it should be a new PR :)

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. beta-nominated Nominated for backporting to the compiler in the beta channel. perf-regression Performance regression. 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.

rustc 1.92.0-beta3 flags unreachable code where there is none

8 participants