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 cefcac2c51795782e65adde76ba3bf2911e2b3fb..756ab2b102b56d819d514fb90a2ead200bb3ff8b 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 0000000000000000000000000000000000000000..756ab2b102b56d819d514fb90a2ead200bb3ff8b --- /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 dd127bf7f4bffa93678967bc15fed74e06233cef..0c7d54425ddc43351da038737efe058ba1c8562c 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 @@ 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 1fc5c39d5c9fd2e37e99a3463824ccf10cb2b953..db9f9f7665374ce3f0fe00f2dcad8690311fe356 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 0000000000000000000000000000000000000000..db9f9f7665374ce3f0fe00f2dcad8690311fe356 --- /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 fb9a7fbf7aba5e343edbfb3387bca9affc282a1a..f27e14eab63da96951ee661229ce3f467393bd29 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() { }