Skip to content

Commit

Permalink
Update tests changed by rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Jan 4, 2019
1 parent ae5c092 commit d758e4d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
Expand Down
Original file line number Diff line number Diff line change
@@ -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`.
6 changes: 5 additions & 1 deletion src/test/ui/coherence/coherence-fundamental-trait-objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
// are distinct.

// aux-build:coherence_fundamental_trait_lib.rs
// revisions: old re

#![cfg_attr(re, feature(re_rebalance_coherence))]

extern crate coherence_fundamental_trait_lib;

use coherence_fundamental_trait_lib::{Fundamental, Misc};

pub struct Local;
impl Misc for dyn Fundamental<Local> {}
//~^ ERROR E0117
//[old]~^ ERROR E0117
//[re]~^^ ERROR E0117

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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 {
| --------------------------------------------------------- first implementation here
Expand Down
14 changes: 14 additions & 0 deletions src/test/ui/coherence/coherence-subtyping.re.stderr
Original file line number Diff line number Diff line change
@@ -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`.
7 changes: 6 additions & 1 deletion src/test/ui/coherence/coherence-subtyping.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Test that two distinct impls which match subtypes of one another
// yield coherence errors (or not) depending on the variance.

// revisions: old re

#![cfg_attr(re, feature(re_rebalance_coherence))]

trait TheTrait {
fn foo(&self) { }
}
Expand All @@ -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 {
//~^ ERROR
//[old]~^ ERROR
//[re]~^^ ERROR
}

fn main() { }

0 comments on commit d758e4d

Please sign in to comment.