coherence doesn't like region constraints
This commit is contained in:
parent
1d99ddbfe8
commit
e1edefc137
@ -1,5 +1,5 @@
|
||||
// revisions: stock with_negative_coherence
|
||||
//[with_negative_coherence] check-pass
|
||||
//[with_negative_coherence] known-bug: unknown
|
||||
|
||||
#![feature(negative_impls)]
|
||||
#![cfg_attr(with_negative_coherence, feature(with_negative_coherence))]
|
||||
|
@ -0,0 +1,11 @@
|
||||
error[E0119]: conflicting implementations of trait `MyTrait<'_>` for type `&_`
|
||||
--> $DIR/coherence-negative-outlives-lifetimes.rs:14: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`.
|
@ -1,4 +1,4 @@
|
||||
// check-pass
|
||||
// known-bug: unknown
|
||||
|
||||
#![feature(negative_impls)]
|
||||
#![feature(rustc_attrs)]
|
||||
|
11
tests/ui/coherence/coherence-overlap-with-regions.stderr
Normal file
11
tests/ui/coherence/coherence-overlap-with-regions.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error[E0119]: conflicting implementations of trait `Bar` for type `&_`
|
||||
--> $DIR/coherence-overlap-with-regions.rs:20:1
|
||||
|
|
||||
LL | impl<T: Foo> Bar for T {}
|
||||
| ---------------------- first implementation here
|
||||
LL | impl<T> Bar for &T where T: 'static {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0119`.
|
@ -1,5 +1,5 @@
|
||||
// revisions: any_lt static_lt
|
||||
//[static_lt] check-pass
|
||||
//[static_lt] known-bug: unknown
|
||||
|
||||
#![feature(negative_impls)]
|
||||
#![feature(with_negative_coherence)]
|
||||
|
@ -0,0 +1,12 @@
|
||||
error[E0119]: conflicting implementations of trait `Bar` for type `&'static _`
|
||||
--> $DIR/negative-coherence-considering-regions.rs:26:1
|
||||
|
|
||||
LL | impl<T> Bar for T where T: Foo {}
|
||||
| ------------------------------ first implementation here
|
||||
...
|
||||
LL | impl<T> Bar for &'static T {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&'static _`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0119`.
|
Loading…
Reference in New Issue
Block a user