Skip to content

tests/ui: A New Order [27/N] #143302

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

Merged
merged 2 commits into from
Jul 12, 2025
Merged

tests/ui: A New Order [27/N] #143302

merged 2 commits into from
Jul 12, 2025

Conversation

Kivooeo
Copy link
Contributor

@Kivooeo Kivooeo commented Jul 1, 2025

Note

Intermediate commits are intended to help review, but will be squashed prior to merge.

Some tests/ui/ housekeeping, to trim down number of tests directly under tests/ui/. Part of #133895.

r? @tgross35

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 1, 2025
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

I might have a couple other comments too but the GH UI is giving me some problems with the diff. Could you squash?

Comment on lines 5 to 13
// `expr?` expands to:
//
// match expr {
// Ok(val) => val,
// Err(err) => return Err(From::from(err)),
// }
//
// This test verifies that the expansion is hygienic, i.e., it's not affected by other `val` and
// `err` bindings that may be in scope.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK, it's not true anymore, it expands into this https://doc.rust-lang.org/std/ops/trait.Try.html#tymethod.branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

like this

        match maybe_err.branch() {
            ControlFlow::Continue(r) => r,
            ControlFlow::Break(e) => return Result::from_residual(e),
        }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also if it'll help to you invistigation what is going here, here is a discussion about it #84277 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the links, looks like this was added in 210dd61. Maybe update the description to say "Ensure that bindings named val and err do not affect ? expansion (mostly relevant with a previous implementation for ?)."

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 4, 2025
Copy link
Contributor Author

@Kivooeo Kivooeo left a comment

Choose a reason for hiding this comment

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

I squashed commits, but still have some questions

@@ -1,17 +1,17 @@
//@ build-fail
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just drop it like this with no any addition?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah - the default is check-fail, and I'm thinking that is fine here since we're testing frontend diagnostics. We prefer that because it's cheap+fast (no codegen required). build-fail is used for things that are expected to fail later, like linking problems.

Some more info at https://rustc-dev-guide.rust-lang.org/tests/ui.html#controlling-passfail-expectations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test is not passing if i remove build-fail, so... I guess we should keep it

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

One , nit and an update in the try-operator-expansion-hygiene comment, then lgtm

Comment on lines 1 to 2
//! Checks how type parameters interact with auto-traits like `Send` and `Sync` with implicit,
//! bounds
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//! Checks how type parameters interact with auto-traits like `Send` and `Sync` with implicit,
//! bounds
//! Checks how type parameters interact with auto-traits like `Send` and `Sync` with implicit
//! bounds

extra comma

Comment on lines 5 to 13
// `expr?` expands to:
//
// match expr {
// Ok(val) => val,
// Err(err) => return Err(From::from(err)),
// }
//
// This test verifies that the expansion is hygienic, i.e., it's not affected by other `val` and
// `err` bindings that may be in scope.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the links, looks like this was added in 210dd61. Maybe update the description to say "Ensure that bindings named val and err do not affect ? expansion (mostly relevant with a previous implementation for ?)."

@Kivooeo
Copy link
Contributor Author

Kivooeo commented Jul 10, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 10, 2025
Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Thanks!

@tgross35
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 10, 2025

📌 Commit 3ad95cc has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 10, 2025
tgross35 added a commit to tgross35/rust that referenced this pull request Jul 10, 2025
`tests/ui`: A New Order [27/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang#133895.

r? `@tgross35`
bors added a commit that referenced this pull request Jul 11, 2025
Rollup of 7 pull requests

Successful merges:

 - #142391 (rust: library: Add `setsid` method to `CommandExt` trait)
 - #143301 (`tests/ui`: A New Order [26/N])
 - #143302 (`tests/ui`: A New Order [27/N])
 - #143303 (`tests/ui`: A New Order [28/28] FINAL PART)
 - #143568 (std: sys: net: uefi: tcp4: Add timeout support)
 - #143708 (fix: Include frontmatter in -Zunpretty output )
 - #143718 (Make UB transmutes really UB in LLVM)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 11, 2025
Rollup of 7 pull requests

Successful merges:

 - #142391 (rust: library: Add `setsid` method to `CommandExt` trait)
 - #143301 (`tests/ui`: A New Order [26/N])
 - #143302 (`tests/ui`: A New Order [27/N])
 - #143303 (`tests/ui`: A New Order [28/28] FINAL PART)
 - #143568 (std: sys: net: uefi: tcp4: Add timeout support)
 - #143708 (fix: Include frontmatter in -Zunpretty output )
 - #143718 (Make UB transmutes really UB in LLVM)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 11, 2025
Rollup of 8 pull requests

Successful merges:

 - #142391 (rust: library: Add `setsid` method to `CommandExt` trait)
 - #143302 (`tests/ui`: A New Order [27/N])
 - #143303 (`tests/ui`: A New Order [28/28] FINAL PART)
 - #143568 (std: sys: net: uefi: tcp4: Add timeout support)
 - #143611 (Mention more APIs in `ParseIntError` docs)
 - #143661 (chore: Improve how the other suggestions message gets rendered)
 - #143708 (fix: Include frontmatter in -Zunpretty output )
 - #143718 (Make UB transmutes really UB in LLVM)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 11, 2025
Rollup of 8 pull requests

Successful merges:

 - #142391 (rust: library: Add `setsid` method to `CommandExt` trait)
 - #143302 (`tests/ui`: A New Order [27/N])
 - #143303 (`tests/ui`: A New Order [28/28] FINAL PART)
 - #143568 (std: sys: net: uefi: tcp4: Add timeout support)
 - #143611 (Mention more APIs in `ParseIntError` docs)
 - #143661 (chore: Improve how the other suggestions message gets rendered)
 - #143708 (fix: Include frontmatter in -Zunpretty output )
 - #143718 (Make UB transmutes really UB in LLVM)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 11, 2025
Rollup of 8 pull requests

Successful merges:

 - #142391 (rust: library: Add `setsid` method to `CommandExt` trait)
 - #143302 (`tests/ui`: A New Order [27/N])
 - #143303 (`tests/ui`: A New Order [28/28] FINAL PART)
 - #143568 (std: sys: net: uefi: tcp4: Add timeout support)
 - #143611 (Mention more APIs in `ParseIntError` docs)
 - #143661 (chore: Improve how the other suggestions message gets rendered)
 - #143708 (fix: Include frontmatter in -Zunpretty output )
 - #143718 (Make UB transmutes really UB in LLVM)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: i686-gnu-nopt-1
try-job: test-various
bors added a commit that referenced this pull request Jul 11, 2025
Rollup of 8 pull requests

Successful merges:

 - #142391 (rust: library: Add `setsid` method to `CommandExt` trait)
 - #143302 (`tests/ui`: A New Order [27/N])
 - #143303 (`tests/ui`: A New Order [28/28] FINAL PART)
 - #143568 (std: sys: net: uefi: tcp4: Add timeout support)
 - #143611 (Mention more APIs in `ParseIntError` docs)
 - #143661 (chore: Improve how the other suggestions message gets rendered)
 - #143708 (fix: Include frontmatter in -Zunpretty output )
 - #143718 (Make UB transmutes really UB in LLVM)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: i686-gnu-nopt-1
try-job: test-various
bors added a commit that referenced this pull request Jul 12, 2025
Rollup of 8 pull requests

Successful merges:

 - #142391 (rust: library: Add `setsid` method to `CommandExt` trait)
 - #143302 (`tests/ui`: A New Order [27/N])
 - #143303 (`tests/ui`: A New Order [28/28] FINAL PART)
 - #143568 (std: sys: net: uefi: tcp4: Add timeout support)
 - #143611 (Mention more APIs in `ParseIntError` docs)
 - #143661 (chore: Improve how the other suggestions message gets rendered)
 - #143708 (fix: Include frontmatter in -Zunpretty output )
 - #143718 (Make UB transmutes really UB in LLVM)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: i686-gnu-nopt-1
try-job: test-various
@bors bors merged commit 3d6eb22 into rust-lang:master Jul 12, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 12, 2025
rust-timer added a commit that referenced this pull request Jul 12, 2025
Rollup merge of #143302 - Kivooeo:tf27, r=tgross35

`tests/ui`: A New Order [27/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of #133895.

r? ``@tgross35``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants