tests/ui: use revisions for editions in several tests#155498
tests/ui: use revisions for editions in several tests#155498GrigorenkoPV wants to merge 5 commits intorust-lang:mainfrom
Conversation
…visions for editions
…use revisions for editions
|
r? @davidtwco rustbot has assigned @davidtwco. Use Why was this reviewer chosen?The reviewer was selected based on:
|
can you elaborate a little why this tests were chosen and why this editions needs to be tested in those tests |
|
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. |
| //[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 |
There was a problem hiding this comment.
Given the greatly decreased readability of these error annotations, I'm inclined to think that merging these particular tests is not worthwhile.
| //@ revisions: rust2015 rust2021 | ||
| //@[rust2015] edition:2015 | ||
| //@[rust2021] edition:2021 |
| //@ revisions: rust2015 rust2018 | ||
| //@[rust2015] edition:2015 | ||
| //@[rust2018] edition:2018 |
There was a problem hiding this comment.
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.
Also renames one
issue-\d+test, yay