Update tests changed by rebase
This commit is contained in:
parent
ae5c092682
commit
d758e4db78
6 changed files with 39 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
||||||
--> $DIR/coherence-fundamental-trait-objects.rs:12:1
|
--> $DIR/coherence-fundamental-trait-objects.rs:15:1
|
||||||
|
|
|
|
||||||
LL | impl Misc for dyn Fundamental<Local> {}
|
LL | impl Misc for dyn Fundamental<Local> {}
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
|
@ -0,0 +1,12 @@
|
||||||
|
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
|
||||||
|
--> $DIR/coherence-fundamental-trait-objects.rs:15:1
|
||||||
|
|
|
||||||
|
LL | impl Misc for dyn Fundamental<Local> {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
|
||||||
|
|
|
||||||
|
= note: the impl does not reference any types defined in this crate
|
||||||
|
= note: define and implement a trait or new type instead
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0117`.
|
|
@ -3,6 +3,9 @@
|
||||||
// are distinct.
|
// are distinct.
|
||||||
|
|
||||||
// aux-build:coherence_fundamental_trait_lib.rs
|
// aux-build:coherence_fundamental_trait_lib.rs
|
||||||
|
// revisions: old re
|
||||||
|
|
||||||
|
#![cfg_attr(re, feature(re_rebalance_coherence))]
|
||||||
|
|
||||||
extern crate coherence_fundamental_trait_lib;
|
extern crate coherence_fundamental_trait_lib;
|
||||||
|
|
||||||
|
@ -10,6 +13,7 @@ use coherence_fundamental_trait_lib::{Fundamental, Misc};
|
||||||
|
|
||||||
pub struct Local;
|
pub struct Local;
|
||||||
impl Misc for dyn Fundamental<Local> {}
|
impl Misc for dyn Fundamental<Local> {}
|
||||||
//~^ ERROR E0117
|
//[old]~^ ERROR E0117
|
||||||
|
//[re]~^^ ERROR E0117
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0119]: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
|
error[E0119]: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
|
||||||
--> $DIR/coherence-subtyping.rs:11:1
|
--> $DIR/coherence-subtyping.rs:15:1
|
||||||
|
|
|
|
||||||
LL | impl TheTrait for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 {
|
LL | impl TheTrait for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 {
|
||||||
| --------------------------------------------------------- first implementation here
|
| --------------------------------------------------------- first implementation here
|
14
src/test/ui/coherence/coherence-subtyping.re.stderr
Normal file
14
src/test/ui/coherence/coherence-subtyping.re.stderr
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
error[E0119]: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
|
||||||
|
--> $DIR/coherence-subtyping.rs:15:1
|
||||||
|
|
|
||||||
|
LL | impl TheTrait for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 {
|
||||||
|
| --------------------------------------------------------- first implementation here
|
||||||
|
...
|
||||||
|
LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
|
||||||
|
|
|
||||||
|
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0119`.
|
|
@ -1,6 +1,10 @@
|
||||||
// Test that two distinct impls which match subtypes of one another
|
// Test that two distinct impls which match subtypes of one another
|
||||||
// yield coherence errors (or not) depending on the variance.
|
// yield coherence errors (or not) depending on the variance.
|
||||||
|
|
||||||
|
// revisions: old re
|
||||||
|
|
||||||
|
#![cfg_attr(re, feature(re_rebalance_coherence))]
|
||||||
|
|
||||||
trait TheTrait {
|
trait TheTrait {
|
||||||
fn foo(&self) { }
|
fn foo(&self) { }
|
||||||
}
|
}
|
||||||
|
@ -9,7 +13,8 @@ impl TheTrait for for<'a,'b> fn(&'a u8, &'b u8) -> &'a u8 {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
|
impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
|
||||||
//~^ ERROR
|
//[old]~^ ERROR
|
||||||
|
//[re]~^^ ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue