Skip to content

Commit 2cc58d7

Browse files
committed
Use revisions instead of two separate tests
1 parent 78fa551 commit 2cc58d7

7 files changed

+73
-50
lines changed

tests/ui/lint/unused/unused-parens-trait-obj-e2015.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/ui/lint/unused/unused-parens-trait-obj-e2018-and-after.fixed

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/ui/lint/unused/unused-parens-trait-obj-e2018-and-after.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/ui/lint/unused/unused-parens-trait-obj-e2018-and-after.stderr

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ revisions: edition2015 edition2018
2+
//@[edition2015] check-pass
3+
//@[edition2015] edition: 2015
4+
//@[edition2018] run-rustfix
5+
//@[edition2018] edition: 2018
6+
7+
#![deny(unused_parens)]
8+
9+
#[allow(unused)]
10+
macro_rules! edition2015_only {
11+
() => {
12+
mod dyn {
13+
pub type IsAContextualKeywordIn2015 = ();
14+
}
15+
16+
pub type DynIsAContextualKeywordIn2015A = dyn::IsAContextualKeywordIn2015;
17+
}
18+
}
19+
20+
#[cfg(edition2015)]
21+
edition2015_only!();
22+
23+
// there's a lint for 2018 and later only because of how dyn is parsed in edition 2015
24+
//[edition2018]~v ERROR unnecessary parentheses around type
25+
pub type DynIsAContextualKeywordIn2015B = Box<dyn ::std::ops::Fn()>;
26+
27+
fn main() {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error: unnecessary parentheses around type
2+
--> $DIR/unused-parens-trait-obj.rs:25:51
3+
|
4+
LL | pub type DynIsAContextualKeywordIn2015B = Box<dyn (::std::ops::Fn())>;
5+
| ^ ^
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/unused-parens-trait-obj.rs:7:9
9+
|
10+
LL | #![deny(unused_parens)]
11+
| ^^^^^^^^^^^^^
12+
help: remove these parentheses
13+
|
14+
LL - pub type DynIsAContextualKeywordIn2015B = Box<dyn (::std::ops::Fn())>;
15+
LL + pub type DynIsAContextualKeywordIn2015B = Box<dyn ::std::ops::Fn()>;
16+
|
17+
18+
error: aborting due to 1 previous error
19+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ revisions: edition2015 edition2018
2+
//@[edition2015] check-pass
3+
//@[edition2015] edition: 2015
4+
//@[edition2018] run-rustfix
5+
//@[edition2018] edition: 2018
6+
7+
#![deny(unused_parens)]
8+
9+
#[allow(unused)]
10+
macro_rules! edition2015_only {
11+
() => {
12+
mod dyn {
13+
pub type IsAContextualKeywordIn2015 = ();
14+
}
15+
16+
pub type DynIsAContextualKeywordIn2015A = dyn::IsAContextualKeywordIn2015;
17+
}
18+
}
19+
20+
#[cfg(edition2015)]
21+
edition2015_only!();
22+
23+
// there's a lint for 2018 and later only because of how dyn is parsed in edition 2015
24+
//[edition2018]~v ERROR unnecessary parentheses around type
25+
pub type DynIsAContextualKeywordIn2015B = Box<dyn (::std::ops::Fn())>;
26+
27+
fn main() {}

0 commit comments

Comments
 (0)