Skip to content

Commit 8c0dc0a

Browse files
authored
Rollup merge of rust-lang#86537 - inquisitivecrystal:mark-edition-tests-check-pass, r=JohnTitor
Mark some edition tests as check-pass ## Overview This helps with rust-lang#62277. In short, there are some tests that were marked as `build-pass` when it was unclear whether `check-pass` might be more appropriate. This PR marks some of those tests as `compile-pass`, in addition to making some incidental formatting improvements. ## A brief explanation of why this is correct These tests fall into a few buckets. `src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs` `src/test/ui/dyn-keyword/dyn-2015-idents-in-decl-macros-unlinted.rs` `src/test/ui/dyn-keyword/dyn-2015-idents-in-macros-unlinted.rs` `src/test/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs` `src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs` These test a lint for a keyword added in a new edition and the corresponding changes in keyword rules. `src/test/ui/editions/edition-feature-ok.rs` This checks that a feature related to an edition transition is valid. `src/test/ui/editions/edition-imports-virtual-2015-ambiguity.rs` This checks that imports between editions work correctly. `src/test/ui/editions/edition-keywords-2015-2015-expansion.rs` `src/test/ui/editions/edition-keywords-2018-2015-expansion.rs` This checks the interaction between a change in keyword status over editions and macros. All of the things being tested come before linking and codegen, so it is safe to use `check-pass` for them.
2 parents e319670 + 8ad63ba commit 8c0dc0a

11 files changed

+34
-28
lines changed

src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// to detect or fix uses of `dyn` under a macro. Since we are testing
44
// this file via `rustfix`, we want the rustfix output to be
55
// compilable; so the macros here carefully use `dyn` "correctly."
6-
6+
//
7+
// edition:2015
78
// run-rustfix
89

910
#![allow(non_camel_case_types)]

src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// to detect or fix uses of `dyn` under a macro. Since we are testing
44
// this file via `rustfix`, we want the rustfix output to be
55
// compilable; so the macros here carefully use `dyn` "correctly."
6-
6+
//
7+
// edition:2015
78
// run-rustfix
89

910
#![allow(non_camel_case_types)]

