Skip to content

Commit e1edefc

Browse files
coherence doesn't like region constraints
1 parent 1d99ddb commit e1edefc

6 files changed

+37
-3
lines changed

tests/ui/coherence/coherence-negative-outlives-lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions: stock with_negative_coherence
2-
//[with_negative_coherence] check-pass
2+
//[with_negative_coherence] known-bug: unknown
33

44
#![feature(negative_impls)]
55
#![cfg_attr(with_negative_coherence, feature(with_negative_coherence))]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0119]: conflicting implementations of trait `MyTrait<'_>` for type `&_`
2+
--> $DIR/coherence-negative-outlives-lifetimes.rs:14:1
3+
|
4+
LL | impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
5+
| ---------------------------------------------- first implementation here
6+
LL | impl<'a, T> MyTrait<'a> for &'a T {}
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0119`.

tests/ui/coherence/coherence-overlap-with-regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// check-pass
1+
// known-bug: unknown
22

33
#![feature(negative_impls)]
44
#![feature(rustc_attrs)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0119]: conflicting implementations of trait `Bar` for type `&_`
2+
--> $DIR/coherence-overlap-with-regions.rs:20:1
3+
|
4+
LL | impl<T: Foo> Bar for T {}
5+
| ---------------------- first implementation here
6+
LL | impl<T> Bar for &T where T: 'static {}
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_`
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0119`.

tests/ui/coherence/negative-coherence-considering-regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// revisions: any_lt static_lt
2-
//[static_lt] check-pass
2+
//[static_lt] known-bug: unknown
33

44
#![feature(negative_impls)]
55
#![feature(with_negative_coherence)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0119]: conflicting implementations of trait `Bar` for type `&'static _`
2+
--> $DIR/negative-coherence-considering-regions.rs:26:1
3+
|
4+
LL | impl<T> Bar for T where T: Foo {}
5+
| ------------------------------ first implementation here
6+
...
7+
LL | impl<T> Bar for &'static T {}
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&'static _`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0119`.

0 commit comments

Comments
 (0)