Skip to content

Commit 23ba4ce

Browse files
committed
Bless the remaining ui tests
1 parent 5c0f55d commit 23ba4ce

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed

tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR found both positive and nega
1313
unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
1414

1515
impl !Send for TestType<i32> {}
16+
//~^ WARNING
17+
//~| WARNING this will change its meaning
1618

1719
fn main() {}

tests/ui/coherence/coherence-conflicting-negative-trait-impl.stderr

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,23 @@ LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
1616
LL | unsafe impl<T: 'static> Send for TestType<T> {}
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
1818

19-
error: aborting due to 2 previous errors
19+
warning: cross-crate traits with a default impl, like `Send`, should not be specialized
20+
--> $DIR/coherence-conflicting-negative-trait-impl.rs:15:1
21+
|
22+
LL | impl !Send for TestType<i32> {}
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
|
25+
= warning: this will change its meaning in a future release!
26+
= note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
27+
= note: `i32` is not a generic parameter
28+
note: try using the same sequence of generic parameters as the struct definition
29+
--> $DIR/coherence-conflicting-negative-trait-impl.rs:7:1
30+
|
31+
LL | struct TestType<T>(::std::marker::PhantomData<T>);
32+
| ^^^^^^^^^^^^^^^^^^
33+
= note: `#[warn(suspicious_auto_trait_impls)]` on by default
34+
35+
error: aborting due to 2 previous errors; 1 warning emitted
2036

2137
Some errors have detailed explanations: E0119, E0751.
2238
For more information about an error, try `rustc --explain E0119`.

tests/ui/coherence/coherence-orphan.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ impl TheTrait<TheType> for isize { }
1414

1515
impl TheTrait<isize> for TheType { }
1616

17-
impl !Send for Vec<isize> { }
18-
//~^ ERROR E0117
17+
impl !Send for Vec<isize> { } //~ ERROR E0117
18+
//~^ WARNING
19+
//~| WARNING this will change its meaning
1920

2021
fn main() { }

tests/ui/coherence/coherence-orphan.stderr

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ LL | impl !Send for Vec<isize> { }
2121
|
2222
= note: define and implement a trait or new type instead
2323

24-
error: aborting due to 2 previous errors
24+
warning: cross-crate traits with a default impl, like `Send`, should not be specialized
25+
--> $DIR/coherence-orphan.rs:17:1
26+
|
27+
LL | impl !Send for Vec<isize> { }
28+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
29+
|
30+
= warning: this will change its meaning in a future release!
31+
= note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
32+
= note: `isize` is not a generic parameter
33+
note: try using the same sequence of generic parameters as the struct definition
34+
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
35+
= note: `#[warn(suspicious_auto_trait_impls)]` on by default
36+
37+
error: aborting due to 2 previous errors; 1 warning emitted
2538

2639
For more information about this error, try `rustc --explain E0117`.

tests/ui/issues/issue-106755.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR found both positive and nega
1515
unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
1616

1717
impl !Send for TestType<i32> {}
18+
//~^ WARNING
19+
//~| WARNING this will change its meaning
1820

1921
fn main() {}

tests/ui/issues/issue-106755.stderr

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,23 @@ LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
1616
LL | unsafe impl<T: 'static> Send for TestType<T> {}
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
1818

19-
error: aborting due to 2 previous errors
19+
warning: cross-crate traits with a default impl, like `Send`, should not be specialized
20+
--> $DIR/issue-106755.rs:17:1
21+
|
22+
LL | impl !Send for TestType<i32> {}
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
|
25+
= warning: this will change its meaning in a future release!
26+
= note: for more information, see issue #93367 <https://github.com/rust-lang/rust/issues/93367>
27+
= note: `i32` is not a generic parameter
28+
note: try using the same sequence of generic parameters as the struct definition
29+
--> $DIR/issue-106755.rs:9:1
30+
|
31+
LL | struct TestType<T>(::std::marker::PhantomData<T>);
32+
| ^^^^^^^^^^^^^^^^^^
33+
= note: `#[warn(suspicious_auto_trait_impls)]` on by default
34+
35+
error: aborting due to 2 previous errors; 1 warning emitted
2036

2137
Some errors have detailed explanations: E0119, E0751.
2238
For more information about an error, try `rustc --explain E0119`.

0 commit comments

Comments
 (0)