src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error: `dyn` is a keyword in the 2018 edition
2-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:13:13
2+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:14:13
33
|
44
LL | pub mod dyn {
55
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
66
|
77
note: the lint level is defined here
8-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:10:9
8+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:11:9
99
|
1010
LL | #![deny(keyword_idents)]
1111
| ^^^^^^^^^^^^^^
1212
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
1313
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
1414

1515
error: `dyn` is a keyword in the 2018 edition
16-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:16:20
16+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:17:20
1717
|
1818
LL | pub struct dyn;
1919
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -22,7 +22,7 @@ LL | pub struct dyn;
2222
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
2323

2424
error: `dyn` is a keyword in the 2018 edition
25-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:21:16
25+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:22:16
2626
|
2727
LL | use outer_mod::dyn::dyn;
2828
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -31,7 +31,7 @@ LL | use outer_mod::dyn::dyn;
3131
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
3232

3333
error: `dyn` is a keyword in the 2018 edition
34-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:21:21
34+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:22:21
3535
|
3636
LL | use outer_mod::dyn::dyn;
3737
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -40,7 +40,7 @@ LL | use outer_mod::dyn::dyn;
4040
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
4141

4242
error: `dyn` is a keyword in the 2018 edition
43-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:28:11
43+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:29:11
4444
|
4545
LL | match dyn { dyn => {} }
4646
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -49,7 +49,7 @@ LL | match dyn { dyn => {} }
4949
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5050

5151
error: `dyn` is a keyword in the 2018 edition
52-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:28:17
52+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:29:17
5353
|
5454
LL | match dyn { dyn => {} }
5555
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -58,7 +58,7 @@ LL | match dyn { dyn => {} }
5858
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
5959

6060
error: `dyn` is a keyword in the 2018 edition
61-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:33:17
61+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:34:17
6262
|
6363
LL | macro_defn::dyn();
6464
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -67,7 +67,7 @@ LL | macro_defn::dyn();
6767
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
6868

6969
error: `dyn` is a keyword in the 2018 edition
70-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:43:18
70+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:44:18
7171
|
7272
LL | macro_rules! dyn {
7373
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -76,7 +76,7 @@ LL | macro_rules! dyn {
7676
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
7777

7878
error: `dyn` is a keyword in the 2018 edition
79-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:51:12
79+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:52:12
8080
|
8181
LL | pub fn dyn() -> ::outer_mod::dyn::dyn {
8282
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -85,7 +85,7 @@ LL | pub fn dyn() -> ::outer_mod::dyn::dyn {
8585
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
8686

8787
error: `dyn` is a keyword in the 2018 edition
88-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:51:34
88+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:52:34
8989
|
9090
LL | pub fn dyn() -> ::outer_mod::dyn::dyn {
9191
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -94,7 +94,7 @@ LL | pub fn dyn() -> ::outer_mod::dyn::dyn {
9494
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
9595

9696
error: `dyn` is a keyword in the 2018 edition
97-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:51:39
97+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:52:39
9898
|
9999
LL | pub fn dyn() -> ::outer_mod::dyn::dyn {
100100
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -103,7 +103,7 @@ LL | pub fn dyn() -> ::outer_mod::dyn::dyn {
103103
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
104104

105105
error: `dyn` is a keyword in the 2018 edition
106-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:58:22
106+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:59:22
107107
|
108108
LL | ::outer_mod::dyn::dyn
109109
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -112,7 +112,7 @@ LL | ::outer_mod::dyn::dyn
112112
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
113113

114114
error: `dyn` is a keyword in the 2018 edition
115-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:58:27
115+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:59:27
116116
|
117117
LL | ::outer_mod::dyn::dyn
118118
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
@@ -121,7 +121,7 @@ LL | ::outer_mod::dyn::dyn
121121
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
122122

123123
error: `dyn` is a keyword in the 2018 edition
124-
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:67:23
124+
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:68:23
125125
|
126126
LL | pub fn boxed() -> dyn!(
127127
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`

src/test/ui/dyn-keyword/dyn-2015-idents-in-decl-macros-unlinted.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
2-
31
// Under the 2015 edition with the keyword_idents lint, `dyn` is
42
// not entirely acceptable as an identifier.
53
//
64
// We currently do not attempt to detect or fix uses of `dyn` as an
75
// identifier under a macro, including under the declarative `macro`
86
// forms from macros 1.2 and macros 2.0.
7+
//
8+
// check-pass
9+
// edition:2015
910

1011
#![feature(decl_macro)]
1112
#![allow(non_camel_case_types)]

src/test/ui/dyn-keyword/dyn-2015-idents-in-macros-unlinted.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
2-
31
// Under the 2015 edition with the keyword_idents lint, `dyn` is
42
// not entirely acceptable as an identifier.
53
//
64
// We currently do not attempt to detect or fix uses of `dyn` as an
75
// identifier under a macro.
6+
//
7+
// check-pass
8+
// edition:2015
89

910
#![allow(non_camel_case_types)]
1011
#![deny(keyword_idents)]

src/test/ui/dyn-keyword/dyn-2015-no-warnings-without-lints.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Under the 2015 edition without the keyword_idents lint, `dyn` is
22
// entirely acceptable as an identifier.
3-
4-
// build-pass (FIXME(62277): could be check-pass?)
3+
//
4+
// check-pass
5+
// edition:2015
56

67
#![allow(non_camel_case_types)]
78

src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// check-pass
2-
2+
// edition:2015
3+
//
34
// rust-lang/rust#56327: Some occurrences of `dyn` within a macro are
45
// not instances of identifiers, and thus should *not* be caught by the
56
// keyword_ident lint.

src/test/ui/editions/edition-feature-ok.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
1+
// check-pass
22

33
#![feature(rust_2018_preview)]
44

src/test/ui/editions/edition-imports-virtual-2015-ambiguity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// build-pass (FIXME(62277): could be check-pass?)
1+
// check-pass
22
// edition:2018
33
// compile-flags:--extern edition_imports_2015
44
// aux-build:edition-imports-2015.rs

src/test/ui/editions/edition-keywords-2015-2015-expansion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// edition:2015
22
// aux-build:edition-kw-macro-2015.rs
3-
// build-pass (FIXME(62277): could be check-pass?)
3+
// check-pass
44

55
#![allow(keyword_idents)]
66

src/test/ui/editions/edition-keywords-2018-2015-expansion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// edition:2018
22
// aux-build:edition-kw-macro-2015.rs
3-
// build-pass (FIXME(62277): could be check-pass?)
3+
// check-pass
44

55
#![allow(keyword_idents)]
66

0 commit comments

Comments
 (0)