Skip to content

fix: correct destruction order comments in Drop TempFile example#2002

Merged
marioidival merged 1 commit intorust-lang:masterfrom
Abhinav-ranish:fix/1925-drop-destruction-order
Apr 1, 2026
Merged

fix: correct destruction order comments in Drop TempFile example#2002
marioidival merged 1 commit intorust-lang:masterfrom
Abhinav-ranish:fix/1925-drop-destruction-order

Conversation

@Abhinav-ranish
Copy link
Copy Markdown
Contributor

Fixes #1925

The comments incorrectly stated File::drop runs before the custom drop implementation. In Rust, the custom drop method runs first while fields are still alive, then fields are dropped afterwards. Updated comments to reflect the correct destruction order.

…t-lang#1925)

The comments incorrectly stated that File's drop runs before the custom
drop implementation. In Rust, the custom drop method runs first, and
then fields are dropped afterwards. Updated comments to reflect the
actual destruction order.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 1, 2026

r? @marioidival

rustbot has assigned @marioidival.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @marioidival

@marioidival marioidival merged commit b690a0d into rust-lang:master Apr 1, 2026
1 check passed
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.

bug: Erroneous comment in Drop's TempFile inverts order of destruction

3 participants