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

Update code to remove lots of warnings from Rust 1.83 #15593

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

gregnazario
Copy link
Contributor

@gregnazario gregnazario commented Dec 13, 2024

Description

There are a ton of warnings for mostly cosmetic things added to Rust 1.83. For anything that was complex, or required renaming, I added an allow.

Otherwise main things changed:

  1. Features are required, so all names missing were added. Not much was looked into why the features existed.
  2. Lifetimes are now elided '_ or sometimes named specifically 'a, each are approached correctly.
  3. Now Rust checks ceil_div implementations and adds them accordingly
  4. Lots of code was "unused", so dead_code annotation is added
  5. Lots of unwrap_or, or other improvements about code that's unnecessary
  6. Documentation is for some reason really aggressively formatted now. So, this fixes most of them. May be slightly off, but it should be good enough.
  7. There are some checks with macros, those have been updated accordingly or ignored in the case of poem and the MoveVM cc @banool @georgemitenkov

How Has This Been Tested?

We're running the full testsuite on this PR to ensure it works.

Key Areas to Review

For each area, please review and ensure there is no behavior change. For the Move compiler, and storage, most of the changes are just removing <'a> and moving to '_ as per the compiler.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Dec 13, 2024

⏱️ 5h 31m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
execution-performance / single-node-performance 1h 13m 🟥🟥🟥🟥🟥
execution-performance / test-target-determinator 42m 🟩🟩🟩🟩🟥 (+1 more)
rust-unit-tests 24m 🟥
rust-unit-tests 24m 🟥
rust-unit-tests 23m 🟥
test-target-determinator 23m 🟩🟩🟩🟥
check 14m 🟩🟩🟩🟩
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
rust-move-tests 13m 🟩
check-dynamic-deps 11m 🟩🟩🟩🟩🟩 (+3 more)
rust-cargo-deny 9m 🟥🟥🟥🟥🟥 (+1 more)
fetch-last-released-docker-image-tag 6m 🟩🟩🟩🟩
rust-doc-tests 6m 🟩

🚨 3 jobs on the last run were significantly faster/slower than expected

Job Duration vs 7d avg Delta
test-target-determinator 7m 4m +71%
execution-performance / test-target-determinator 7m 4m +68%
execution-performance / single-node-performance 24m 18m +34%

settingsfeedbackdocs ⋅ learn more about trunk.io

@rustielin rustielin added CICD:build-images when this label is present github actions will start build+push rust images from the PR. CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR CICD:run-all-unit-tests Runs all unit tests labels Dec 13, 2024
Copy link
Contributor

@banool banool left a comment

Choose a reason for hiding this comment

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

I reviewed the stuff I'm familiar with (faucet, CLI, indexer) pretty closely and skimmed the rest, looks good.

@@ -305,6 +305,7 @@ impl CheckerTrait for RedisRatelimitChecker {

/// All we have to do here is decrement the counter if the request was a failure due
/// to something wrong on our end.
#[allow(dependency_on_unit_never_type_fallback)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Allowing this seems fine to me for now, the proper never type (!) isn't even stable yet, we'll revisit it later when it is.

} else {
num_tasks
}
num_tasks.clamp(1, MAX_FETCH_TASKS_PER_REQUEST)
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat

This comment has been minimized.

@gregnazario gregnazario force-pushed the update-to-latest-rust branch from b0d6beb to 5148caa Compare January 12, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CICD:build-images when this label is present github actions will start build+push rust images from the PR. CICD:run-all-unit-tests Runs all unit tests CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants