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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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

5354 tests run: 5131 passed, 1 failed, 222 skipped (full report)


Failures on Postgres 17

# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_sharding_split_failures[debug-pg17-failure13]"
Flaky tests (2)

Postgres 17

Test coverage report is not available

The comment gets automatically updated with the latest test results
1ce7f9a at 2024-11-04T18:05:17.043Z :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.
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.

2 participants