Skip to content

tests/ui: use revisions for editions in several tests#155498

Open
GrigorenkoPV wants to merge 5 commits intorust-lang:mainfrom
GrigorenkoPV:revisions
Open

tests/ui: use revisions for editions in several tests#155498
GrigorenkoPV wants to merge 5 commits intorust-lang:mainfrom
GrigorenkoPV:revisions

Conversation

@GrigorenkoPV
Copy link
Copy Markdown
Contributor

Also renames one issue-\d+ test, yay

@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 Apr 18, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 18, 2026

r? @davidtwco

rustbot has assigned @davidtwco.
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: compiler
  • compiler expanded to 72 candidates
  • Random selection from 18 candidates

@rustbot rustbot added A-tidy Area: The tidy tool T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 18, 2026
@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented Apr 18, 2026

use revisions for editions in several tests

can you elaborate a little why this tests were chosen and why this editions needs to be tested in those tests

@Zalathar
Copy link
Copy Markdown
Member

It looks like these are families of tests that were previously using multiple otherwise-identical files to test multiple editions, and this PR combines each of those families into a single file with multiple revisions instead.

That's reasonable, but it would have made things smoother to mention that in the PR description.

Comment on lines +9 to +19
//[rust2021]~^ ERROR expected a type, found a trait
//[rust2021]~| HELP `Clone` is dyn-incompatible, use `impl Clone` to return an opaque type, as long as you return a single underlying type
//[rust2015]~^^^ WARNING trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
//[rust2015]~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
//[rust2015]~| HELP if this is a dyn-compatible trait, use `dyn`
//[rust2015]~| WARNING trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
//[rust2015]~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
//[rust2015]~| HELP if this is a dyn-compatible trait, use `dyn`
//[rust2015]~| ERROR the trait `Clone` is not dyn compatible [E0038]
//~| HELP there is an associated type with the same name
//[rust2015]~| HELP use `Self` to refer to the implementing type
Copy link
Copy Markdown
Member

@Zalathar Zalathar Apr 22, 2026

Choose a reason for hiding this comment

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

Given the greatly decreased readability of these error annotations, I'm inclined to think that merging these particular tests is not worthwhile.

View changes since the review

Comment on lines +1 to +3
//@ revisions: rust2015 rust2021
//@[rust2015] edition:2015
//@[rust2021] edition:2021
Copy link
Copy Markdown
Member

@Zalathar Zalathar Apr 22, 2026

Choose a reason for hiding this comment

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

Renaming this test to bare_trait_objects.rs has ended up losing all the context of #116434 and #120530.

It turns out that this test is specifically trying to test how traits that aren't dyn-compatible influence the diagnostic messages.

View changes since the review

Comment on lines +9 to +11
//@ revisions: rust2015 rust2018
//@[rust2015] edition:2015
//@[rust2018] edition:2018
Copy link
Copy Markdown
Member

@Zalathar Zalathar Apr 22, 2026

Choose a reason for hiding this comment

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

Nit: For all of these tests, please add a space after the colon in the edition directive, i.e. edition: 2015 and edition: 2018.

Tests aren't fully consistent in how they write directives, but a space after the colon is the most common style.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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