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

Disable rust_2024_compatibility lint option #9615

Merged
merged 2 commits into from
Nov 8, 2024
Merged

Conversation

hlinnaka
Copy link
Contributor

@hlinnaka hlinnaka commented Nov 3, 2024

Compiling with nightly rust compiler, I'm getting a lot of errors like this:

error: `if let` assigns a shorter lifetime since Edition 2024
   --> proxy/src/auth/backend/jwt.rs:226:16
    |
226 |             if let Some(permit) = self.try_acquire_permit() {
    |                ^^^^^^^^^^^^^^^^^^^-------------------------
    |                                   |
    |                                   this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
    |
    = warning: this changes meaning in Rust 2024
    = note: for more information, see issue #124085 <https://github.com/rust-lang/rust/issues/124085>
help: the value is now dropped here in Edition 2024
   --> proxy/src/auth/backend/jwt.rs:241:13
    |
241 |             } else {
    |             ^
note: the lint level is defined here
   --> proxy/src/lib.rs:8:5
    |
8   |     rust_2024_compatibility
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    = note: `#[deny(if_let_rescope)]` implied by `#[deny(rust_2024_compatibility)]`

and this:

error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021
   --> proxy/src/auth/backend/jwt.rs:376:18
    |
369 |         let client = Client::builder()
    |             ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024
...
376 |             map: DashMap::default(),
    |                  ^^^^^^^^^^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2024
    = note: for more information, see issue #123739 <https://github.com/rust-lang/rust/issues/123739>
    = note: `#[deny(tail_expr_drop_order)]` implied by `#[deny(rust_2024_compatibility)]`

They are caused by the rust_2024_compatibility lint option.

When we actually switch to the 2024 edition, it makes sense to go through all these and check that the drop order changes don't break anything, but in the meanwhile, there's no easy way to avoid these errors. Disable it, to allow compiling with nightly again.

@hlinnaka hlinnaka requested a review from a team as a code owner November 3, 2024 16:50
Copy link

github-actions bot commented Nov 3, 2024

5363 tests run: 5141 passed, 0 failed, 222 skipped (full report)


Flaky tests (3)

Postgres 17

Postgres 16

Code coverage* (full report)

  • functions: 31.7% (7852 of 24775 functions)
  • lines: 49.4% (62105 of 125833 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
de9ee01 at 2024-11-07T23:26:58.355Z :recycle:

Compiling with nightly rust compiler, I'm getting a lot of errors like this:

    error: `if let` assigns a shorter lifetime since Edition 2024
       --> proxy/src/auth/backend/jwt.rs:226:16
        |
    226 |             if let Some(permit) = self.try_acquire_permit() {
        |                ^^^^^^^^^^^^^^^^^^^-------------------------
        |                                   |
        |                                   this value has a significant drop implementation which may observe a major change in drop order and requires your discretion
        |
        = warning: this changes meaning in Rust 2024
        = note: for more information, see issue #124085 <rust-lang/rust#124085>
    help: the value is now dropped here in Edition 2024
       --> proxy/src/auth/backend/jwt.rs:241:13
        |
    241 |             } else {
        |             ^
    note: the lint level is defined here
       --> proxy/src/lib.rs:8:5
        |
    8   |     rust_2024_compatibility
        |     ^^^^^^^^^^^^^^^^^^^^^^^
        = note: `#[deny(if_let_rescope)]` implied by `#[deny(rust_2024_compatibility)]`

and this:

    error: these values and local bindings have significant drop implementation that will have a different drop order from that of Edition 2021
       --> proxy/src/auth/backend/jwt.rs:376:18
        |
    369 |         let client = Client::builder()
        |             ------ these values have significant drop implementation and will observe changes in drop order under Edition 2024
    ...
    376 |             map: DashMap::default(),
        |                  ^^^^^^^^^^^^^^^^^^
        |
        = warning: this changes meaning in Rust 2024
        = note: for more information, see issue #123739 <rust-lang/rust#123739>
        = note: `#[deny(tail_expr_drop_order)]` implied by `#[deny(rust_2024_compatibility)]`

They are caused by the `rust_2024_compatibility` lint option.

When we actually switch to the 2024 edition, it makes sense to go
through all these and check that the drop order changes don't break
anything, but in the meanwhile, there's no easy way to avoid these
errors. Disable it, to allow compiling with nightly again.
@arpad-m arpad-m added this pull request to the merge queue Nov 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 8, 2024
@conradludgate conradludgate added this pull request to the merge queue Nov 8, 2024
@bayandin bayandin removed this pull request from the merge queue due to the queue being cleared Nov 8, 2024
@conradludgate conradludgate merged commit 79929bb into main Nov 8, 2024
81 checks passed
@conradludgate conradludgate deleted the fix-nightly branch November 8, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants