From d758e4db783618daef974d067fdf6cfb285f48d5 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Fri, 4 Jan 2019 10:19:22 +0100 Subject: [PATCH] Update tests changed by rebase --- ...coherence-fundamental-trait-objects.old.stderr} | 2 +- .../coherence-fundamental-trait-objects.re.stderr | 12 ++++++++++++ .../coherence-fundamental-trait-objects.rs | 6 +++++- ...yping.stderr => coherence-subtyping.old.stderr} | 2 +- .../ui/coherence/coherence-subtyping.re.stderr | 14 ++++++++++++++ src/test/ui/coherence/coherence-subtyping.rs | 7 ++++++- 6 files changed, 39 insertions(+), 4 deletions(-) rename src/test/ui/coherence/{coherence-fundamental-trait-objects.stderr => coherence-fundamental-trait-objects.old.stderr} (89%) create mode 100644 src/test/ui/coherence/coherence-fundamental-trait-objects.re.stderr rename src/test/ui/coherence/{coherence-subtyping.stderr => coherence-subtyping.old.stderr} (94%) create mode 100644 src/test/ui/coherence/coherence-subtyping.re.stderr diff --git a/src/test/ui/coherence/coherence-fundamental-trait-objects.stderr b/src/test/ui/coherence/coherence-fundamental-trait-objects.old.stderr similarity index 89% rename from src/test/ui/coherence/coherence-fundamental-trait-objects.stderr rename to src/test/ui/coherence/coherence-fundamental-trait-objects.old.stderr index cefcac2c517..756ab2b102b 100644 --- a/src/test/ui/coherence/coherence-fundamental-trait-objects.stderr +++ b/src/test/ui/coherence/coherence-fundamental-trait-objects.old.stderr @@ -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 {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate diff --git a/src/test/ui/coherence/coherence-fundamental-trait-objects.re.stderr b/src/test/ui/coherence/coherence-fundamental-trait-objects.re.stderr new file mode 100644 index 00000000000..756ab2b102b --- /dev/null +++ b/src/test/ui/coherence/coherence-fundamental-trait-objects.re.stderr @@ -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 {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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`. diff --git a/src/test/ui/coherence/coherence-fundamental-trait-objects.rs b/src/test/ui/coherence/coherence-fundamental-trait-objects.rs index dd127bf7f4b..0c7d54425dd 100644 --- a/src/test/ui/coherence/coherence-fundamental-trait-objects.rs +++ b/src/test/ui/coherence/coherence-fundamental-trait-objects.rs @@ -3,6 +3,9 @@ // 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; @@ -10,6 +13,7 @@ use coherence_fundamental_trait_lib::{Fundamental, Misc}; pub struct Local; impl Misc for dyn Fundamental {} -//~^ ERROR E0117 +//[old]~^ ERROR E0117 +//[re]~^^ ERROR E0117 fn main() {} diff --git a/src/test/ui/coherence/coherence-subtyping.stderr b/src/test/ui/coherence/coherence-subtyping.old.stderr similarity index 94% rename from src/test/ui/coherence/coherence-subtyping.stderr rename to src/test/ui/coherence/coherence-subtyping.old.stderr index 1fc5c39d5c9..db9f9f76653 100644 --- a/src/test/ui/coherence/coherence-subtyping.stderr +++ b/src/test/ui/coherence/coherence-subtyping.old.stderr @@ -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 diff --git a/src/test/ui/coherence/coherence-subtyping.re.stderr b/src/test/ui/coherence/coherence-subtyping.re.stderr new file mode 100644 index 00000000000..db9f9f76653 --- /dev/null +++ b/src/test/ui/coherence/coherence-subtyping.re.stderr @@ -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`. diff --git a/src/test/ui/coherence/coherence-subtyping.rs b/src/test/ui/coherence/coherence-subtyping.rs index fb9a7fbf7ab..f27e14eab63 100644 --- a/src/test/ui/coherence/coherence-subtyping.rs +++ b/src/test/ui/coherence/coherence-subtyping.rs @@ -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) { } } @@ -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() { }