-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #68544 - Aaron1011:remove-overlapping-traits, r=estebank
Remove the `overlapping_marker_traits` feature See #29864 This has been replaced by `#[feature(marker_trait_attr)]` A few notes: * Due to PR #68057 not yet being in the bootstrap compiler, it's necessary to continue using `#![feature(overlapping_marker_traits)]` under `#[cfg(bootstrap)]` to work around type inference issues. * I've updated tests that used `overlapping_marker_traits` to now use `marker_trait_attr` where applicable The test `src/test/ui/overlap-marker-trait.rs` doesn't make any sense now that `overlapping_marker_traits`, so I removed it. The test `src/test/ui/traits/overlap-permitted-for-marker-traits-neg.rs` now fails, since it's no longer possible to have multiple overlapping negative impls of `Send`. I believe that this is the behavior we want (assuming that `Send` is not going to become a `#[marker]` trait, so I renamed the test to `overlap-permitted-for-marker-traits-neg`
- Loading branch information
Showing
15 changed files
with
52 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
#![feature(optin_builtin_traits)] | ||
#![feature(overlapping_marker_traits)] | ||
#![feature(marker_trait_attr)] | ||
|
||
#[marker] | ||
trait MyTrait {} | ||
|
||
struct TestType<T>(::std::marker::PhantomData<T>); | ||
|
||
unsafe impl<T: MyTrait+'static> Send for TestType<T> {} | ||
|
||
impl<T: MyTrait> !Send for TestType<T> {} | ||
//~^ ERROR E0119 | ||
//~^ ERROR conflicting implementations | ||
|
||
unsafe impl<T:'static> Send for TestType<T> {} | ||
//~^ ERROR conflicting implementations | ||
|
||
impl !Send for TestType<i32> {} | ||
//~^ ERROR E0119 | ||
|
||
fn main() {} |
14 changes: 7 additions & 7 deletions
14
src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
...verlap-permitted-for-marker-traits-neg.rs → ...verlap-not-permitted-for-builtin-trait.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
// run-pass | ||
#![allow(dead_code)] | ||
#![feature(overlapping_marker_traits)] | ||
#![feature(optin_builtin_traits)] | ||
|
||
// Overlapping negative impls for `MyStruct` are permitted: | ||
// Overlapping negative impls for `MyStruct` are not permitted: | ||
struct MyStruct; | ||
impl !Send for MyStruct {} | ||
impl !Send for MyStruct {} | ||
//~^ ERROR conflicting implementations of trait | ||
|
||
fn main() { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0119]: conflicting implementations of trait `std::marker::Send` for type `MyStruct`: | ||
--> $DIR/overlap-not-permitted-for-builtin-trait.rs:7:1 | ||
| | ||
LL | impl !Send for MyStruct {} | ||
| ----------------------- first implementation here | ||
LL | impl !Send for MyStruct {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
This file was deleted.
Oops, something went wrong.