Skip to content

Some drop order tests are needlessly confusing #141604

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

Open
jieyouxu opened this issue May 26, 2025 · 1 comment · May be fixed by #142113
Open

Some drop order tests are needlessly confusing #141604

jieyouxu opened this issue May 26, 2025 · 1 comment · May be fixed by #142113
Assignees
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jieyouxu
Copy link
Member

jieyouxu commented May 26, 2025

Suggestion (not for this PR): #2735 refers to

"let _ = foo();" is differently effectful from just "foo();"

This test (tests/ui/drop/issue-2735-2.rs) exercising let _ = <expr>; vs <expr>; drop order does not need to allow non_camel_case_types, just change defer struct to use the canonical name, this is needlessly confusing:

  • In the struct decl, defer-the-struct is in type namespace, defer-the-struct-constructor is in value namespace
  • In this function decl, defer (fn) is in the value namespace, defer<'_> is in the type namespace
  • In the usage in main, defer is the value namespace struct constructor

Same for

  • tests/ui/drop/issue-2735-3.rs
  • tests/ui/drop/issue-979.rs

Originally posted by @jieyouxu in #138677 (comment)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 26, 2025
@jieyouxu jieyouxu added C-cleanup Category: PRs that clean code up or issues documenting cleanup. A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 26, 2025
@shepmaster
Copy link
Member

@rustbot claim.

shepmaster added a commit to shepmaster/rust that referenced this issue Jun 6, 2025
In addition to adhering to normal Rust casing idioms, I ran `rustfmt`.

Closes rust-lang#141604
@shepmaster shepmaster linked a pull request Jun 6, 2025 that will close this issue
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 C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants