Skip to content

Commit e7adb02

Browse files
committed
Fix new broken tests
1 parent 56a7719 commit e7adb02

15 files changed

+67
-63
lines changed

src/test/ui/macros/macro-or-patterns-back-compat.fixed

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55

66
macro_rules! foo { ($x:pat_param | $y:pat) => {} }
77
//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
8-
//~| WARN this was previously accepted
8+
//~| WARN this is accepted in the current edition
99
macro_rules! bar { ($($x:pat_param)+ | $($y:pat)+) => {} }
1010
//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
11-
//~| WARN this was previously accepted
11+
//~| WARN this is accepted in the current edition
1212
macro_rules! baz { ($x:pat_param | $y:pat_param) => {} } // should be ok
1313
macro_rules! qux { ($x:pat_param | $y:pat) => {} } // should be ok
1414
macro_rules! ogg { ($x:pat_param | $y:pat_param) => {} }
1515
//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
16-
//~| WARN this was previously accepted
16+
//~| WARN this is accepted in the current edition
1717
macro_rules! match_any {
1818
( $expr:expr , $( $( $pat:pat_param )|+ => $expr_arm:expr ),+ ) => {
1919
//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
20-
//~| WARN this was previously accepted
20+
//~| WARN this is accepted in the current edition
2121
match $expr {
2222
$(
2323
$( $pat => $expr_arm, )+

src/test/ui/macros/macro-or-patterns-back-compat.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55

66
macro_rules! foo { ($x:pat | $y:pat) => {} }
77
//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
8-
//~| WARN this was previously accepted
8+
//~| WARN this is accepted in the current edition
99
macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} }
1010
//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
11-
//~| WARN this was previously accepted
11+
//~| WARN this is accepted in the current edition
1212
macro_rules! baz { ($x:pat_param | $y:pat_param) => {} } // should be ok
1313
macro_rules! qux { ($x:pat_param | $y:pat) => {} } // should be ok
1414
macro_rules! ogg { ($x:pat | $y:pat_param) => {} }
1515
//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
16-
//~| WARN this was previously accepted
16+
//~| WARN this is accepted in the current edition
1717
macro_rules! match_any {
1818
( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => {
1919
//~^ ERROR the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
20-
//~| WARN this was previously accepted
20+
//~| WARN this is accepted in the current edition
2121
match $expr {
2222
$(
2323
$( $pat => $expr_arm, )+

src/test/ui/macros/macro-or-patterns-back-compat.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: the lint level is defined here
99
|
1010
LL | #![deny(or_patterns_back_compat)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^
12-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
12+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
1313
= note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
1414

1515
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
@@ -18,7 +18,7 @@ error: the meaning of the `pat` fragment specifier is changing in Rust 2021, whi
1818
LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} }
1919
| ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
2020
|
21-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
21+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
2222
= note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
2323

2424
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
@@ -27,7 +27,7 @@ error: the meaning of the `pat` fragment specifier is changing in Rust 2021, whi
2727
LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} }
2828
| ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
2929
|
30-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
30+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
3131
= note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
3232

3333
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
@@ -36,7 +36,7 @@ error: the meaning of the `pat` fragment specifier is changing in Rust 2021, whi
3636
LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => {
3737
| ^^^^^^^^ help: use pat_param to preserve semantics: `$pat:pat_param`
3838
|
39-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
39+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
4040
= note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
4141

4242
error: aborting due to 4 previous errors

src/test/ui/rust-2021/future-prelude-collision-imported.fixed

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod a {
2626
// In this case, we can just use `TryIntoU32`
2727
let _: u32 = TryIntoU32::try_into(3u8).unwrap();
2828
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
29-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
29+
//~^^ WARNING this is accepted in the current edition
3030
}
3131
}
3232

@@ -39,7 +39,7 @@ mod b {
3939
// the path `crate::m::TryIntoU32` (with which it was imported).
4040
let _: u32 = crate::m::TryIntoU32::try_into(3u8).unwrap();
4141
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
42-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
42+
//~^^ WARNING this is accepted in the current edition
4343
}
4444
}
4545

@@ -52,7 +52,7 @@ mod c {
5252
// the path `super::m::TryIntoU32` (with which it was imported).
5353
let _: u32 = super::m::TryIntoU32::try_into(3u8).unwrap();
5454
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
55-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
55+
//~^^ WARNING this is accepted in the current edition
5656
}
5757
}
5858

src/test/ui/rust-2021/future-prelude-collision-imported.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod a {
2626
// In this case, we can just use `TryIntoU32`
2727
let _: u32 = 3u8.try_into().unwrap();
2828
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
29-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
29+
//~^^ WARNING this is accepted in the current edition
3030
}
3131
}
3232

@@ -39,7 +39,7 @@ mod b {
3939
// the path `crate::m::TryIntoU32` (with which it was imported).
4040
let _: u32 = 3u8.try_into().unwrap();
4141
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
42-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
42+
//~^^ WARNING this is accepted in the current edition
4343
}
4444
}
4545

@@ -52,7 +52,7 @@ mod c {
5252
// the path `super::m::TryIntoU32` (with which it was imported).
5353
let _: u32 = 3u8.try_into().unwrap();
5454
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
55-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
55+
//~^^ WARNING this is accepted in the current edition
5656
}
5757
}
5858

src/test/ui/rust-2021/future-prelude-collision-imported.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: the lint level is defined here
99
|
1010
LL | #![warn(future_prelude_collision)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^
12-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
12+
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
1313
= note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
1414

1515
warning: trait method `try_into` will become ambiguous in Rust 2021
@@ -18,7 +18,7 @@ warning: trait method `try_into` will become ambiguous in Rust 2021
1818
LL | let _: u32 = 3u8.try_into().unwrap();
1919
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `crate::m::TryIntoU32::try_into(3u8)`
2020
|
21-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
21+
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
2222
= note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
2323

2424
warning: trait method `try_into` will become ambiguous in Rust 2021
@@ -27,7 +27,7 @@ warning: trait method `try_into` will become ambiguous in Rust 2021
2727
LL | let _: u32 = 3u8.try_into().unwrap();
2828
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `super::m::TryIntoU32::try_into(3u8)`
2929
|
30-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
30+
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
3131
= note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
3232

3333
warning: 3 warnings emitted

src/test/ui/rust-2021/future-prelude-collision.fixed

+12-10
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ impl TryIntoU32 for *const u16 {
3838

3939
trait FromByteIterator {
4040
fn from_iter<T>(iter: T) -> Self
41-
where T: Iterator<Item = u8>;
41+
where
42+
T: Iterator<Item = u8>;
4243
}
4344

4445
impl FromByteIterator for Vec<u8> {
4546
fn from_iter<T>(iter: T) -> Self
46-
where T: Iterator<Item = u8>
47+
where
48+
T: Iterator<Item = u8>,
4749
{
4850
iter.collect()
4951
}
@@ -53,44 +55,44 @@ fn main() {
5355
// test dot-call that will break in 2021 edition
5456
let _: u32 = TryIntoU32::try_into(3u8).unwrap();
5557
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
56-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
58+
//~^^ WARNING this is accepted in the current edition
5759

5860
// test associated function call that will break in 2021 edition
5961
let _ = <u32 as TryFromU8>::try_from(3u8).unwrap();
6062
//~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
61-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
63+
//~^^ WARNING this is accepted in the current edition
6264

6365
// test reverse turbofish too
6466
let _ = <Vec<u8> as FromByteIterator>::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter());
6567
//~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
66-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
68+
//~^^ WARNING this is accepted in the current edition
6769

6870
// negative testing lint (this line should *not* emit a warning)
6971
let _: u32 = TryFromU8::try_from(3u8).unwrap();
7072

7173
// test type omission
7274
let _: u32 = <_ as TryFromU8>::try_from(3u8).unwrap();
7375
//~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
74-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
76+
//~^^ WARNING this is accepted in the current edition
7577

7678
// test autoderef
7779
let _: u32 = TryIntoU32::try_into(*(&3u8)).unwrap();
7880
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
79-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
81+
//~^^ WARNING this is accepted in the current edition
8082

8183
// test autoref
8284
let _: u32 = TryIntoU32::try_into(&3.0).unwrap();
8385
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
84-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
86+
//~^^ WARNING this is accepted in the current edition
8587

8688
let mut data = 3u16;
8789
let mut_ptr = std::ptr::addr_of_mut!(data);
8890
let _: u32 = TryIntoU32::try_into(mut_ptr as *const _).unwrap();
8991
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
90-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
92+
//~^^ WARNING this is accepted in the current edition
9193

9294
type U32Alias = u32;
9395
let _ = <U32Alias as TryFromU8>::try_from(3u8).unwrap();
9496
//~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
95-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
97+
//~^^ WARNING this is accepted in the current edition
9698
}

src/test/ui/rust-2021/future-prelude-collision.rs

+12-10
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ impl TryIntoU32 for *const u16 {
3838

3939
trait FromByteIterator {
4040
fn from_iter<T>(iter: T) -> Self
41-
where T: Iterator<Item = u8>;
41+
where
42+
T: Iterator<Item = u8>;
4243
}
4344

4445
impl FromByteIterator for Vec<u8> {
4546
fn from_iter<T>(iter: T) -> Self
46-
where T: Iterator<Item = u8>
47+
where
48+
T: Iterator<Item = u8>,
4749
{
4850
iter.collect()
4951
}
@@ -53,44 +55,44 @@ fn main() {
5355
// test dot-call that will break in 2021 edition
5456
let _: u32 = 3u8.try_into().unwrap();
5557
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
56-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
58+
//~^^ WARNING this is accepted in the current edition
5759

5860
// test associated function call that will break in 2021 edition
5961
let _ = u32::try_from(3u8).unwrap();
6062
//~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
61-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
63+
//~^^ WARNING this is accepted in the current edition
6264

6365
// test reverse turbofish too
6466
let _ = <Vec<u8>>::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter());
6567
//~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
66-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
68+
//~^^ WARNING this is accepted in the current edition
6769

6870
// negative testing lint (this line should *not* emit a warning)
6971
let _: u32 = TryFromU8::try_from(3u8).unwrap();
7072

7173
// test type omission
7274
let _: u32 = <_>::try_from(3u8).unwrap();
7375
//~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
74-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
76+
//~^^ WARNING this is accepted in the current edition
7577

7678
// test autoderef
7779
let _: u32 = (&3u8).try_into().unwrap();
7880
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
79-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
81+
//~^^ WARNING this is accepted in the current edition
8082

8183
// test autoref
8284
let _: u32 = 3.0.try_into().unwrap();
8385
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
84-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
86+
//~^^ WARNING this is accepted in the current edition
8587

8688
let mut data = 3u16;
8789
let mut_ptr = std::ptr::addr_of_mut!(data);
8890
let _: u32 = mut_ptr.try_into().unwrap();
8991
//~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
90-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
92+
//~^^ WARNING this is accepted in the current edition
9193

9294
type U32Alias = u32;
9395
let _ = U32Alias::try_from(3u8).unwrap();
9496
//~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
95-
//~^^ WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
97+
//~^^ WARNING this is accepted in the current edition
9698
}

0 commit comments

Comments
 (0)