-
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 #93652 - spastorino:fix-negative-overlap-check-regions,…
… r=nikomatsakis Fix negative overlap check regions r? `@nikomatsakis`
- Loading branch information
Showing
17 changed files
with
134 additions
and
33 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#![crate_type = "lib"] | ||
#![feature(negative_impls)] | ||
#![feature(with_negative_coherence)] | ||
|
||
pub trait Error {} | ||
impl !Error for &str {} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/coherence/coherence-negative-outlives-lifetimes.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(negative_impls)] | ||
|
||
// FIXME: this should compile | ||
|
||
trait MyPredicate<'a> {} | ||
impl<'a, T> !MyPredicate<'a> for &T where T: 'a {} | ||
trait MyTrait<'a> {} | ||
impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} | ||
impl<'a, T> MyTrait<'a> for &'a T {} | ||
//~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_` | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/coherence/coherence-negative-outlives-lifetimes.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 `MyTrait<'_>` for type `&_` | ||
--> $DIR/coherence-negative-outlives-lifetimes.rs:9:1 | ||
| | ||
LL | impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} | ||
| ---------------------------------------------- first implementation here | ||
LL | impl<'a, T> MyTrait<'a> for &'a T {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
2 changes: 1 addition & 1 deletion
2
src/test/ui/coherence/coherence-overlap-negate-use-feature-gate.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,6 +1,6 @@ | ||
// check-pass | ||
|
||
#![feature(negative_impls)] | ||
#![feature(with_negative_coherence)] | ||
|
||
use std::ops::DerefMut; | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// check-pass | ||
|
||
#![feature(negative_impls)] | ||
#![feature(rustc_attrs)] | ||
#![feature(with_negative_coherence)] | ||
|
||
#[rustc_strict_coherence] | ||
trait Foo {} | ||
impl<T> !Foo for &T where T: 'static {} | ||
|
||
#[rustc_strict_coherence] | ||
trait Bar {} | ||
impl<T: Foo> Bar for T {} | ||
impl<T> Bar for &T where T: 'static {} | ||
|
||
fn main() {} |
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,4 +1,5 @@ | ||
#![feature(negative_impls)] | ||
#![feature(with_negative_coherence)] | ||
|
||
pub trait ForeignTrait {} | ||
|
||
|
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