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

Advent of tests/ui (misc cleanups and improvements) [1/N] #133900

Merged
merged 5 commits into from
Dec 14, 2024

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Dec 5, 2024

Part of #133895.

Misc improvements to some ui tests immediately under tests/ui/.

Best reviewed commit-by-commit.

Thanks @clubby789 for PR title suggestion 😸.

r? compiler

@jieyouxu jieyouxu added the A-testsuite Area: The testsuite used to check the correctness of rustc label Dec 5, 2024
@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 Dec 5, 2024
Comment on lines 4 to 5
//! This test tries to exercise that by checking that the "empty trait list for derive" warning for
//! `#[derive()]` is permitted by `-A warnings`, which is a non-lint warning.
Copy link
Member Author

Choose a reason for hiding this comment

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

Remark: I elaborated on the "how" here because it was very not obvious how this test did the check.

Copy link
Member Author

@jieyouxu jieyouxu Dec 5, 2024

Choose a reason for hiding this comment

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

Discussion: this one I have no idea. I suspect this test in the current form is not checking what the original commit intended to check. git archaeology also failed me because in d7d3871 this test

started working correctly at some point.

and was unmarked as xfail (compile-fail at thew time).

Copy link
Member Author

Choose a reason for hiding this comment

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

Original form as in fb76c25 is:

tag sty {
    ty_nil;
}

type raw_t = rec(sty struct,
                 option::t[str] cname,
                 uint hash);

fn mk_raw_ty(sty st, &option::t[str] cname) -> raw_t {
  ret rec(struct=st,
	  cname=cname,
	  hash=0u);
}

fn main() {
  mk_raw_ty(ty_nil, none[str]);
}

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, tricky.

@jieyouxu jieyouxu added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Dec 5, 2024
@jieyouxu

This comment was marked as outdated.

@rustbot rustbot assigned wesleywiser and unassigned fmease Dec 7, 2024
@fmease fmease assigned fmease and unassigned wesleywiser Dec 7, 2024
@jieyouxu jieyouxu changed the title Daily ui test suite cleanups and improvements [1/N] Advent of tests/ui (misc cleanups and improvements) [1/N] Dec 8, 2024
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Thanks for your patience. r=me with concerns resolved and renaming-commits squashed into the respective previous commit.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yes, tricky.

Copy link
Member

@fmease fmease Dec 9, 2024

Choose a reason for hiding this comment

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

Lol, interesting corner case of the language. I never thought about operator precedence in code like &() as &Trait + Send: It gets parsed as &() as &(Trait) + Send instead of &() as &(Trait + Send) and therefore Send doesn't get interpreted as a trait object trait bound.

@fmease fmease 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 Dec 9, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Dec 10, 2024

Rebase force-push, no functional changes, intended to make review easier.

@jieyouxu
Copy link
Member Author

Squash force-push, no functional changes, squashed move commits into the test content changes for each test.

jieyouxu and others added 5 commits December 10, 2024 11:20
- Document and tidy up `alias-uninit-value.rs`
- Move `alias-uninit-value.rs` to `tests/ui/codegen/`
- Document `allow-non-lint-warnings.rs`
- Move `allow-non-lint-warnings.rs` under `tests/ui/diagnostic-flags/`
- Improve the test to use two *differential* revisions:
    1. One revision checks that without `-A warnings` the code sample
       actually emits a warning.
    2. The other revision checks that `-A warnings` suppresses the
       warning.
  This makes sure that if the code sample no longer warns, the test
  doesn't silently pass but fail to check its intended purpose.
- Document `anonymous-higher-ranked-lifetime.rs`
- Move `anonymous-higher-ranked-lifetime.rs` to `tests/ui/higher-ranked`
- Document `artificial-block.rs`
- Move `artificial-block.rs` under `tests/ui/reachable`
- Document `as-precedence.rs`
- Move `as-precedence.rs` under `tests/ui/parser/`
@jieyouxu
Copy link
Member Author

jieyouxu commented Dec 10, 2024

Changes since last review

Diff: https://github.com/rust-lang/rust/compare/32b9336c54b0f2b42ca37f1132979cee3c0030b5..56efa0a7bf55aa4d1413008df672b95f09a4d8e9

  1. tests/ui/codegen/alias-uninit-value.rs: fixed non camel case types to remove distraction.
  2. tests/ui/diagnostic-flags/allow-non-lint-warnings.rs:
    1. Changed the test to use a code sample that actually emits a non-lint warning.
    2. Make the test use differential revisions: one revision checks that without -A warnings the code sample does actually emit a warning, and another revision checks that the warning is suppressed if -A warnings cli flag is specified. This makes sure that the code sample under test doesn't silently pass yet fail to check that non-lint warnings can be suppressed by -A warnings if the code sample no longer emits any non-lint warnings to be suppressed.
  3. tests/ui/reachable/artificial-block.rs:
    1. Fix comment code snippet to use modern syntax.
    2. Fix the incorrect commit hash 8d38182 when I actually meant 3d738e9.
    3. Various typo/rewording.

Commits are squashed and rebased before force-push 56efa0a to help with the compare diff, they contain no changes beforehand.

@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 Dec 10, 2024
@jieyouxu jieyouxu requested a review from fmease December 10, 2024 03:48
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Beautiful, thanks a lot!

differential revisions

🙏 🙏 🙏

@fmease
Copy link
Member

fmease commented Dec 13, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 13, 2024

📌 Commit 56efa0a has been approved by fmease

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 Dec 13, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133900 (Advent of `tests/ui` (misc cleanups and improvements) [1/N])
 - rust-lang#133937 (Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them)
 - rust-lang#133938 (`rustc_mir_dataflow` cleanups, including some renamings)
 - rust-lang#134058 (interpret: reduce usage of TypingEnv::fully_monomorphized)
 - rust-lang#134130 (Stop using driver queries in the public API)
 - rust-lang#134140 (Add AST support for unsafe binders)
 - rust-lang#134229 (Fix typos in docs on provenance)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133900 (Advent of `tests/ui` (misc cleanups and improvements) [1/N])
 - rust-lang#133937 (Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them)
 - rust-lang#133938 (`rustc_mir_dataflow` cleanups, including some renamings)
 - rust-lang#134058 (interpret: reduce usage of TypingEnv::fully_monomorphized)
 - rust-lang#134130 (Stop using driver queries in the public API)
 - rust-lang#134140 (Add AST support for unsafe binders)
 - rust-lang#134229 (Fix typos in docs on provenance)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ab0d792 into rust-lang:master Dec 14, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 14, 2024
Rollup merge of rust-lang#133900 - jieyouxu:ui-cleanup-1, r=fmease

Advent of `tests/ui` (misc cleanups and improvements) [1/N]

Part of rust-lang#133895.

Misc improvements to some ui tests immediately under `tests/ui/`.

Best reviewed commit-by-commit.

Thanks `@clubby789` for PR title suggestion 😸.

r? compiler
@jieyouxu jieyouxu deleted the ui-cleanup-1 branch December 14, 2024 04:48
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 15, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133900 (Advent of `tests/ui` (misc cleanups and improvements) [1/N])
 - rust-lang#133937 (Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them)
 - rust-lang#133938 (`rustc_mir_dataflow` cleanups, including some renamings)
 - rust-lang#134058 (interpret: reduce usage of TypingEnv::fully_monomorphized)
 - rust-lang#134130 (Stop using driver queries in the public API)
 - rust-lang#134140 (Add AST support for unsafe binders)
 - rust-lang#134229 (Fix typos in docs on provenance)

r? `@ghost`
`@rustbot` modify labels: rollup
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. 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.

None yet

5 participants