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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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

wants to merge 2 commits into from

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)

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants