Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make traits / trait methods detected by the dead code lint #118257

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

mu001999
Copy link
Contributor

@mu001999 mu001999 commented Nov 24, 2023

Fixes #118139 and #41883

@rustbot
Copy link
Collaborator

rustbot commented Nov 24, 2023

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@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 Nov 24, 2023
@mu001999

This comment was marked as outdated.

@Urgau
Copy link
Member

Urgau commented Nov 24, 2023

  1. This change would affect many tests and current codes, the checking of edition is just a temporary solution. Are there any better solutions?

Does it manly just affect tests? If that's the case we can just put #[allow] in them.

In any case could you post (via pastebin or something else, since GitHub will probably limit you) the full output of the new warnings. So we can get a sense of scale of new warnings.

@cjgillot
Copy link
Contributor

Does it manly just affect tests? If that's the case we can just put #[allow] in them.

Ui tests allow unused code lint by default. So there is nothing to do on most.

@shepmaster
Copy link
Member

shepmaster commented Nov 25, 2023

This change would affect many tests and current codes

In #92790 / #95977, I also caused a lot of new warnings to show up :-) There we started the lint as allow-by-default (and appear to still treat it as such... I should look into that).

Perhaps we start the same way here?

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) label Nov 25, 2023
@rustbot
Copy link
Collaborator

rustbot commented Nov 25, 2023

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Some changes might have occurred in exhaustiveness checking

cc @Nadrieril

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor

Could you extract the cleanups you do to the rest of the compiler to a standalone PR?

@mu001999

This comment was marked as resolved.

@rust-log-analyzer

This comment has been minimized.

@shepmaster
Copy link
Member

@bors r=@cjgillot

@bors
Copy link
Contributor

bors commented Feb 7, 2024

📌 Commit c7519d4 has been approved by cjgillot

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 7, 2024
@bors
Copy link
Contributor

bors commented Feb 7, 2024

⌛ Testing commit c7519d4 with merge d4f6f9e...

@bors
Copy link
Contributor

bors commented Feb 7, 2024

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing d4f6f9e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 7, 2024
@bors bors merged commit d4f6f9e into rust-lang:master Feb 7, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 7, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d4f6f9e): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.1%, 1.8%] 18
Regressions ❌
(secondary)
9.4% [0.2%, 16.0%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.1%, 1.8%] 18

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.8% [2.3%, 3.3%] 7
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.8% [2.3%, 3.3%] 7

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.4% [0.8%, 2.0%] 4
Regressions ❌
(secondary)
7.8% [2.1%, 16.3%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [0.8%, 2.0%] 4

Binary size

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

Bootstrap: 663.003s -> 664.334s (0.20%)
Artifact size: 308.08 MiB -> 308.22 MiB (0.05%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 7, 2024
@shepmaster
Copy link
Member

High-level check on the perf results...

  1. wf-projection-stress-65510 now reports a warning when it didn't before, so it's probably the diagnostic machinery being lazy-initialized.

  2. exa-0.10.1,issue-88862, syn-1.0.89 have new warnings reported in addition to previous.

  3. serde-1.0.136, bitmaps-3.1.0, diesel-1.4.8 do not have new warnings produced.

@tamird
Copy link
Contributor

tamird commented Feb 8, 2024

Regression: #120770.

@Kobzol
Copy link
Contributor

Kobzol commented Feb 13, 2024

The compiler now does more work, so some small regressions are expected. The large regression is from initializing diagnostics (there were no warning produced before for that stress test), so that is fine, as it's a one-time cost.

@rustbot label: +perf-regression-triaged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-SGX Target: SGX O-wasi Operating system: Wasi, Webassembly System Interface perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dead code lint should include unused default trait methods in the unused chain