about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-05 00:49:12 +0000
committerbors <bors@rust-lang.org>2019-01-05 00:49:12 +0000
commit244b05db12e47efef4695036974bc25fde13b828 (patch)
tree3cfddf52e2f53aea3f34500ae4d05b11e4e8f559 /src
parentbf6bb141bbc77bfb7d9bc79f2db6d986aafc01cc (diff)
parentd758e4db783618daef974d067fdf6cfb285f48d5 (diff)
downloadrust-244b05db12e47efef4695036974bc25fde13b828.tar.gz
rust-244b05db12e47efef4695036974bc25fde13b828.zip
Auto merge of #56145 - weiznich:re_rebalance_coherence, r=nikomatsakis
Implement the Re-rebalance coherence RFC

This is the first time I touch anything in the compiler so just tell me if I got something wrong.

Big thanks to @sgrif for the pointers where to look for those things.
cc #55437
Diffstat (limited to 'src')
-rw-r--r--src/doc/unstable-book/src/language-features/re-rebalance-coherence.md23
-rw-r--r--src/librustc/traits/coherence.rs89
-rw-r--r--src/libsyntax/feature_gate.rs3
-rw-r--r--src/test/run-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs23
-rw-r--r--src/test/run-pass/coherence/coherence-bigint-int.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-bigint-vecint.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-blanket.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-covered-type-parameter.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-impl-in-fn.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-iterator-vec.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-multidispatch-tuple.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-negative-impls-safe.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-rfc447-constrained.rs3
-rw-r--r--src/test/run-pass/coherence/coherence-where-clause.rs4
-rw-r--r--src/test/run-pass/coherence/coherence_copy_like.rs3
-rw-r--r--src/test/run-pass/coherence/re-rebalance-coherence.rs14
-rw-r--r--src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib.rs23
-rw-r--r--src/test/ui/coherence/coherence-all-remote.old.stderr (renamed from src/test/ui/coherence/coherence-all-remote.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-all-remote.re.stderr11
-rw-r--r--src/test/ui/coherence/coherence-all-remote.rs6
-rw-r--r--src/test/ui/coherence/coherence-bigint-param.old.stderr (renamed from src/test/ui/coherence/coherence-bigint-param.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-bigint-param.re.stderr11
-rw-r--r--src/test/ui/coherence/coherence-bigint-param.rs6
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.old.stderr (renamed from src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs9
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.old.stderr (renamed from src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs8
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.old.stderr (renamed from src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.re.stderr13
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs7
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.old.stderr (renamed from src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs8
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.old.stderr (renamed from src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs8
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific.old.stderr (renamed from src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs8
-rw-r--r--src/test/ui/coherence/coherence-conflicting-negative-trait-impl.old.stderr (renamed from src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-conflicting-negative-trait-impl.re.stderr21
-rw-r--r--src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs9
-rw-r--r--src/test/ui/coherence/coherence-cow.a.stderr4
-rw-r--r--src/test/ui/coherence/coherence-cow.b.stderr4
-rw-r--r--src/test/ui/coherence/coherence-cow.c.stderr2
-rw-r--r--src/test/ui/coherence/coherence-cow.re_a.stderr12
-rw-r--r--src/test/ui/coherence/coherence-cow.re_b.stderr12
-rw-r--r--src/test/ui/coherence/coherence-cow.re_c.stderr12
-rw-r--r--src/test/ui/coherence/coherence-cow.rs19
-rw-r--r--src/test/ui/coherence/coherence-cross-crate-conflict.old.stderr (renamed from src/test/ui/coherence/coherence-cross-crate-conflict.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-cross-crate-conflict.re.stderr21
-rw-r--r--src/test/ui/coherence/coherence-cross-crate-conflict.rs10
-rw-r--r--src/test/ui/coherence/coherence-default-trait-impl.old.stderr (renamed from src/test/ui/coherence/coherence-default-trait-impl.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-default-trait-impl.re.stderr16
-rw-r--r--src/test/ui/coherence/coherence-default-trait-impl.rs9
-rw-r--r--src/test/ui/coherence/coherence-error-suppression.old.stderr (renamed from src/test/ui/coherence/coherence-error-suppression.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-error-suppression.re.stderr9
-rw-r--r--src/test/ui/coherence/coherence-error-suppression.rs8
-rw-r--r--src/test/ui/coherence/coherence-fundamental-trait-objects.old.stderr (renamed from src/test/ui/coherence/coherence-fundamental-trait-objects.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-fundamental-trait-objects.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-fundamental-trait-objects.rs6
-rw-r--r--src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.old.stderr (renamed from src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.re.stderr11
-rw-r--r--src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs8
-rw-r--r--src/test/ui/coherence/coherence-impl-trait-for-trait.old.stderr (renamed from src/test/ui/coherence/coherence-impl-trait-for-trait.stderr)12
-rw-r--r--src/test/ui/coherence/coherence-impl-trait-for-trait.re.stderr21
-rw-r--r--src/test/ui/coherence/coherence-impl-trait-for-trait.rs16
-rw-r--r--src/test/ui/coherence/coherence-impls-copy.old.stderr (renamed from src/test/ui/coherence/coherence-impls-copy.stderr)20
-rw-r--r--src/test/ui/coherence/coherence-impls-copy.re.stderr87
-rw-r--r--src/test/ui/coherence/coherence-impls-copy.rs38
-rw-r--r--src/test/ui/coherence/coherence-impls-send.old.stderr (renamed from src/test/ui/coherence/coherence-impls-send.stderr)8
-rw-r--r--src/test/ui/coherence/coherence-impls-send.re.stderr37
-rw-r--r--src/test/ui/coherence/coherence-impls-send.rs15
-rw-r--r--src/test/ui/coherence/coherence-impls-sized.old.stderr (renamed from src/test/ui/coherence/coherence-impls-sized.stderr)36
-rw-r--r--src/test/ui/coherence/coherence-impls-sized.re.stderr67
-rw-r--r--src/test/ui/coherence/coherence-impls-sized.rs58
-rw-r--r--src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.old.stderr (renamed from src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.re.stderr16
-rw-r--r--src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs6
-rw-r--r--src/test/ui/coherence/coherence-lone-type-parameter.old.stderr (renamed from src/test/ui/coherence/coherence-lone-type-parameter.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-lone-type-parameter.re.stderr11
-rw-r--r--src/test/ui/coherence/coherence-lone-type-parameter.rs7
-rw-r--r--src/test/ui/coherence/coherence-negative-impls-safe.old.stderr (renamed from src/test/ui/coherence/coherence-negative-impls-safe.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-negative-impls-safe.re.stderr9
-rw-r--r--src/test/ui/coherence/coherence-negative-impls-safe.rs6
-rw-r--r--src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.old.stderr (renamed from src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.re.stderr11
-rw-r--r--src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs8
-rw-r--r--src/test/ui/coherence/coherence-orphan.old.stderr (renamed from src/test/ui/coherence/coherence-orphan.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-orphan.re.stderr21
-rw-r--r--src/test/ui/coherence/coherence-orphan.rs8
-rw-r--r--src/test/ui/coherence/coherence-overlap-all-t-and-tuple.old.stderr (renamed from src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-overlap-all-t-and-tuple.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs8
-rw-r--r--src/test/ui/coherence/coherence-overlap-downstream-inherent.old.stderr (renamed from src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr)8
-rw-r--r--src/test/ui/coherence/coherence-overlap-downstream-inherent.re.stderr23
-rw-r--r--src/test/ui/coherence/coherence-overlap-downstream-inherent.rs10
-rw-r--r--src/test/ui/coherence/coherence-overlap-downstream.old.stderr (renamed from src/test/ui/coherence/coherence-overlap-downstream.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-overlap-downstream.re.stderr21
-rw-r--r--src/test/ui/coherence/coherence-overlap-downstream.rs10
-rw-r--r--src/test/ui/coherence/coherence-overlap-issue-23516-inherent.old.stderr (renamed from src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-overlap-issue-23516-inherent.re.stderr14
-rw-r--r--src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs7
-rw-r--r--src/test/ui/coherence/coherence-overlap-issue-23516.old.stderr (renamed from src/test/ui/coherence/coherence-overlap-issue-23516.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-overlap-issue-23516.re.stderr13
-rw-r--r--src/test/ui/coherence/coherence-overlap-issue-23516.rs7
-rw-r--r--src/test/ui/coherence/coherence-overlap-messages.old.stderr (renamed from src/test/ui/coherence/coherence-overlap-messages.stderr)22
-rw-r--r--src/test/ui/coherence/coherence-overlap-messages.re.stderr44
-rw-r--r--src/test/ui/coherence/coherence-overlap-messages.rs25
-rw-r--r--src/test/ui/coherence/coherence-overlap-upstream-inherent.old.stderr (renamed from src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-overlap-upstream-inherent.re.stderr14
-rw-r--r--src/test/ui/coherence/coherence-overlap-upstream-inherent.rs7
-rw-r--r--src/test/ui/coherence/coherence-overlap-upstream.old.stderr (renamed from src/test/ui/coherence/coherence-overlap-upstream.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-overlap-upstream.re.stderr13
-rw-r--r--src/test/ui/coherence/coherence-overlap-upstream.rs7
-rw-r--r--src/test/ui/coherence/coherence-overlapping-pairs.old.stderr (renamed from src/test/ui/coherence/coherence-overlapping-pairs.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-overlapping-pairs.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-overlapping-pairs.rs6
-rw-r--r--src/test/ui/coherence/coherence-pair-covered-uncovered-1.old.stderr (renamed from src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-pair-covered-uncovered-1.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs7
-rw-r--r--src/test/ui/coherence/coherence-pair-covered-uncovered.old.stderr (renamed from src/test/ui/coherence/coherence-pair-covered-uncovered.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-pair-covered-uncovered.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-pair-covered-uncovered.rs6
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict-orphan.old.stderr (renamed from src/test/ui/coherence/coherence-projection-conflict-orphan.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict-orphan.re.stderr14
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict-orphan.rs7
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict-ty-param.old.stderr (renamed from src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict-ty-param.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict-ty-param.rs8
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict.old.stderr (renamed from src/test/ui/coherence/coherence-projection-conflict.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict.rs8
-rw-r--r--src/test/ui/coherence/coherence-projection-ok-orphan.rs3
-rw-r--r--src/test/ui/coherence/coherence-projection-ok.rs3
-rw-r--r--src/test/ui/coherence/coherence-subtyping.old.stderr (renamed from src/test/ui/coherence/coherence-subtyping.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-subtyping.re.stderr14
-rw-r--r--src/test/ui/coherence/coherence-subtyping.rs7
-rw-r--r--src/test/ui/coherence/coherence-tuple-conflict.old.stderr (renamed from src/test/ui/coherence/coherence-tuple-conflict.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-tuple-conflict.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-tuple-conflict.rs8
-rw-r--r--src/test/ui/coherence/coherence-vec-local-2.old.stderr (renamed from src/test/ui/coherence/coherence-vec-local-2.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-vec-local-2.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-vec-local-2.rs7
-rw-r--r--src/test/ui/coherence/coherence-vec-local.old.stderr (renamed from src/test/ui/coherence/coherence-vec-local.stderr)4
-rw-r--r--src/test/ui/coherence/coherence-vec-local.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence-vec-local.rs7
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs3
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs3
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.old.stderr (renamed from src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr)4
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.re.stderr14
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs6
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_struct.old.stderr (renamed from src/test/ui/coherence/coherence_copy_like_err_struct.stderr)4
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_struct.re.stderr14
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_struct.rs7
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_tuple.old.stderr (renamed from src/test/ui/coherence/coherence_copy_like_err_tuple.stderr)4
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_tuple.re.stderr14
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_tuple.rs7
-rw-r--r--src/test/ui/coherence/coherence_inherent.old.stderr (renamed from src/test/ui/coherence/coherence_inherent.stderr)4
-rw-r--r--src/test/ui/coherence/coherence_inherent.re.stderr13
-rw-r--r--src/test/ui/coherence/coherence_inherent.rs8
-rw-r--r--src/test/ui/coherence/coherence_inherent_cc.old.stderr (renamed from src/test/ui/coherence/coherence_inherent_cc.stderr)4
-rw-r--r--src/test/ui/coherence/coherence_inherent_cc.re.stderr13
-rw-r--r--src/test/ui/coherence/coherence_inherent_cc.rs7
-rw-r--r--src/test/ui/coherence/coherence_local.rs3
-rw-r--r--src/test/ui/coherence/coherence_local_err_struct.old.stderr (renamed from src/test/ui/coherence/coherence_local_err_struct.stderr)4
-rw-r--r--src/test/ui/coherence/coherence_local_err_struct.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence_local_err_struct.rs7
-rw-r--r--src/test/ui/coherence/coherence_local_err_tuple.old.stderr (renamed from src/test/ui/coherence/coherence_local_err_tuple.stderr)4
-rw-r--r--src/test/ui/coherence/coherence_local_err_tuple.re.stderr12
-rw-r--r--src/test/ui/coherence/coherence_local_err_tuple.rs7
-rw-r--r--src/test/ui/coherence/coherence_local_ref.rs3
-rw-r--r--src/test/ui/coherence/re-rebalance-coherence.rs13
-rw-r--r--src/test/ui/feature-gates/auxiliary/re_rebalance_coherence_lib.rs23
-rw-r--r--src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs13
-rw-r--r--src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.stderr11
179 files changed, 1648 insertions, 267 deletions
diff --git a/src/doc/unstable-book/src/language-features/re-rebalance-coherence.md b/src/doc/unstable-book/src/language-features/re-rebalance-coherence.md
new file mode 100644
index 00000000000..1e74652a890
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/re-rebalance-coherence.md
@@ -0,0 +1,23 @@
+# `re_rebalance_coherence`
+
+The tracking issue for this feature is: [#55437]
+
+[#55437]: https://github.com/rust-lang/rust/issues/55437
+
+------------------------
+
+The `re_rebalance_coherence` feature tweaks the rules regarding which trait
+impls are allowed in crates.
+The following rule is used:
+
+Given `impl<P1..=Pn> Trait<T1..=Tn> for T0`, an impl is valid only if at
+least one of the following is true:
+- `Trait` is a local trait
+- All of
+  - At least one of the types `T0..=Tn` must be a local type. Let `Ti` be the
+    first such type.
+  - No uncovered type parameters `P1..=Pn` may appear in `T0..Ti` (excluding
+    `Ti`)
+
+
+See the [RFC](https://github.com/rust-lang/rfcs/blob/master/text/2451-re-rebalancing-coherence.md) for details.
diff --git a/src/librustc/traits/coherence.rs b/src/librustc/traits/coherence.rs
index b3d732ebcd7..c9cb823ebb3 100644
--- a/src/librustc/traits/coherence.rs
+++ b/src/librustc/traits/coherence.rs
@@ -371,43 +371,68 @@ fn orphan_check_trait_ref<'tcx>(tcx: TyCtxt<'_, '_, '_>,
              trait_ref);
     }
 
-    // First, create an ordered iterator over all the type parameters to the trait, with the self
-    // type appearing first.
-    // Find the first input type that either references a type parameter OR
-    // some local type.
-    for input_ty in trait_ref.input_types() {
-        if ty_is_local(tcx, input_ty, in_crate) {
-            debug!("orphan_check_trait_ref: ty_is_local `{:?}`", input_ty);
-
-            // First local input type. Check that there are no
-            // uncovered type parameters.
-            let uncovered_tys = uncovered_tys(tcx, input_ty, in_crate);
-            for uncovered_ty in uncovered_tys {
-                if let Some(param) = uncovered_ty.walk()
-                    .find(|t| is_possibly_remote_type(t, in_crate))
-                {
-                    debug!("orphan_check_trait_ref: uncovered type `{:?}`", param);
-                    return Err(OrphanCheckErr::UncoveredTy(param));
-                }
+    if tcx.features().re_rebalance_coherence {
+        // Given impl<P1..=Pn> Trait<T1..=Tn> for T0, an impl is valid only
+        // if at least one of the following is true:
+        //
+        // - Trait is a local trait
+        // (already checked in orphan_check prior to calling this function)
+        // - All of
+        //     - At least one of the types T0..=Tn must be a local type.
+        //      Let Ti be the first such type.
+        //     - No uncovered type parameters P1..=Pn may appear in T0..Ti (excluding Ti)
+        //
+        for input_ty in trait_ref.input_types() {
+            debug!("orphan_check_trait_ref: check ty `{:?}`", input_ty);
+            if ty_is_local(tcx, input_ty, in_crate) {
+                debug!("orphan_check_trait_ref: ty_is_local `{:?}`", input_ty);
+                return Ok(());
+            } else if let ty::Param(_) = input_ty.sty {
+                debug!("orphan_check_trait_ref: uncovered ty: `{:?}`", input_ty);
+                return Err(OrphanCheckErr::UncoveredTy(input_ty))
             }
-
-            // OK, found local type, all prior types upheld invariant.
-            return Ok(());
         }
+        // If we exit above loop, never found a local type.
+        debug!("orphan_check_trait_ref: no local type");
+        Err(OrphanCheckErr::NoLocalInputType)
+    } else {
+        // First, create an ordered iterator over all the type
+        // parameters to the trait, with the self type appearing
+        // first.  Find the first input type that either references a
+        // type parameter OR some local type.
+        for input_ty in trait_ref.input_types() {
+            if ty_is_local(tcx, input_ty, in_crate) {
+                debug!("orphan_check_trait_ref: ty_is_local `{:?}`", input_ty);
+
+                // First local input type. Check that there are no
+                // uncovered type parameters.
+                let uncovered_tys = uncovered_tys(tcx, input_ty, in_crate);
+                for uncovered_ty in uncovered_tys {
+                    if let Some(param) = uncovered_ty.walk()
+                        .find(|t| is_possibly_remote_type(t, in_crate))
+                    {
+                        debug!("orphan_check_trait_ref: uncovered type `{:?}`", param);
+                        return Err(OrphanCheckErr::UncoveredTy(param));
+                    }
+                }
 
-        // Otherwise, enforce invariant that there are no type
-        // parameters reachable.
-        if let Some(param) = input_ty.walk()
-            .find(|t| is_possibly_remote_type(t, in_crate))
-        {
-            debug!("orphan_check_trait_ref: uncovered type `{:?}`", param);
-            return Err(OrphanCheckErr::UncoveredTy(param));
+                // OK, found local type, all prior types upheld invariant.
+                return Ok(());
+            }
+
+            // Otherwise, enforce invariant that there are no type
+            // parameters reachable.
+            if let Some(param) = input_ty.walk()
+                .find(|t| is_possibly_remote_type(t, in_crate))
+            {
+                debug!("orphan_check_trait_ref: uncovered type `{:?}`", param);
+                return Err(OrphanCheckErr::UncoveredTy(param));
+            }
         }
+        // If we exit above loop, never found a local type.
+        debug!("orphan_check_trait_ref: no local type");
+        Err(OrphanCheckErr::NoLocalInputType)
     }
-
-    // If we exit above loop, never found a local type.
-    debug!("orphan_check_trait_ref: no local type");
-    return Err(OrphanCheckErr::NoLocalInputType);
 }
 
 fn uncovered_tys<'tcx>(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'tcx>, in_crate: InCrate)
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 3f2122e24a6..8362c86f8ba 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -479,6 +479,9 @@ declare_features! (
 
     // Allows paths to enum variants on type aliases.
     (active, type_alias_enum_variants, "1.31.0", Some(49683), None),
+
+    // Re-Rebalance coherence
+    (active, re_rebalance_coherence, "1.32.0", Some(55437), None),
 );
 
 declare_features! (
diff --git a/src/test/run-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs b/src/test/run-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs
new file mode 100644
index 00000000000..c8d027b25c7
--- /dev/null
+++ b/src/test/run-pass/coherence/auxiliary/re_rebalance_coherence_lib.rs
@@ -0,0 +1,23 @@
+
+pub trait Backend{}
+pub trait SupportsDefaultKeyword {}
+
+impl SupportsDefaultKeyword for Postgres {}
+
+pub struct Postgres;
+
+impl Backend for Postgres {}
+
+pub struct AstPass<DB>(::std::marker::PhantomData<DB>);
+
+pub trait QueryFragment<DB: Backend> {}
+
+
+#[derive(Debug, Clone, Copy)]
+pub struct BatchInsert<'a, T: 'a, Tab> {
+    _marker: ::std::marker::PhantomData<(&'a T, Tab)>,
+}
+
+impl<'a, T:'a, Tab, DB> QueryFragment<DB> for BatchInsert<'a, T, Tab>
+where DB: SupportsDefaultKeyword + Backend,
+{}
diff --git a/src/test/run-pass/coherence/coherence-bigint-int.rs b/src/test/run-pass/coherence/coherence-bigint-int.rs
index 02945e9dade..0c9abdc15e6 100644
--- a/src/test/run-pass/coherence/coherence-bigint-int.rs
+++ b/src/test/run-pass/coherence/coherence-bigint-int.rs
@@ -1,5 +1,8 @@
 // run-pass
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 // pretty-expanded FIXME #23616
 
diff --git a/src/test/run-pass/coherence/coherence-bigint-vecint.rs b/src/test/run-pass/coherence/coherence-bigint-vecint.rs
index a5dba90be5c..38e0be0aa9a 100644
--- a/src/test/run-pass/coherence/coherence-bigint-vecint.rs
+++ b/src/test/run-pass/coherence/coherence-bigint-vecint.rs
@@ -1,5 +1,8 @@
 // run-pass
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 // pretty-expanded FIXME #23616
 
diff --git a/src/test/run-pass/coherence/coherence-blanket.rs b/src/test/run-pass/coherence/coherence-blanket.rs
index 55fa89d7507..5d310cc2c6a 100644
--- a/src/test/run-pass/coherence/coherence-blanket.rs
+++ b/src/test/run-pass/coherence/coherence-blanket.rs
@@ -1,6 +1,9 @@
 // run-pass
 #![allow(unused_imports)]
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 // pretty-expanded FIXME #23616
 
diff --git a/src/test/run-pass/coherence/coherence-covered-type-parameter.rs b/src/test/run-pass/coherence/coherence-covered-type-parameter.rs
index bb95c59d183..1cf039f0831 100644
--- a/src/test/run-pass/coherence/coherence-covered-type-parameter.rs
+++ b/src/test/run-pass/coherence/coherence-covered-type-parameter.rs
@@ -1,6 +1,9 @@
 // run-pass
 #![allow(dead_code)]
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 // pretty-expanded FIXME #23616
 
diff --git a/src/test/run-pass/coherence/coherence-impl-in-fn.rs b/src/test/run-pass/coherence/coherence-impl-in-fn.rs
index b9719731748..09e2c1e5a4e 100644
--- a/src/test/run-pass/coherence/coherence-impl-in-fn.rs
+++ b/src/test/run-pass/coherence/coherence-impl-in-fn.rs
@@ -1,4 +1,7 @@
 // run-pass
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 #![allow(non_camel_case_types)]
 
diff --git a/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs b/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs
index 43a0a5c4277..051cc280b2d 100644
--- a/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs
+++ b/src/test/run-pass/coherence/coherence-iterator-vec-any-elem.rs
@@ -1,4 +1,7 @@
 // run-pass
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 // aux-build:coherence_lib.rs
 
diff --git a/src/test/run-pass/coherence/coherence-iterator-vec.rs b/src/test/run-pass/coherence/coherence-iterator-vec.rs
index 386fe40ac3c..df6e808f7de 100644
--- a/src/test/run-pass/coherence/coherence-iterator-vec.rs
+++ b/src/test/run-pass/coherence/coherence-iterator-vec.rs
@@ -1,4 +1,7 @@
 // run-pass
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 // aux-build:coherence_lib.rs
 
diff --git a/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs b/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs
index fa1d4bbb496..6a816664c48 100644
--- a/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs
+++ b/src/test/run-pass/coherence/coherence-multidispatch-tuple.rs
@@ -1,4 +1,7 @@
 // run-pass
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(unused_imports)]
 // pretty-expanded FIXME #23616
 
diff --git a/src/test/run-pass/coherence/coherence-negative-impls-safe.rs b/src/test/run-pass/coherence/coherence-negative-impls-safe.rs
index 695a71cbd2d..98b04489ac4 100644
--- a/src/test/run-pass/coherence/coherence-negative-impls-safe.rs
+++ b/src/test/run-pass/coherence/coherence-negative-impls-safe.rs
@@ -1,4 +1,7 @@
 // run-pass
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 // pretty-expanded FIXME #23616
 
diff --git a/src/test/run-pass/coherence/coherence-rfc447-constrained.rs b/src/test/run-pass/coherence/coherence-rfc447-constrained.rs
index 9d1d8688325..4da54d386fd 100644
--- a/src/test/run-pass/coherence/coherence-rfc447-constrained.rs
+++ b/src/test/run-pass/coherence/coherence-rfc447-constrained.rs
@@ -1,4 +1,7 @@
 // run-pass
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 // check that trait matching can handle impls whose types are only
 // constrained by a projection.
 
diff --git a/src/test/run-pass/coherence/coherence-where-clause.rs b/src/test/run-pass/coherence/coherence-where-clause.rs
index 9f8a1b9bd16..28397420385 100644
--- a/src/test/run-pass/coherence/coherence-where-clause.rs
+++ b/src/test/run-pass/coherence/coherence-where-clause.rs
@@ -1,4 +1,8 @@
 // run-pass
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 use std::fmt::Debug;
 use std::default::Default;
 
diff --git a/src/test/run-pass/coherence/coherence_copy_like.rs b/src/test/run-pass/coherence/coherence_copy_like.rs
index 92af341ccb5..653f76264c1 100644
--- a/src/test/run-pass/coherence/coherence_copy_like.rs
+++ b/src/test/run-pass/coherence/coherence_copy_like.rs
@@ -1,4 +1,7 @@
 // run-pass
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 // Test that we are able to introduce a negative constraint that
 // `MyType: !MyTrait` along with other "fundamental" wrappers.
diff --git a/src/test/run-pass/coherence/re-rebalance-coherence.rs b/src/test/run-pass/coherence/re-rebalance-coherence.rs
new file mode 100644
index 00000000000..bacd3b89fad
--- /dev/null
+++ b/src/test/run-pass/coherence/re-rebalance-coherence.rs
@@ -0,0 +1,14 @@
+#![allow(dead_code)]
+#![feature(re_rebalance_coherence)]
+
+// run-pass
+// aux-build:re_rebalance_coherence_lib.rs
+
+extern crate re_rebalance_coherence_lib as lib;
+use lib::*;
+
+struct Oracle;
+impl Backend for Oracle {}
+impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}
+
+fn main() {}
diff --git a/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib.rs b/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib.rs
new file mode 100644
index 00000000000..c8d027b25c7
--- /dev/null
+++ b/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib.rs
@@ -0,0 +1,23 @@
+
+pub trait Backend{}
+pub trait SupportsDefaultKeyword {}
+
+impl SupportsDefaultKeyword for Postgres {}
+
+pub struct Postgres;
+
+impl Backend for Postgres {}
+
+pub struct AstPass<DB>(::std::marker::PhantomData<DB>);
+
+pub trait QueryFragment<DB: Backend> {}
+
+
+#[derive(Debug, Clone, Copy)]
+pub struct BatchInsert<'a, T: 'a, Tab> {
+    _marker: ::std::marker::PhantomData<(&'a T, Tab)>,
+}
+
+impl<'a, T:'a, Tab, DB> QueryFragment<DB> for BatchInsert<'a, T, Tab>
+where DB: SupportsDefaultKeyword + Backend,
+{}
diff --git a/src/test/ui/coherence/coherence-all-remote.stderr b/src/test/ui/coherence/coherence-all-remote.old.stderr
index 3d8afc418ea..0389a6228ef 100644
--- a/src/test/ui/coherence/coherence-all-remote.stderr
+++ b/src/test/ui/coherence/coherence-all-remote.old.stderr
@@ -1,5 +1,5 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-all-remote.rs:6:1
+  --> $DIR/coherence-all-remote.rs:9:1
    |
 LL | impl<T> Remote1<T> for isize { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
diff --git a/src/test/ui/coherence/coherence-all-remote.re.stderr b/src/test/ui/coherence/coherence-all-remote.re.stderr
new file mode 100644
index 00000000000..0389a6228ef
--- /dev/null
+++ b/src/test/ui/coherence/coherence-all-remote.re.stderr
@@ -0,0 +1,11 @@
+error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
+  --> $DIR/coherence-all-remote.rs:9:1
+   |
+LL | impl<T> Remote1<T> for isize { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
+   |
+   = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0210`.
diff --git a/src/test/ui/coherence/coherence-all-remote.rs b/src/test/ui/coherence/coherence-all-remote.rs
index 5c3bfee822f..68c924ee274 100644
--- a/src/test/ui/coherence/coherence-all-remote.rs
+++ b/src/test/ui/coherence/coherence-all-remote.rs
@@ -1,9 +1,13 @@
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate coherence_lib as lib;
 use lib::Remote1;
 
 impl<T> Remote1<T> for isize { }
-//~^ ERROR E0210
+//[old]~^ ERROR E0210
+//[re]~^^ ERROR E0210
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-bigint-param.stderr b/src/test/ui/coherence/coherence-bigint-param.old.stderr
index 81d56349a9e..54fec07e65a 100644
--- a/src/test/ui/coherence/coherence-bigint-param.stderr
+++ b/src/test/ui/coherence/coherence-bigint-param.old.stderr
@@ -1,5 +1,5 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-bigint-param.rs:8:1
+  --> $DIR/coherence-bigint-param.rs:11:1
    |
 LL | impl<T> Remote1<BigInt> for T { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
diff --git a/src/test/ui/coherence/coherence-bigint-param.re.stderr b/src/test/ui/coherence/coherence-bigint-param.re.stderr
new file mode 100644
index 00000000000..54fec07e65a
--- /dev/null
+++ b/src/test/ui/coherence/coherence-bigint-param.re.stderr
@@ -0,0 +1,11 @@
+error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
+  --> $DIR/coherence-bigint-param.rs:11:1
+   |
+LL | impl<T> Remote1<BigInt> for T { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
+   |
+   = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0210`.
diff --git a/src/test/ui/coherence/coherence-bigint-param.rs b/src/test/ui/coherence/coherence-bigint-param.rs
index d199c1c2169..24106b4b348 100644
--- a/src/test/ui/coherence/coherence-bigint-param.rs
+++ b/src/test/ui/coherence/coherence-bigint-param.rs
@@ -1,4 +1,7 @@
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate coherence_lib as lib;
 use lib::Remote1;
@@ -6,6 +9,7 @@ use lib::Remote1;
 pub struct BigInt;
 
 impl<T> Remote1<BigInt> for T { }
-//~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[old]~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[re]~^^ ERROR E0210
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.old.stderr
index 9dd08b9e558..a6d29048b4d 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait`:
-  --> $DIR/coherence-blanket-conflicts-with-blanket-implemented.rs:24:1
+  --> $DIR/coherence-blanket-conflicts-with-blanket-implemented.rs:28:1
    |
 LL | impl<T:Even> MyTrait for T {
    | -------------------------- first implementation here
 ...
-LL | impl<T:Odd> MyTrait for T { //~ ERROR E0119
+LL | impl<T:Odd> MyTrait for T {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.re.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.re.stderr
new file mode 100644
index 00000000000..a6d29048b4d
--- /dev/null
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `MyTrait`:
+  --> $DIR/coherence-blanket-conflicts-with-blanket-implemented.rs:28:1
+   |
+LL | impl<T:Even> MyTrait for T {
+   | -------------------------- first implementation here
+...
+LL | impl<T:Odd> MyTrait for T {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs
index 46d878859e0..098a13e54bf 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs
@@ -1,3 +1,7 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 use std::fmt::Debug;
 use std::default::Default;
 
@@ -21,7 +25,10 @@ impl<T:Even> MyTrait for T {
     fn get(&self) -> usize { 0 }
 }
 
-impl<T:Odd> MyTrait for T { //~ ERROR E0119
+impl<T:Odd> MyTrait for T {
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
+
     fn get(&self) -> usize { 0 }
 }
 
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.old.stderr
index 1719bc60a04..1f3ddd1dc42 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait`:
-  --> $DIR/coherence-blanket-conflicts-with-blanket-unimplemented.rs:20:1
+  --> $DIR/coherence-blanket-conflicts-with-blanket-unimplemented.rs:24:1
    |
 LL | impl<T:Even> MyTrait for T {
    | -------------------------- first implementation here
 ...
-LL | impl<T:Odd> MyTrait for T { //~ ERROR E0119
+LL | impl<T:Odd> MyTrait for T {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.re.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.re.stderr
new file mode 100644
index 00000000000..1f3ddd1dc42
--- /dev/null
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `MyTrait`:
+  --> $DIR/coherence-blanket-conflicts-with-blanket-unimplemented.rs:24:1
+   |
+LL | impl<T:Even> MyTrait for T {
+   | -------------------------- first implementation here
+...
+LL | impl<T:Odd> MyTrait for T {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs
index 0044760161e..5b76fc0174b 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs
@@ -1,3 +1,7 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 use std::fmt::Debug;
 use std::default::Default;
 
@@ -17,7 +21,9 @@ impl<T:Even> MyTrait for T {
     fn get(&self) -> usize { 0 }
 }
 
-impl<T:Odd> MyTrait for T { //~ ERROR E0119
+impl<T:Odd> MyTrait for T {
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
     fn get(&self) -> usize { 0 }
 }
 
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.old.stderr
index 5872f609e90..298ac6d1f21 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.old.stderr
@@ -1,7 +1,7 @@
 error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy`:
-  --> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:15:1
+  --> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:18:1
    |
-LL | impl GoMut for MyThingy { //~ ERROR conflicting implementations
+LL | impl GoMut for MyThingy {
    | ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `go_trait`:
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.re.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.re.stderr
new file mode 100644
index 00000000000..298ac6d1f21
--- /dev/null
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.re.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy`:
+  --> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:18:1
+   |
+LL | impl GoMut for MyThingy {
+   | ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `go_trait`:
+           - impl<G> go_trait::GoMut for G
+             where G: go_trait::Go;
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs
index 4c62741d2e4..b0aaf57e2a9 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs
@@ -1,4 +1,7 @@
 // aux-build:go_trait.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate go_trait;
 
@@ -12,7 +15,9 @@ impl Go for MyThingy {
     fn go(&self, arg: isize) { }
 }
 
-impl GoMut for MyThingy { //~ ERROR conflicting implementations
+impl GoMut for MyThingy {
+//[old]~^ ERROR conflicting implementations
+//[re]~^^ ERROR E0119
     fn go_mut(&mut self, arg: isize) { }
 }
 
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.old.stderr
index 9de354d8cf6..94bbbdbe0a4 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait<MyType>` for type `MyType`:
-  --> $DIR/coherence-blanket-conflicts-with-specific-multidispatch.rs:22:1
+  --> $DIR/coherence-blanket-conflicts-with-specific-multidispatch.rs:26:1
    |
 LL | impl<T> MyTrait<T> for T {
    | ------------------------ first implementation here
 ...
-LL | impl MyTrait<MyType> for MyType { //~ ERROR E0119
+LL | impl MyTrait<MyType> for MyType {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType`
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.re.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.re.stderr
new file mode 100644
index 00000000000..94bbbdbe0a4
--- /dev/null
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `MyTrait<MyType>` for type `MyType`:
+  --> $DIR/coherence-blanket-conflicts-with-specific-multidispatch.rs:26:1
+   |
+LL | impl<T> MyTrait<T> for T {
+   | ------------------------ first implementation here
+...
+LL | impl MyTrait<MyType> for MyType {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs
index 42ce638f137..9192d123514 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs
@@ -1,3 +1,7 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 use std::fmt::Debug;
 use std::default::Default;
 
@@ -19,7 +23,9 @@ struct MyType {
     dummy: usize
 }
 
-impl MyTrait<MyType> for MyType { //~ ERROR E0119
+impl MyTrait<MyType> for MyType {
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
     fn get(&self) -> usize { (*self).clone() }
 }
 
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.old.stderr
index c3f06a952c4..cf799c20cb4 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`:
-  --> $DIR/coherence-blanket-conflicts-with-specific-trait.rs:20:1
+  --> $DIR/coherence-blanket-conflicts-with-specific-trait.rs:24:1
    |
 LL | impl<T:OtherTrait> MyTrait for T {
    | -------------------------------- first implementation here
 ...
-LL | impl MyTrait for MyType { //~ ERROR E0119
+LL | impl MyTrait for MyType {
    | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType`
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.re.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.re.stderr
new file mode 100644
index 00000000000..cf799c20cb4
--- /dev/null
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`:
+  --> $DIR/coherence-blanket-conflicts-with-specific-trait.rs:24:1
+   |
+LL | impl<T:OtherTrait> MyTrait for T {
+   | -------------------------------- first implementation here
+...
+LL | impl MyTrait for MyType {
+   | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs
index 78da8330ba3..51cb10e6185 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs
@@ -1,6 +1,10 @@
 // Test that a blank impl for all T:PartialEq conflicts with an impl for some
 // specific T when T:PartialEq.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 trait OtherTrait {
     fn noop(&self);
 }
@@ -17,7 +21,9 @@ struct MyType {
     dummy: usize
 }
 
-impl MyTrait for MyType { //~ ERROR E0119
+impl MyTrait for MyType {
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
     fn get(&self) -> usize { self.dummy }
 }
 
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.old.stderr
index 0b04c5fd0bd..0807b11a434 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`:
-  --> $DIR/coherence-blanket-conflicts-with-specific.rs:19:1
+  --> $DIR/coherence-blanket-conflicts-with-specific.rs:23:1
    |
 LL | impl<T> MyTrait for T {
    | --------------------- first implementation here
 ...
-LL | impl MyTrait for MyType { //~ ERROR E0119
+LL | impl MyTrait for MyType {
    | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType`
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.re.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.re.stderr
new file mode 100644
index 00000000000..0807b11a434
--- /dev/null
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`:
+  --> $DIR/coherence-blanket-conflicts-with-specific.rs:23:1
+   |
+LL | impl<T> MyTrait for T {
+   | --------------------- first implementation here
+...
+LL | impl MyTrait for MyType {
+   | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs
index db5f83c865a..3ecb613188a 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs
@@ -1,3 +1,7 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 use std::fmt::Debug;
 use std::default::Default;
 
@@ -16,7 +20,9 @@ struct MyType {
     dummy: usize
 }
 
-impl MyTrait for MyType { //~ ERROR E0119
+impl MyTrait for MyType {
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
     fn get(&self) -> usize { self.dummy }
 }
 
diff --git a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.old.stderr
index 0a8bbc4bc50..bb3641f2247 100644
--- a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
+++ b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.old.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`:
-  --> $DIR/coherence-conflicting-negative-trait-impl.rs:10:1
+  --> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1
    |
 LL | unsafe impl<T: MyTrait+'static> Send for TestType<T> {}
    | ---------------------------------------------------- first implementation here
@@ -8,7 +8,7 @@ LL | impl<T: MyTrait> !Send for TestType<T> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
 
 error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<i32>`:
-  --> $DIR/coherence-conflicting-negative-trait-impl.rs:15:1
+  --> $DIR/coherence-conflicting-negative-trait-impl.rs:19:1
    |
 LL | unsafe impl<T:'static> Send for TestType<T> {}
    | ------------------------------------------- first implementation here
diff --git a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.re.stderr b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.re.stderr
new file mode 100644
index 00000000000..bb3641f2247
--- /dev/null
+++ b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.re.stderr
@@ -0,0 +1,21 @@
+error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`:
+  --> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1
+   |
+LL | unsafe impl<T: MyTrait+'static> Send for TestType<T> {}
+   | ---------------------------------------------------- first implementation here
+LL | 
+LL | impl<T: MyTrait> !Send for TestType<T> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
+
+error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<i32>`:
+  --> $DIR/coherence-conflicting-negative-trait-impl.rs:19:1
+   |
+LL | unsafe impl<T:'static> Send for TestType<T> {}
+   | ------------------------------------------- first implementation here
+LL | 
+LL | impl !Send for TestType<i32> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<i32>`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs
index 2165fdee5e0..e05fecb11ed 100644
--- a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs
+++ b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs
@@ -1,3 +1,6 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(optin_builtin_traits)]
 #![feature(overlapping_marker_traits)]
 
@@ -8,11 +11,13 @@ struct TestType<T>(::std::marker::PhantomData<T>);
 unsafe impl<T: MyTrait+'static> Send for TestType<T> {}
 
 impl<T: MyTrait> !Send for TestType<T> {}
-//~^ ERROR conflicting implementations of trait `std::marker::Send`
+//[old]~^ ERROR conflicting implementations of trait `std::marker::Send`
+//[re]~^^ ERROR E0119
 
 unsafe impl<T:'static> Send for TestType<T> {}
 
 impl !Send for TestType<i32> {}
-//~^ ERROR conflicting implementations of trait `std::marker::Send`
+//[old]~^ ERROR conflicting implementations of trait `std::marker::Send`
+//[re]~^^ ERROR E0119
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-cow.a.stderr b/src/test/ui/coherence/coherence-cow.a.stderr
index 6692e1ce174..dd9cfab503f 100644
--- a/src/test/ui/coherence/coherence-cow.a.stderr
+++ b/src/test/ui/coherence/coherence-cow.a.stderr
@@ -1,7 +1,7 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-cow.rs:16:1
+  --> $DIR/coherence-cow.rs:18:1
    |
-LL | impl<T> Remote for Pair<T,Cover<T>> { } //[a]~ ERROR E0210
+LL | impl<T> Remote for Pair<T,Cover<T>> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
    |
    = note: only traits defined in the current crate can be implemented for a type parameter
diff --git a/src/test/ui/coherence/coherence-cow.b.stderr b/src/test/ui/coherence/coherence-cow.b.stderr
index a148b6898fd..fb3ca3fc6b7 100644
--- a/src/test/ui/coherence/coherence-cow.b.stderr
+++ b/src/test/ui/coherence/coherence-cow.b.stderr
@@ -1,7 +1,7 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-cow.rs:19:1
+  --> $DIR/coherence-cow.rs:23:1
    |
-LL | impl<T> Remote for Pair<Cover<T>,T> { } //[b]~ ERROR E0210
+LL | impl<T> Remote for Pair<Cover<T>,T> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
    |
    = note: only traits defined in the current crate can be implemented for a type parameter
diff --git a/src/test/ui/coherence/coherence-cow.c.stderr b/src/test/ui/coherence/coherence-cow.c.stderr
index b575dd64e87..f17823b7f89 100644
--- a/src/test/ui/coherence/coherence-cow.c.stderr
+++ b/src/test/ui/coherence/coherence-cow.c.stderr
@@ -1,5 +1,5 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-cow.rs:22:1
+  --> $DIR/coherence-cow.rs:28:1
    |
 LL | impl<T,U> Remote for Pair<Cover<T>,U> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
diff --git a/src/test/ui/coherence/coherence-cow.re_a.stderr b/src/test/ui/coherence/coherence-cow.re_a.stderr
new file mode 100644
index 00000000000..ed627600b0f
--- /dev/null
+++ b/src/test/ui/coherence/coherence-cow.re_a.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-cow.rs:18:1
+   |
+LL | impl<T> Remote for Pair<T,Cover<T>> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-cow.re_b.stderr b/src/test/ui/coherence/coherence-cow.re_b.stderr
new file mode 100644
index 00000000000..1a85887ae7b
--- /dev/null
+++ b/src/test/ui/coherence/coherence-cow.re_b.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-cow.rs:23:1
+   |
+LL | impl<T> Remote for Pair<Cover<T>,T> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-cow.re_c.stderr b/src/test/ui/coherence/coherence-cow.re_c.stderr
new file mode 100644
index 00000000000..8043b6702b0
--- /dev/null
+++ b/src/test/ui/coherence/coherence-cow.re_c.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-cow.rs:28:1
+   |
+LL | impl<T,U> Remote for Pair<Cover<T>,U> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-cow.rs b/src/test/ui/coherence/coherence-cow.rs
index d72adf7a531..956b0734148 100644
--- a/src/test/ui/coherence/coherence-cow.rs
+++ b/src/test/ui/coherence/coherence-cow.rs
@@ -1,4 +1,6 @@
-// revisions: a b c
+// revisions: a b c re_a re_b re_c
+
+#![cfg_attr(any(re_a, re_b, re_c), feature(re_rebalance_coherence))]
 
 // aux-build:coherence_lib.rs
 
@@ -12,14 +14,19 @@ use lib::{Remote,Pair};
 
 pub struct Cover<T>(T);
 
-#[cfg(a)]
-impl<T> Remote for Pair<T,Cover<T>> { } //[a]~ ERROR E0210
+#[cfg(any(a, re_a))]
+impl<T> Remote for Pair<T,Cover<T>> { }
+//[a]~^ ERROR E0210
+//[re_a]~^^ ERROR E0117
 
-#[cfg(b)]
-impl<T> Remote for Pair<Cover<T>,T> { } //[b]~ ERROR E0210
+#[cfg(any(b, re_b))]
+impl<T> Remote for Pair<Cover<T>,T> { }
+//[b]~^ ERROR E0210
+//[re_b]~^^ ERROR E0117
 
-#[cfg(c)]
+#[cfg(any(c, re_c))]
 impl<T,U> Remote for Pair<Cover<T>,U> { }
 //[c]~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[re_c]~^^ ERROR E0117
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr b/src/test/ui/coherence/coherence-cross-crate-conflict.old.stderr
index 4a73aa357d0..3ba32a52835 100644
--- a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr
+++ b/src/test/ui/coherence/coherence-cross-crate-conflict.old.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`:
-  --> $DIR/coherence-cross-crate-conflict.rs:8:1
+  --> $DIR/coherence-cross-crate-conflict.rs:12:1
    |
 LL | impl<A> Foo for A {
    | ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | impl<A> Foo for A {
            - impl trait_impl_conflict::Foo for isize;
 
 error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct<A>`)
-  --> $DIR/coherence-cross-crate-conflict.rs:8:1
+  --> $DIR/coherence-cross-crate-conflict.rs:12:1
    |
 LL | impl<A> Foo for A {
    | ^^^^^^^^^^^^^^^^^ type parameter `A` must be used as the type parameter for some local type
diff --git a/src/test/ui/coherence/coherence-cross-crate-conflict.re.stderr b/src/test/ui/coherence/coherence-cross-crate-conflict.re.stderr
new file mode 100644
index 00000000000..3ba32a52835
--- /dev/null
+++ b/src/test/ui/coherence/coherence-cross-crate-conflict.re.stderr
@@ -0,0 +1,21 @@
+error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`:
+  --> $DIR/coherence-cross-crate-conflict.rs:12:1
+   |
+LL | impl<A> Foo for A {
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `trait_impl_conflict`:
+           - impl trait_impl_conflict::Foo for isize;
+
+error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct<A>`)
+  --> $DIR/coherence-cross-crate-conflict.rs:12:1
+   |
+LL | impl<A> Foo for A {
+   | ^^^^^^^^^^^^^^^^^ type parameter `A` must be used as the type parameter for some local type
+   |
+   = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to 2 previous errors
+
+Some errors occurred: E0119, E0210.
+For more information about an error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-cross-crate-conflict.rs b/src/test/ui/coherence/coherence-cross-crate-conflict.rs
index 07dd585e8c4..9643ab643df 100644
--- a/src/test/ui/coherence/coherence-cross-crate-conflict.rs
+++ b/src/test/ui/coherence/coherence-cross-crate-conflict.rs
@@ -2,12 +2,18 @@
 // generalizes the one upstream
 
 // aux-build:trait_impl_conflict.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 extern crate trait_impl_conflict;
 use trait_impl_conflict::Foo;
 
 impl<A> Foo for A {
-    //~^ ERROR type parameter `A` must be used as the type parameter for some local type
-    //~| ERROR conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`
+    //[old]~^ ERROR type parameter `A` must be used as the type parameter for some local type
+    //[old]~| ERROR conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`
+    //[re]~^^^ ERROR E0119
+    //[re]~| ERROR E0210
 }
 
 fn main() {
diff --git a/src/test/ui/coherence/coherence-default-trait-impl.stderr b/src/test/ui/coherence/coherence-default-trait-impl.old.stderr
index 6309d60dd96..534f4b0dcdb 100644
--- a/src/test/ui/coherence/coherence-default-trait-impl.stderr
+++ b/src/test/ui/coherence/coherence-default-trait-impl.old.stderr
@@ -1,11 +1,11 @@
 error[E0199]: implementing the trait `MySafeTrait` is not unsafe
-  --> $DIR/coherence-default-trait-impl.rs:7:1
+  --> $DIR/coherence-default-trait-impl.rs:10:1
    |
 LL | unsafe impl MySafeTrait for Foo {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0200]: the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
-  --> $DIR/coherence-default-trait-impl.rs:12:1
+  --> $DIR/coherence-default-trait-impl.rs:16:1
    |
 LL | impl MyUnsafeTrait for Foo {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/coherence/coherence-default-trait-impl.re.stderr b/src/test/ui/coherence/coherence-default-trait-impl.re.stderr
new file mode 100644
index 00000000000..534f4b0dcdb
--- /dev/null
+++ b/src/test/ui/coherence/coherence-default-trait-impl.re.stderr
@@ -0,0 +1,16 @@
+error[E0199]: implementing the trait `MySafeTrait` is not unsafe
+  --> $DIR/coherence-default-trait-impl.rs:10:1
+   |
+LL | unsafe impl MySafeTrait for Foo {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0200]: the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
+  --> $DIR/coherence-default-trait-impl.rs:16:1
+   |
+LL | impl MyUnsafeTrait for Foo {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+Some errors occurred: E0199, E0200.
+For more information about an error, try `rustc --explain E0199`.
diff --git a/src/test/ui/coherence/coherence-default-trait-impl.rs b/src/test/ui/coherence/coherence-default-trait-impl.rs
index df267ca7bd9..606b4947b5f 100644
--- a/src/test/ui/coherence/coherence-default-trait-impl.rs
+++ b/src/test/ui/coherence/coherence-default-trait-impl.rs
@@ -1,3 +1,6 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(optin_builtin_traits)]
 
 auto trait MySafeTrait {}
@@ -5,11 +8,13 @@ auto trait MySafeTrait {}
 struct Foo;
 
 unsafe impl MySafeTrait for Foo {}
-//~^ ERROR implementing the trait `MySafeTrait` is not unsafe
+//[old]~^ ERROR implementing the trait `MySafeTrait` is not unsafe
+//[re]~^^ ERROR E0199
 
 unsafe auto trait MyUnsafeTrait {}
 
 impl MyUnsafeTrait for Foo {}
-//~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
+//[old]~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
+//[re]~^^ ERROR E0200
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-error-suppression.stderr b/src/test/ui/coherence/coherence-error-suppression.old.stderr
index 17a3c627720..b81f7553317 100644
--- a/src/test/ui/coherence/coherence-error-suppression.stderr
+++ b/src/test/ui/coherence/coherence-error-suppression.old.stderr
@@ -1,7 +1,7 @@
 error[E0412]: cannot find type `DoesNotExist` in this scope
-  --> $DIR/coherence-error-suppression.rs:9:14
+  --> $DIR/coherence-error-suppression.rs:13:14
    |
-LL | impl Foo for DoesNotExist {} //~ ERROR cannot find type `DoesNotExist` in this scope
+LL | impl Foo for DoesNotExist {}
    |              ^^^^^^^^^^^^ not found in this scope
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-error-suppression.re.stderr b/src/test/ui/coherence/coherence-error-suppression.re.stderr
new file mode 100644
index 00000000000..b81f7553317
--- /dev/null
+++ b/src/test/ui/coherence/coherence-error-suppression.re.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `DoesNotExist` in this scope
+  --> $DIR/coherence-error-suppression.rs:13:14
+   |
+LL | impl Foo for DoesNotExist {}
+   |              ^^^^^^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/src/test/ui/coherence/coherence-error-suppression.rs b/src/test/ui/coherence/coherence-error-suppression.rs
index f48652e3499..60b88fb80e4 100644
--- a/src/test/ui/coherence/coherence-error-suppression.rs
+++ b/src/test/ui/coherence/coherence-error-suppression.rs
@@ -1,12 +1,18 @@
 // check that error types in coherence do not cause error cascades.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 trait Foo {}
 
 impl Foo for i8 {}
 impl Foo for i16 {}
 impl Foo for i32 {}
 impl Foo for i64 {}
-impl Foo for DoesNotExist {} //~ ERROR cannot find type `DoesNotExist` in this scope
+impl Foo for DoesNotExist {}
+//[old]~^ ERROR cannot find type `DoesNotExist` in this scope
+//[re]~^^ ERROR E0412
 impl Foo for u8 {}
 impl Foo for u16 {}
 impl Foo for u32 {}
diff --git a/src/test/ui/coherence/coherence-fundamental-trait-objects.stderr b/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<Local> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<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`.
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<Local> {}
-//~^ ERROR E0117
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.old.stderr
index a19b00194c3..b48f6bbfb94 100644
--- a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr
+++ b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.old.stderr
@@ -1,7 +1,7 @@
 error[E0038]: the trait `NotObjectSafe` cannot be made into an object
-  --> $DIR/coherence-impl-trait-for-trait-object-safe.rs:7:6
+  --> $DIR/coherence-impl-trait-for-trait-object-safe.rs:11:6
    |
-LL | impl NotObjectSafe for NotObjectSafe { } //~ ERROR E0038
+LL | impl NotObjectSafe for NotObjectSafe { }
    |      ^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object
    |
    = note: method `eq` references the `Self` type in its arguments or return type
diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.re.stderr b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.re.stderr
new file mode 100644
index 00000000000..b48f6bbfb94
--- /dev/null
+++ b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.re.stderr
@@ -0,0 +1,11 @@
+error[E0038]: the trait `NotObjectSafe` cannot be made into an object
+  --> $DIR/coherence-impl-trait-for-trait-object-safe.rs:11:6
+   |
+LL | impl NotObjectSafe for NotObjectSafe { }
+   |      ^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object
+   |
+   = note: method `eq` references the `Self` type in its arguments or return type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs
index e5a7250872f..803e8fc6bca 100644
--- a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs
+++ b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs
@@ -1,9 +1,15 @@
 // Test that we give suitable error messages when the user attempts to
 // impl a trait `Trait` for its own object type.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 // If the trait is not object-safe, we give a more tailored message
 // because we're such schnuckels:
 trait NotObjectSafe { fn eq(&self, other: Self); }
-impl NotObjectSafe for NotObjectSafe { } //~ ERROR E0038
+impl NotObjectSafe for NotObjectSafe { }
+//[old]~^ ERROR E0038
+//[re]~^^ ERROR E0038
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait.stderr b/src/test/ui/coherence/coherence-impl-trait-for-trait.old.stderr
index 05abef145b7..324747603f9 100644
--- a/src/test/ui/coherence/coherence-impl-trait-for-trait.stderr
+++ b/src/test/ui/coherence/coherence-impl-trait-for-trait.old.stderr
@@ -1,19 +1,19 @@
 error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Foo`
-  --> $DIR/coherence-impl-trait-for-trait.rs:9:1
+  --> $DIR/coherence-impl-trait-for-trait.rs:13:1
    |
-LL | impl Foo for Baz { }   //~ ERROR E0371
+LL | impl Foo for Baz { }
    | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Foo`
 
 error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Bar`
-  --> $DIR/coherence-impl-trait-for-trait.rs:10:1
+  --> $DIR/coherence-impl-trait-for-trait.rs:16:1
    |
-LL | impl Bar for Baz { }   //~ ERROR E0371
+LL | impl Bar for Baz { }
    | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Bar`
 
 error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Baz`
-  --> $DIR/coherence-impl-trait-for-trait.rs:11:1
+  --> $DIR/coherence-impl-trait-for-trait.rs:19:1
    |
-LL | impl Baz for Baz { }   //~ ERROR E0371
+LL | impl Baz for Baz { }
    | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Baz`
 
 error: aborting due to 3 previous errors
diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait.re.stderr b/src/test/ui/coherence/coherence-impl-trait-for-trait.re.stderr
new file mode 100644
index 00000000000..324747603f9
--- /dev/null
+++ b/src/test/ui/coherence/coherence-impl-trait-for-trait.re.stderr
@@ -0,0 +1,21 @@
+error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Foo`
+  --> $DIR/coherence-impl-trait-for-trait.rs:13:1
+   |
+LL | impl Foo for Baz { }
+   | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Foo`
+
+error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Bar`
+  --> $DIR/coherence-impl-trait-for-trait.rs:16:1
+   |
+LL | impl Bar for Baz { }
+   | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Bar`
+
+error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Baz`
+  --> $DIR/coherence-impl-trait-for-trait.rs:19:1
+   |
+LL | impl Baz for Baz { }
+   | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Baz`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0371`.
diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait.rs b/src/test/ui/coherence/coherence-impl-trait-for-trait.rs
index e4d59eedcab..dcaf564fdec 100644
--- a/src/test/ui/coherence/coherence-impl-trait-for-trait.rs
+++ b/src/test/ui/coherence/coherence-impl-trait-for-trait.rs
@@ -1,14 +1,24 @@
 // Test that we give suitable error messages when the user attempts to
 // impl a trait `Trait` for its own object type.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 trait Foo { fn dummy(&self) { } }
 trait Bar: Foo { }
 trait Baz: Bar { }
 
 // Supertraits of Baz are not legal:
-impl Foo for Baz { }   //~ ERROR E0371
-impl Bar for Baz { }   //~ ERROR E0371
-impl Baz for Baz { }   //~ ERROR E0371
+impl Foo for Baz { }
+//[old]~^ ERROR E0371
+//[re]~^^ ERROR E0371
+impl Bar for Baz { }
+//[old]~^ ERROR E0371
+//[re]~^^ ERROR E0371
+impl Baz for Baz { }
+//[old]~^ ERROR E0371
+//[re]~^^ ERROR E0371
 
 // But other random traits are:
 trait Other { }
diff --git a/src/test/ui/coherence/coherence-impls-copy.stderr b/src/test/ui/coherence/coherence-impls-copy.old.stderr
index b528bf8fa59..defbbbadd55 100644
--- a/src/test/ui/coherence/coherence-impls-copy.stderr
+++ b/src/test/ui/coherence/coherence-impls-copy.old.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `i32`:
-  --> $DIR/coherence-impls-copy.rs:5:1
+  --> $DIR/coherence-impls-copy.rs:8:1
    |
 LL | impl Copy for i32 {}
    | ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | impl Copy for i32 {}
            - impl std::marker::Copy for i32;
 
 error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync`:
-  --> $DIR/coherence-impls-copy.rs:31:1
+  --> $DIR/coherence-impls-copy.rs:37:1
    |
 LL | impl Copy for &'static NotSync {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -18,7 +18,7 @@ LL | impl Copy for &'static NotSync {}
              where T: ?Sized;
 
 error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
-  --> $DIR/coherence-impls-copy.rs:38:1
+  --> $DIR/coherence-impls-copy.rs:45:1
    |
 LL | impl Copy for &'static [NotSync] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -28,25 +28,25 @@ LL | impl Copy for &'static [NotSync] {}
              where T: ?Sized;
 
 error[E0206]: the trait `Copy` may not be implemented for this type
-  --> $DIR/coherence-impls-copy.rs:23:15
+  --> $DIR/coherence-impls-copy.rs:27:15
    |
 LL | impl Copy for &'static mut MyType {}
    |               ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
 
 error[E0206]: the trait `Copy` may not be implemented for this type
-  --> $DIR/coherence-impls-copy.rs:27:15
+  --> $DIR/coherence-impls-copy.rs:32:15
    |
 LL | impl Copy for (MyType, MyType) {}
    |               ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
 
 error[E0206]: the trait `Copy` may not be implemented for this type
-  --> $DIR/coherence-impls-copy.rs:34:15
+  --> $DIR/coherence-impls-copy.rs:40:15
    |
 LL | impl Copy for [MyType] {}
    |               ^^^^^^^^ type is not a structure or enumeration
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-copy.rs:5:1
+  --> $DIR/coherence-impls-copy.rs:8:1
    |
 LL | impl Copy for i32 {}
    | ^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
@@ -55,7 +55,7 @@ LL | impl Copy for i32 {}
    = note: define and implement a trait or new type instead
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-copy.rs:27:1
+  --> $DIR/coherence-impls-copy.rs:32:1
    |
 LL | impl Copy for (MyType, MyType) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
@@ -64,7 +64,7 @@ LL | impl Copy for (MyType, MyType) {}
    = note: define and implement a trait or new type instead
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-copy.rs:34:1
+  --> $DIR/coherence-impls-copy.rs:40:1
    |
 LL | impl Copy for [MyType] {}
    | ^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
@@ -73,7 +73,7 @@ LL | impl Copy for [MyType] {}
    = note: define and implement a trait or new type instead
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-copy.rs:38:1
+  --> $DIR/coherence-impls-copy.rs:45:1
    |
 LL | impl Copy for &'static [NotSync] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
diff --git a/src/test/ui/coherence/coherence-impls-copy.re.stderr b/src/test/ui/coherence/coherence-impls-copy.re.stderr
new file mode 100644
index 00000000000..defbbbadd55
--- /dev/null
+++ b/src/test/ui/coherence/coherence-impls-copy.re.stderr
@@ -0,0 +1,87 @@
+error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `i32`:
+  --> $DIR/coherence-impls-copy.rs:8:1
+   |
+LL | impl Copy for i32 {}
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `core`:
+           - impl std::marker::Copy for i32;
+
+error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync`:
+  --> $DIR/coherence-impls-copy.rs:37:1
+   |
+LL | impl Copy for &'static NotSync {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `core`:
+           - impl<T> std::marker::Copy for &T
+             where T: ?Sized;
+
+error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
+  --> $DIR/coherence-impls-copy.rs:45:1
+   |
+LL | impl Copy for &'static [NotSync] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `core`:
+           - impl<T> std::marker::Copy for &T
+             where T: ?Sized;
+
+error[E0206]: the trait `Copy` may not be implemented for this type
+  --> $DIR/coherence-impls-copy.rs:27:15
+   |
+LL | impl Copy for &'static mut MyType {}
+   |               ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
+
+error[E0206]: the trait `Copy` may not be implemented for this type
+  --> $DIR/coherence-impls-copy.rs:32:15
+   |
+LL | impl Copy for (MyType, MyType) {}
+   |               ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
+
+error[E0206]: the trait `Copy` may not be implemented for this type
+  --> $DIR/coherence-impls-copy.rs:40:15
+   |
+LL | impl Copy for [MyType] {}
+   |               ^^^^^^^^ type is not a structure or enumeration
+
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-copy.rs:8:1
+   |
+LL | impl Copy for i32 {}
+   | ^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-copy.rs:32:1
+   |
+LL | impl Copy for (MyType, MyType) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-copy.rs:40:1
+   |
+LL | impl Copy for [MyType] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-copy.rs:45:1
+   |
+LL | impl Copy for &'static [NotSync] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 10 previous errors
+
+Some errors occurred: E0117, E0119, E0206.
+For more information about an error, try `rustc --explain E0117`.
diff --git a/src/test/ui/coherence/coherence-impls-copy.rs b/src/test/ui/coherence/coherence-impls-copy.rs
index 5bfdfc8f40a..97133bc33ce 100644
--- a/src/test/ui/coherence/coherence-impls-copy.rs
+++ b/src/test/ui/coherence/coherence-impls-copy.rs
@@ -1,11 +1,15 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(optin_builtin_traits)]
 
 use std::marker::Copy;
 
 impl Copy for i32 {}
-//~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `i32`:
-//~| ERROR only traits defined in the current crate can be implemented for arbitrary types
-
+//[old]~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `i32`:
+//[old]~| ERROR only traits defined in the current crate can be implemented for arbitrary types
+//[re]~^^^ ERROR E0119
+//[re]~| ERROR E0117
 enum TestE {
   A
 }
@@ -21,23 +25,27 @@ impl Clone for TestE { fn clone(&self) -> Self { *self } }
 impl Copy for MyType {}
 
 impl Copy for &'static mut MyType {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
+//[old]~^ ERROR the trait `Copy` may not be implemented for this type
+//[re]~^^ ERROR E0206
 impl Clone for MyType { fn clone(&self) -> Self { *self } }
 
 impl Copy for (MyType, MyType) {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
-//~| ERROR only traits defined in the current crate can be implemented for arbitrary types
-
+//[old]~^ ERROR the trait `Copy` may not be implemented for this type
+//[old]~| ERROR only traits defined in the current crate can be implemented for arbitrary types
+//[re]~^^^ ERROR E0206
+//[re]~| ERROR E0117
 impl Copy for &'static NotSync {}
-//~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `&NotSync`:
-
+//[old]~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `&NotSync`:
+//[re]~^^  ERROR E0119
 impl Copy for [MyType] {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
-//~| ERROR only traits defined in the current crate can be implemented for arbitrary types
-
+//[old]~^ ERROR the trait `Copy` may not be implemented for this type
+//[old]~| ERROR only traits defined in the current crate can be implemented for arbitrary types
+//[re]~^^^ ERROR E0206
+//[re]~| ERROR E0117
 impl Copy for &'static [NotSync] {}
-//~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
-//~| ERROR only traits defined in the current crate can be implemented for arbitrary types
-
+//[old]~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
+//[old]~| ERROR only traits defined in the current crate can be implemented for arbitrary types
+//[re]~^^^ ERROR E0119
+//[re]~| ERROR E0117
 fn main() {
 }
diff --git a/src/test/ui/coherence/coherence-impls-send.stderr b/src/test/ui/coherence/coherence-impls-send.old.stderr
index 02d90eea8fe..ca45c28ec2d 100644
--- a/src/test/ui/coherence/coherence-impls-send.stderr
+++ b/src/test/ui/coherence/coherence-impls-send.old.stderr
@@ -1,5 +1,5 @@
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-send.rs:17:1
+  --> $DIR/coherence-impls-send.rs:20:1
    |
 LL | unsafe impl Send for (MyType, MyType) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
@@ -8,13 +8,13 @@ LL | unsafe impl Send for (MyType, MyType) {}
    = note: define and implement a trait or new type instead
 
 error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `&'static NotSync`
-  --> $DIR/coherence-impls-send.rs:20:1
+  --> $DIR/coherence-impls-send.rs:24:1
    |
 LL | unsafe impl Send for &'static NotSync {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-send.rs:23:1
+  --> $DIR/coherence-impls-send.rs:28:1
    |
 LL | unsafe impl Send for [MyType] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
@@ -23,7 +23,7 @@ LL | unsafe impl Send for [MyType] {}
    = note: define and implement a trait or new type instead
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-send.rs:26:1
+  --> $DIR/coherence-impls-send.rs:32:1
    |
 LL | unsafe impl Send for &'static [NotSync] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
diff --git a/src/test/ui/coherence/coherence-impls-send.re.stderr b/src/test/ui/coherence/coherence-impls-send.re.stderr
new file mode 100644
index 00000000000..ca45c28ec2d
--- /dev/null
+++ b/src/test/ui/coherence/coherence-impls-send.re.stderr
@@ -0,0 +1,37 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-send.rs:20:1
+   |
+LL | unsafe impl Send for (MyType, MyType) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `&'static NotSync`
+  --> $DIR/coherence-impls-send.rs:24:1
+   |
+LL | unsafe impl Send for &'static NotSync {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type
+
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-send.rs:28:1
+   |
+LL | unsafe impl Send for [MyType] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-send.rs:32:1
+   |
+LL | unsafe impl Send for &'static [NotSync] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 4 previous errors
+
+Some errors occurred: E0117, E0321.
+For more information about an error, try `rustc --explain E0117`.
diff --git a/src/test/ui/coherence/coherence-impls-send.rs b/src/test/ui/coherence/coherence-impls-send.rs
index b2a9c5be658..ef13e9caa66 100644
--- a/src/test/ui/coherence/coherence-impls-send.rs
+++ b/src/test/ui/coherence/coherence-impls-send.rs
@@ -1,3 +1,6 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(optin_builtin_traits)]
 #![feature(overlapping_marker_traits)]
 
@@ -15,16 +18,20 @@ impl !Sync for NotSync {}
 unsafe impl Send for TestE {}
 unsafe impl Send for MyType {}
 unsafe impl Send for (MyType, MyType) {}
-//~^ ERROR E0117
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 unsafe impl Send for &'static NotSync {}
-//~^ ERROR E0321
+//[old]~^ ERROR E0321
+//[re]~^^ ERROR E0321
 
 unsafe impl Send for [MyType] {}
-//~^ ERROR E0117
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 unsafe impl Send for &'static [NotSync] {}
-//~^ ERROR E0117
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 fn main() {
 }
diff --git a/src/test/ui/coherence/coherence-impls-sized.stderr b/src/test/ui/coherence/coherence-impls-sized.old.stderr
index fbe08a59f52..c9c7dd0ed66 100644
--- a/src/test/ui/coherence/coherence-impls-sized.stderr
+++ b/src/test/ui/coherence/coherence-impls-sized.old.stderr
@@ -1,61 +1,61 @@
 error[E0322]: explicit impls for the `Sized` trait are not permitted
-  --> $DIR/coherence-impls-sized.rs:14:1
+  --> $DIR/coherence-impls-sized.rs:17:1
    |
-LL | impl Sized for TestE {} //~ ERROR E0322
+LL | impl Sized for TestE {}
    | ^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
 
 error[E0322]: explicit impls for the `Sized` trait are not permitted
-  --> $DIR/coherence-impls-sized.rs:17:1
+  --> $DIR/coherence-impls-sized.rs:22:1
    |
-LL | impl Sized for MyType {} //~ ERROR E0322
+LL | impl Sized for MyType {}
    | ^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
 
 error[E0322]: explicit impls for the `Sized` trait are not permitted
-  --> $DIR/coherence-impls-sized.rs:20:1
+  --> $DIR/coherence-impls-sized.rs:27:1
    |
-LL | impl Sized for (MyType, MyType) {} //~ ERROR E0322
+LL | impl Sized for (MyType, MyType) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
 
 error[E0322]: explicit impls for the `Sized` trait are not permitted
-  --> $DIR/coherence-impls-sized.rs:24:1
+  --> $DIR/coherence-impls-sized.rs:34:1
    |
-LL | impl Sized for &'static NotSync {} //~ ERROR E0322
+LL | impl Sized for &'static NotSync {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
 
 error[E0322]: explicit impls for the `Sized` trait are not permitted
-  --> $DIR/coherence-impls-sized.rs:27:1
+  --> $DIR/coherence-impls-sized.rs:39:1
    |
-LL | impl Sized for [MyType] {} //~ ERROR E0322
+LL | impl Sized for [MyType] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
 
 error[E0322]: explicit impls for the `Sized` trait are not permitted
-  --> $DIR/coherence-impls-sized.rs:31:1
+  --> $DIR/coherence-impls-sized.rs:46:1
    |
-LL | impl Sized for &'static [NotSync] {} //~ ERROR E0322
+LL | impl Sized for &'static [NotSync] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-sized.rs:20:1
+  --> $DIR/coherence-impls-sized.rs:27:1
    |
-LL | impl Sized for (MyType, MyType) {} //~ ERROR E0322
+LL | impl Sized for (MyType, MyType) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-sized.rs:27:1
+  --> $DIR/coherence-impls-sized.rs:39:1
    |
-LL | impl Sized for [MyType] {} //~ ERROR E0322
+LL | impl Sized for [MyType] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-impls-sized.rs:31:1
+  --> $DIR/coherence-impls-sized.rs:46:1
    |
-LL | impl Sized for &'static [NotSync] {} //~ ERROR E0322
+LL | impl Sized for &'static [NotSync] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
diff --git a/src/test/ui/coherence/coherence-impls-sized.re.stderr b/src/test/ui/coherence/coherence-impls-sized.re.stderr
new file mode 100644
index 00000000000..c9c7dd0ed66
--- /dev/null
+++ b/src/test/ui/coherence/coherence-impls-sized.re.stderr
@@ -0,0 +1,67 @@
+error[E0322]: explicit impls for the `Sized` trait are not permitted
+  --> $DIR/coherence-impls-sized.rs:17:1
+   |
+LL | impl Sized for TestE {}
+   | ^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
+
+error[E0322]: explicit impls for the `Sized` trait are not permitted
+  --> $DIR/coherence-impls-sized.rs:22:1
+   |
+LL | impl Sized for MyType {}
+   | ^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
+
+error[E0322]: explicit impls for the `Sized` trait are not permitted
+  --> $DIR/coherence-impls-sized.rs:27:1
+   |
+LL | impl Sized for (MyType, MyType) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
+
+error[E0322]: explicit impls for the `Sized` trait are not permitted
+  --> $DIR/coherence-impls-sized.rs:34:1
+   |
+LL | impl Sized for &'static NotSync {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
+
+error[E0322]: explicit impls for the `Sized` trait are not permitted
+  --> $DIR/coherence-impls-sized.rs:39:1
+   |
+LL | impl Sized for [MyType] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
+
+error[E0322]: explicit impls for the `Sized` trait are not permitted
+  --> $DIR/coherence-impls-sized.rs:46:1
+   |
+LL | impl Sized for &'static [NotSync] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed
+
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-sized.rs:27:1
+   |
+LL | impl Sized for (MyType, MyType) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-sized.rs:39:1
+   |
+LL | impl Sized for [MyType] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-impls-sized.rs:46:1
+   |
+LL | impl Sized for &'static [NotSync] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 9 previous errors
+
+Some errors occurred: E0117, E0322.
+For more information about an error, try `rustc --explain E0117`.
diff --git a/src/test/ui/coherence/coherence-impls-sized.rs b/src/test/ui/coherence/coherence-impls-sized.rs
index 7af1344f95d..84ae2dd291b 100644
--- a/src/test/ui/coherence/coherence-impls-sized.rs
+++ b/src/test/ui/coherence/coherence-impls-sized.rs
@@ -1,3 +1,6 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(optin_builtin_traits)]
 
 use std::marker::Copy;
@@ -11,26 +14,41 @@ struct MyType;
 struct NotSync;
 impl !Sync for NotSync {}
 
-impl Sized for TestE {} //~ ERROR E0322
-//~^ impl of 'Sized' not allowed
-
-impl Sized for MyType {} //~ ERROR E0322
-//~^ impl of 'Sized' not allowed
-
-impl Sized for (MyType, MyType) {} //~ ERROR E0322
-//~^ impl of 'Sized' not allowed
-//~| ERROR E0117
-
-impl Sized for &'static NotSync {} //~ ERROR E0322
-//~^ impl of 'Sized' not allowed
-
-impl Sized for [MyType] {} //~ ERROR E0322
-//~^ impl of 'Sized' not allowed
-//~| ERROR E0117
-
-impl Sized for &'static [NotSync] {} //~ ERROR E0322
-//~^ impl of 'Sized' not allowed
-//~| ERROR E0117
+impl Sized for TestE {}
+//[old]~^ ERROR E0322
+//[old]~| impl of 'Sized' not allowed
+//[re]~^^^ ERROR E0322
+
+impl Sized for MyType {}
+//[old]~^ ERROR E0322
+//[old]~| impl of 'Sized' not allowed
+//[re]~^^^ ERROR E0322
+
+impl Sized for (MyType, MyType) {}
+//[old]~^ ERROR E0322
+//[old]~| impl of 'Sized' not allowed
+//[old]~| ERROR E0117
+//[re]~^^^^ ERROR E0322
+//[re]~| ERROR E0117
+
+impl Sized for &'static NotSync {}
+//[old]~^ ERROR E0322
+//[old]~| impl of 'Sized' not allowed
+//[re]~^^^ ERROR E0322
+
+impl Sized for [MyType] {}
+//[old]~^ ERROR E0322
+//[old]~| impl of 'Sized' not allowed
+//[old]~| ERROR E0117
+//[re]~^^^^ ERROR E0322
+//[re]~| ERROR E0117
+
+impl Sized for &'static [NotSync] {}
+//[old]~^ ERROR E0322
+//[old]~| impl of 'Sized' not allowed
+//[old]~| ERROR E0117
+//[re]~^^^^ ERROR E0322
+//[re]~| ERROR E0117
 
 fn main() {
 }
diff --git a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.old.stderr
index 0b9f03db5c6..a2fa49acd2c 100644
--- a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
+++ b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.old.stderr
@@ -1,12 +1,12 @@
 error[E0391]: cycle detected when processing `Trait`
-  --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1
+  --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:12:1
    |
 LL | trait Trait<T> { type Assoc; }
    | ^^^^^^^^^^^^^^
    |
    = note: ...which again requires processing `Trait`, completing the cycle
 note: cycle used when coherence checking all impls of trait `Trait`
-  --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1
+  --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:12:1
    |
 LL | trait Trait<T> { type Assoc; }
    | ^^^^^^^^^^^^^^
diff --git a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.re.stderr b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.re.stderr
new file mode 100644
index 00000000000..a2fa49acd2c
--- /dev/null
+++ b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.re.stderr
@@ -0,0 +1,16 @@
+error[E0391]: cycle detected when processing `Trait`
+  --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:12:1
+   |
+LL | trait Trait<T> { type Assoc; }
+   | ^^^^^^^^^^^^^^
+   |
+   = note: ...which again requires processing `Trait`, completing the cycle
+note: cycle used when coherence checking all impls of trait `Trait`
+  --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:12:1
+   |
+LL | trait Trait<T> { type Assoc; }
+   | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs
index 92bfeb1bf8a..5a6b8fb7316 100644
--- a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs
+++ b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs
@@ -4,10 +4,14 @@
 //
 // No we expect to run into a more user-friendly cycle error instead.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(specialization)]
 
 trait Trait<T> { type Assoc; }
-//~^ cycle detected
+//[old]~^ cycle detected
+//[re]~^^ ERROR E0391
 
 impl<T> Trait<T> for Vec<T> {
     type Assoc = ();
diff --git a/src/test/ui/coherence/coherence-lone-type-parameter.stderr b/src/test/ui/coherence/coherence-lone-type-parameter.old.stderr
index 68e2dae095f..ac77241e9e7 100644
--- a/src/test/ui/coherence/coherence-lone-type-parameter.stderr
+++ b/src/test/ui/coherence/coherence-lone-type-parameter.old.stderr
@@ -1,5 +1,5 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-lone-type-parameter.rs:6:1
+  --> $DIR/coherence-lone-type-parameter.rs:9:1
    |
 LL | impl<T> Remote for T { }
    | ^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
diff --git a/src/test/ui/coherence/coherence-lone-type-parameter.re.stderr b/src/test/ui/coherence/coherence-lone-type-parameter.re.stderr
new file mode 100644
index 00000000000..ac77241e9e7
--- /dev/null
+++ b/src/test/ui/coherence/coherence-lone-type-parameter.re.stderr
@@ -0,0 +1,11 @@
+error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
+  --> $DIR/coherence-lone-type-parameter.rs:9:1
+   |
+LL | impl<T> Remote for T { }
+   | ^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
+   |
+   = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0210`.
diff --git a/src/test/ui/coherence/coherence-lone-type-parameter.rs b/src/test/ui/coherence/coherence-lone-type-parameter.rs
index 7d52945b9dd..63b38bf1cc1 100644
--- a/src/test/ui/coherence/coherence-lone-type-parameter.rs
+++ b/src/test/ui/coherence/coherence-lone-type-parameter.rs
@@ -1,9 +1,14 @@
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate coherence_lib as lib;
 use lib::Remote;
 
 impl<T> Remote for T { }
-//~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[old]~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[re]~^^ ERROR E0210
+
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-negative-impls-safe.stderr b/src/test/ui/coherence/coherence-negative-impls-safe.old.stderr
index c47c9d25e36..7ed47dca497 100644
--- a/src/test/ui/coherence/coherence-negative-impls-safe.stderr
+++ b/src/test/ui/coherence/coherence-negative-impls-safe.old.stderr
@@ -1,5 +1,5 @@
 error[E0198]: negative impls cannot be unsafe
-  --> $DIR/coherence-negative-impls-safe.rs:7:1
+  --> $DIR/coherence-negative-impls-safe.rs:10:1
    |
 LL | unsafe impl !Send for TestType {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/coherence/coherence-negative-impls-safe.re.stderr b/src/test/ui/coherence/coherence-negative-impls-safe.re.stderr
new file mode 100644
index 00000000000..7ed47dca497
--- /dev/null
+++ b/src/test/ui/coherence/coherence-negative-impls-safe.re.stderr
@@ -0,0 +1,9 @@
+error[E0198]: negative impls cannot be unsafe
+  --> $DIR/coherence-negative-impls-safe.rs:10:1
+   |
+LL | unsafe impl !Send for TestType {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0198`.
diff --git a/src/test/ui/coherence/coherence-negative-impls-safe.rs b/src/test/ui/coherence/coherence-negative-impls-safe.rs
index 050e47fd6a8..b6658d5bfa4 100644
--- a/src/test/ui/coherence/coherence-negative-impls-safe.rs
+++ b/src/test/ui/coherence/coherence-negative-impls-safe.rs
@@ -1,3 +1,6 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(optin_builtin_traits)]
 
 use std::marker::Send;
@@ -5,6 +8,7 @@ use std::marker::Send;
 struct TestType;
 
 unsafe impl !Send for TestType {}
-//~^ ERROR negative impls cannot be unsafe
+//[old]~^ ERROR negative impls cannot be unsafe
+//[re]~^^ ERROR E0198
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.old.stderr
index f1cc0088cf1..81465e71856 100644
--- a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr
+++ b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.old.stderr
@@ -1,9 +1,9 @@
 error[E0119]: conflicting implementations of trait `MyTrait`:
-  --> $DIR/coherence-no-direct-lifetime-dispatch.rs:6:1
+  --> $DIR/coherence-no-direct-lifetime-dispatch.rs:10:1
    |
 LL | impl<T> MyTrait for T {}
    | --------------------- first implementation here
-LL | impl<T: 'static> MyTrait for T {} //~ ERROR E0119
+LL | impl<T: 'static> MyTrait for T {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.re.stderr b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.re.stderr
new file mode 100644
index 00000000000..81465e71856
--- /dev/null
+++ b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.re.stderr
@@ -0,0 +1,11 @@
+error[E0119]: conflicting implementations of trait `MyTrait`:
+  --> $DIR/coherence-no-direct-lifetime-dispatch.rs:10:1
+   |
+LL | impl<T> MyTrait for T {}
+   | --------------------- first implementation here
+LL | impl<T: 'static> MyTrait for T {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs
index 0a648c28ec6..9717f1ed051 100644
--- a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs
+++ b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs
@@ -1,8 +1,14 @@
 // Test that you cannot *directly* dispatch on lifetime requirements
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 trait MyTrait { fn foo() {} }
 
 impl<T> MyTrait for T {}
-impl<T: 'static> MyTrait for T {} //~ ERROR E0119
+impl<T: 'static> MyTrait for T {}
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-orphan.stderr b/src/test/ui/coherence/coherence-orphan.old.stderr
index 1b32faf970c..da5de461bf4 100644
--- a/src/test/ui/coherence/coherence-orphan.stderr
+++ b/src/test/ui/coherence/coherence-orphan.old.stderr
@@ -1,5 +1,5 @@
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-orphan.rs:11:1
+  --> $DIR/coherence-orphan.rs:13:1
    |
 LL | impl TheTrait<usize> for isize { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
@@ -8,7 +8,7 @@ LL | impl TheTrait<usize> for isize { }
    = note: define and implement a trait or new type instead
 
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-orphan.rs:18:1
+  --> $DIR/coherence-orphan.rs:21:1
    |
 LL | impl !Send for Vec<isize> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
diff --git a/src/test/ui/coherence/coherence-orphan.re.stderr b/src/test/ui/coherence/coherence-orphan.re.stderr
new file mode 100644
index 00000000000..da5de461bf4
--- /dev/null
+++ b/src/test/ui/coherence/coherence-orphan.re.stderr
@@ -0,0 +1,21 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-orphan.rs:13:1
+   |
+LL | impl TheTrait<usize> for isize { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-orphan.rs:21:1
+   |
+LL | impl !Send for Vec<isize> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ 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 2 previous errors
+
+For more information about this error, try `rustc --explain E0117`.
diff --git a/src/test/ui/coherence/coherence-orphan.rs b/src/test/ui/coherence/coherence-orphan.rs
index ace3ebcc9e8..18f50e46021 100644
--- a/src/test/ui/coherence/coherence-orphan.rs
+++ b/src/test/ui/coherence/coherence-orphan.rs
@@ -1,5 +1,7 @@
 // aux-build:coherence_orphan_lib.rs
+// revisions: old re
 
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(optin_builtin_traits)]
 
 extern crate coherence_orphan_lib as lib;
@@ -9,13 +11,15 @@ use lib::TheTrait;
 struct TheType;
 
 impl TheTrait<usize> for isize { }
-//~^ ERROR E0117
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 impl TheTrait<TheType> for isize { }
 
 impl TheTrait<isize> for TheType { }
 
 impl !Send for Vec<isize> { }
-//~^ ERROR E0117
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.old.stderr
index 2bb3031edce..c7f85b0b590 100644
--- a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr
+++ b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `From<(_,)>` for type `(_,)`:
-  --> $DIR/coherence-overlap-all-t-and-tuple.rs:16:1
+  --> $DIR/coherence-overlap-all-t-and-tuple.rs:20:1
    |
 LL | impl <T> From<T> for T {
    | ---------------------- first implementation here
 ...
-LL | impl <T11, U11> From<(U11,)> for (T11,) { //~ ERROR E0119
+LL | impl <T11, U11> From<(U11,)> for (T11,) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_,)`
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.re.stderr b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.re.stderr
new file mode 100644
index 00000000000..c7f85b0b590
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `From<(_,)>` for type `(_,)`:
+  --> $DIR/coherence-overlap-all-t-and-tuple.rs:20:1
+   |
+LL | impl <T> From<T> for T {
+   | ---------------------- first implementation here
+...
+LL | impl <T11, U11> From<(U11,)> for (T11,) {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_,)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs
index 19aad6927ba..bf3ce89f70b 100644
--- a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs
+++ b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs
@@ -6,6 +6,10 @@
 //
 // Seems pretty basic, but then there was issue #24241. :)
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 trait From<U> {
     fn foo() {}
 }
@@ -13,7 +17,9 @@ trait From<U> {
 impl <T> From<T> for T {
 }
 
-impl <T11, U11> From<(U11,)> for (T11,) { //~ ERROR E0119
+impl <T11, U11> From<(U11,)> for (T11,) {
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 }
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr b/src/test/ui/coherence/coherence-overlap-downstream-inherent.old.stderr
index 9a060edb5b1..dcfc017f1b0 100644
--- a/src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr
+++ b/src/test/ui/coherence/coherence-overlap-downstream-inherent.old.stderr
@@ -1,18 +1,18 @@
 error[E0592]: duplicate definitions with name `dummy`
-  --> $DIR/coherence-overlap-downstream-inherent.rs:7:26
+  --> $DIR/coherence-overlap-downstream-inherent.rs:11:26
    |
 LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
    |                          ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
-LL | //~^ ERROR E0592
+...
 LL | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
    |                          ------------------- other definition for `dummy`
 
 error[E0592]: duplicate definitions with name `f`
-  --> $DIR/coherence-overlap-downstream-inherent.rs:13:38
+  --> $DIR/coherence-overlap-downstream-inherent.rs:18:38
    |
 LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
    |                                      ^^^^^^^^^^^^^^ duplicate definitions for `f`
-LL | //~^ ERROR E0592
+...
 LL | impl<X> A<i32, X> { fn f(&self) {} }
    |                     -------------- other definition for `f`
    |
diff --git a/src/test/ui/coherence/coherence-overlap-downstream-inherent.re.stderr b/src/test/ui/coherence/coherence-overlap-downstream-inherent.re.stderr
new file mode 100644
index 00000000000..dcfc017f1b0
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-downstream-inherent.re.stderr
@@ -0,0 +1,23 @@
+error[E0592]: duplicate definitions with name `dummy`
+  --> $DIR/coherence-overlap-downstream-inherent.rs:11:26
+   |
+LL | impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
+   |                          ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
+...
+LL | impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
+   |                          ------------------- other definition for `dummy`
+
+error[E0592]: duplicate definitions with name `f`
+  --> $DIR/coherence-overlap-downstream-inherent.rs:18:38
+   |
+LL | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
+   |                                      ^^^^^^^^^^^^^^ duplicate definitions for `f`
+...
+LL | impl<X> A<i32, X> { fn f(&self) {} }
+   |                     -------------- other definition for `f`
+   |
+   = note: downstream crates may implement trait `Bar<_>` for type `i32`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0592`.
diff --git a/src/test/ui/coherence/coherence-overlap-downstream-inherent.rs b/src/test/ui/coherence/coherence-overlap-downstream-inherent.rs
index 5dea33e330b..ad54d247f91 100644
--- a/src/test/ui/coherence/coherence-overlap-downstream-inherent.rs
+++ b/src/test/ui/coherence/coherence-overlap-downstream-inherent.rs
@@ -1,17 +1,23 @@
 // Tests that we consider `T: Sugar + Fruit` to be ambiguous, even
 // though no impls are found.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 struct Sweet<X>(X);
 pub trait Sugar {}
 pub trait Fruit {}
 impl<T:Sugar> Sweet<T> { fn dummy(&self) { } }
-//~^ ERROR E0592
+//[old]~^ ERROR E0592
+//[re]~^^ ERROR E0592
 impl<T:Fruit> Sweet<T> { fn dummy(&self) { } }
 
 trait Bar<X> {}
 struct A<T, X>(T, X);
 impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
-//~^ ERROR E0592
+//[old]~^ ERROR E0592
+//[re]~^^ ERROR E0592
 impl<X> A<i32, X> { fn f(&self) {} }
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-overlap-downstream.stderr b/src/test/ui/coherence/coherence-overlap-downstream.old.stderr
index 6fb398562d6..b4847c03d41 100644
--- a/src/test/ui/coherence/coherence-overlap-downstream.stderr
+++ b/src/test/ui/coherence/coherence-overlap-downstream.old.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `Sweet`:
-  --> $DIR/coherence-overlap-downstream.rs:8:1
+  --> $DIR/coherence-overlap-downstream.rs:12:1
    |
 LL | impl<T:Sugar> Sweet for T { }
    | ------------------------- first implementation here
@@ -7,7 +7,7 @@ LL | impl<T:Fruit> Sweet for T { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
-  --> $DIR/coherence-overlap-downstream.rs:14:1
+  --> $DIR/coherence-overlap-downstream.rs:19:1
    |
 LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
    | --------------------------------------- first implementation here
diff --git a/src/test/ui/coherence/coherence-overlap-downstream.re.stderr b/src/test/ui/coherence/coherence-overlap-downstream.re.stderr
new file mode 100644
index 00000000000..b4847c03d41
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-downstream.re.stderr
@@ -0,0 +1,21 @@
+error[E0119]: conflicting implementations of trait `Sweet`:
+  --> $DIR/coherence-overlap-downstream.rs:12:1
+   |
+LL | impl<T:Sugar> Sweet for T { }
+   | ------------------------- first implementation here
+LL | impl<T:Fruit> Sweet for T { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+
+error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
+  --> $DIR/coherence-overlap-downstream.rs:19:1
+   |
+LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
+   | --------------------------------------- first implementation here
+LL | impl<X> Foo<X> for i32 {}
+   | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
+   |
+   = note: downstream crates may implement trait `Bar<_>` for type `i32`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-overlap-downstream.rs b/src/test/ui/coherence/coherence-overlap-downstream.rs
index 738ec0e3d45..c6ced7b80fd 100644
--- a/src/test/ui/coherence/coherence-overlap-downstream.rs
+++ b/src/test/ui/coherence/coherence-overlap-downstream.rs
@@ -1,17 +1,23 @@
 // Tests that we consider `T: Sugar + Fruit` to be ambiguous, even
 // though no impls are found.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 pub trait Sugar {}
 pub trait Fruit {}
 pub trait Sweet {}
 impl<T:Sugar> Sweet for T { }
 impl<T:Fruit> Sweet for T { }
-//~^ ERROR E0119
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 pub trait Foo<X> {}
 pub trait Bar<X> {}
 impl<X, T> Foo<X> for T where T: Bar<X> {}
 impl<X> Foo<X> for i32 {}
-//~^ ERROR E0119
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.old.stderr
index 6e5d116bce2..6fd93077540 100644
--- a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr
+++ b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.old.stderr
@@ -1,9 +1,9 @@
 error[E0592]: duplicate definitions with name `dummy`
-  --> $DIR/coherence-overlap-issue-23516-inherent.rs:9:25
+  --> $DIR/coherence-overlap-issue-23516-inherent.rs:13:25
    |
 LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
    |                         ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
-LL | //~^ ERROR E0592
+...
 LL | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
    |                              ------------------- other definition for `dummy`
    |
diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.re.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.re.stderr
new file mode 100644
index 00000000000..6fd93077540
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.re.stderr
@@ -0,0 +1,14 @@
+error[E0592]: duplicate definitions with name `dummy`
+  --> $DIR/coherence-overlap-issue-23516-inherent.rs:13:25
+   |
+LL | impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
+   |                         ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
+...
+LL | impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
+   |                              ------------------- other definition for `dummy`
+   |
+   = note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0592`.
diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs
index a272e620fca..969366e29cc 100644
--- a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs
+++ b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs
@@ -2,12 +2,17 @@
 // though we see no impl of `Sugar` for `Box`. Therefore, an overlap
 // error is reported for the following pair of impls (#23516).
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 pub trait Sugar {}
 
 struct Cake<X>(X);
 
 impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
-//~^ ERROR E0592
+//[old]~^ ERROR E0592
+//[re]~^^ ERROR E0592
 impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516.old.stderr
index fe4c5cf3490..d17d67adf0e 100644
--- a/src/test/ui/coherence/coherence-overlap-issue-23516.stderr
+++ b/src/test/ui/coherence/coherence-overlap-issue-23516.old.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
-  --> $DIR/coherence-overlap-issue-23516.rs:8:1
+  --> $DIR/coherence-overlap-issue-23516.rs:12:1
    |
 LL | impl<T:Sugar> Sweet for T { }
    | ------------------------- first implementation here
diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516.re.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516.re.stderr
new file mode 100644
index 00000000000..d17d67adf0e
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-issue-23516.re.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
+  --> $DIR/coherence-overlap-issue-23516.rs:12:1
+   |
+LL | impl<T:Sugar> Sweet for T { }
+   | ------------------------- first implementation here
+LL | impl<U:Sugar> Sweet for Box<U> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
+   |
+   = note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516.rs b/src/test/ui/coherence/coherence-overlap-issue-23516.rs
index 63e42e8f412..e3c15e149f8 100644
--- a/src/test/ui/coherence/coherence-overlap-issue-23516.rs
+++ b/src/test/ui/coherence/coherence-overlap-issue-23516.rs
@@ -2,10 +2,15 @@
 // though we see no impl of `Sugar` for `Box`. Therefore, an overlap
 // error is reported for the following pair of impls (#23516).
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 pub trait Sugar { fn dummy(&self) { } }
 pub trait Sweet { fn dummy(&self) { } }
 impl<T:Sugar> Sweet for T { }
 impl<U:Sugar> Sweet for Box<U> { }
-//~^ ERROR E0119
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-overlap-messages.stderr b/src/test/ui/coherence/coherence-overlap-messages.old.stderr
index f78482fc597..429e67573b5 100644
--- a/src/test/ui/coherence/coherence-overlap-messages.stderr
+++ b/src/test/ui/coherence/coherence-overlap-messages.old.stderr
@@ -1,42 +1,42 @@
 error[E0119]: conflicting implementations of trait `Foo`:
-  --> $DIR/coherence-overlap-messages.rs:4:1
+  --> $DIR/coherence-overlap-messages.rs:8:1
    |
 LL | impl<T> Foo for T {}
    | ----------------- first implementation here
-LL | impl<U> Foo for U {} //~ ERROR conflicting implementations of trait `Foo`:
+LL | impl<U> Foo for U {}
    | ^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`:
-  --> $DIR/coherence-overlap-messages.rs:9:1
+  --> $DIR/coherence-overlap-messages.rs:16:1
    |
 LL | impl<T> Bar for (T, u8) {}
    | ----------------------- first implementation here
-LL | impl<T> Bar for (u8, T) {} //~ ERROR conflicting implementations of trait `Bar` for type `(u8, u8)`:
+LL | impl<T> Bar for (u8, T) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)`
 
 error[E0119]: conflicting implementations of trait `Baz<u8>` for type `u8`:
-  --> $DIR/coherence-overlap-messages.rs:14:1
+  --> $DIR/coherence-overlap-messages.rs:23:1
    |
 LL | impl<T> Baz<u8> for T {}
    | --------------------- first implementation here
-LL | impl<T> Baz<T> for u8 {} //~ ERROR conflicting implementations of trait `Baz<u8>` for type `u8`:
+LL | impl<T> Baz<T> for u8 {}
    | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8`
 
 error[E0119]: conflicting implementations of trait `Quux<_, _>`:
-  --> $DIR/coherence-overlap-messages.rs:19:1
+  --> $DIR/coherence-overlap-messages.rs:30:1
    |
 LL | impl<T, U, V> Quux<U, V> for T {}
    | ------------------------------ first implementation here
-LL | impl<T, U> Quux<U, U> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
+LL | impl<T, U> Quux<U, U> for T {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error[E0119]: conflicting implementations of trait `Quux<_, _>`:
-  --> $DIR/coherence-overlap-messages.rs:20:1
+  --> $DIR/coherence-overlap-messages.rs:33:1
    |
 LL | impl<T, U, V> Quux<U, V> for T {}
    | ------------------------------ first implementation here
-LL | impl<T, U> Quux<U, U> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
-LL | impl<T, V> Quux<T, V> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
+...
+LL | impl<T, V> Quux<T, V> for T {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
 error: aborting due to 5 previous errors
diff --git a/src/test/ui/coherence/coherence-overlap-messages.re.stderr b/src/test/ui/coherence/coherence-overlap-messages.re.stderr
new file mode 100644
index 00000000000..429e67573b5
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-messages.re.stderr
@@ -0,0 +1,44 @@
+error[E0119]: conflicting implementations of trait `Foo`:
+  --> $DIR/coherence-overlap-messages.rs:8:1
+   |
+LL | impl<T> Foo for T {}
+   | ----------------- first implementation here
+LL | impl<U> Foo for U {}
+   | ^^^^^^^^^^^^^^^^^ conflicting implementation
+
+error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`:
+  --> $DIR/coherence-overlap-messages.rs:16:1
+   |
+LL | impl<T> Bar for (T, u8) {}
+   | ----------------------- first implementation here
+LL | impl<T> Bar for (u8, T) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)`
+
+error[E0119]: conflicting implementations of trait `Baz<u8>` for type `u8`:
+  --> $DIR/coherence-overlap-messages.rs:23:1
+   |
+LL | impl<T> Baz<u8> for T {}
+   | --------------------- first implementation here
+LL | impl<T> Baz<T> for u8 {}
+   | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8`
+
+error[E0119]: conflicting implementations of trait `Quux<_, _>`:
+  --> $DIR/coherence-overlap-messages.rs:30:1
+   |
+LL | impl<T, U, V> Quux<U, V> for T {}
+   | ------------------------------ first implementation here
+LL | impl<T, U> Quux<U, U> for T {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+
+error[E0119]: conflicting implementations of trait `Quux<_, _>`:
+  --> $DIR/coherence-overlap-messages.rs:33:1
+   |
+LL | impl<T, U, V> Quux<U, V> for T {}
+   | ------------------------------ first implementation here
+...
+LL | impl<T, V> Quux<T, V> for T {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-overlap-messages.rs b/src/test/ui/coherence/coherence-overlap-messages.rs
index e7ce40dc43a..e0e2e672e98 100644
--- a/src/test/ui/coherence/coherence-overlap-messages.rs
+++ b/src/test/ui/coherence/coherence-overlap-messages.rs
@@ -1,22 +1,37 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 trait Foo { fn foo() {} }
 
 impl<T> Foo for T {}
-impl<U> Foo for U {} //~ ERROR conflicting implementations of trait `Foo`:
+impl<U> Foo for U {}
+//[old]~^ ERROR conflicting implementations of trait `Foo`:
+//[re]~^^ ERROR E0119
+
 
 trait Bar { fn bar() {} }
 
 impl<T> Bar for (T, u8) {}
-impl<T> Bar for (u8, T) {} //~ ERROR conflicting implementations of trait `Bar` for type `(u8, u8)`:
+impl<T> Bar for (u8, T) {}
+//[old]~^ ERROR conflicting implementations of trait `Bar` for type `(u8, u8)`:
+//[re]~^^ ERROR E0119
 
 trait Baz<T> { fn baz() {} }
 
 impl<T> Baz<u8> for T {}
-impl<T> Baz<T> for u8 {} //~ ERROR conflicting implementations of trait `Baz<u8>` for type `u8`:
+impl<T> Baz<T> for u8 {}
+//[old]~^ ERROR conflicting implementations of trait `Baz<u8>` for type `u8`:
+//[re]~^^ ERROR E0119
 
 trait Quux<U, V> { fn quux() {} }
 
 impl<T, U, V> Quux<U, V> for T {}
-impl<T, U> Quux<U, U> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
-impl<T, V> Quux<T, V> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`:
+impl<T, U> Quux<U, U> for T {}
+//[old]~^ ERROR conflicting implementations of trait `Quux<_, _>`:
+//[re]~^^ ERROR E0119
+impl<T, V> Quux<T, V> for T {}
+//[old]~^ ERROR conflicting implementations of trait `Quux<_, _>`:
+//[re]~^^ ERROR E0119
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr b/src/test/ui/coherence/coherence-overlap-upstream-inherent.old.stderr
index 195b7dba74d..928b65e0039 100644
--- a/src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr
+++ b/src/test/ui/coherence/coherence-overlap-upstream-inherent.old.stderr
@@ -1,9 +1,9 @@
 error[E0592]: duplicate definitions with name `dummy`
-  --> $DIR/coherence-overlap-upstream-inherent.rs:11:32
+  --> $DIR/coherence-overlap-upstream-inherent.rs:15:32
    |
 LL | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
    |                                ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
-LL | //~^ ERROR E0592
+...
 LL | impl A<i16> { fn dummy(&self) { } }
    |               ------------------- other definition for `dummy`
    |
diff --git a/src/test/ui/coherence/coherence-overlap-upstream-inherent.re.stderr b/src/test/ui/coherence/coherence-overlap-upstream-inherent.re.stderr
new file mode 100644
index 00000000000..928b65e0039
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-upstream-inherent.re.stderr
@@ -0,0 +1,14 @@
+error[E0592]: duplicate definitions with name `dummy`
+  --> $DIR/coherence-overlap-upstream-inherent.rs:15:32
+   |
+LL | impl<T> A<T> where T: Remote { fn dummy(&self) { } }
+   |                                ^^^^^^^^^^^^^^^^^^^ duplicate definitions for `dummy`
+...
+LL | impl A<i16> { fn dummy(&self) { } }
+   |               ------------------- other definition for `dummy`
+   |
+   = note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0592`.
diff --git a/src/test/ui/coherence/coherence-overlap-upstream-inherent.rs b/src/test/ui/coherence/coherence-overlap-upstream-inherent.rs
index c5d59c6655a..92b619af076 100644
--- a/src/test/ui/coherence/coherence-overlap-upstream-inherent.rs
+++ b/src/test/ui/coherence/coherence-overlap-upstream-inherent.rs
@@ -2,6 +2,10 @@
 // though the upstream crate doesn't implement it for now.
 
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 
 extern crate coherence_lib;
 
@@ -9,7 +13,8 @@ use coherence_lib::Remote;
 
 struct A<X>(X);
 impl<T> A<T> where T: Remote { fn dummy(&self) { } }
-//~^ ERROR E0592
+//[old]~^ ERROR E0592
+//[re]~^^ ERROR E0592
 impl A<i16> { fn dummy(&self) { } }
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-overlap-upstream.stderr b/src/test/ui/coherence/coherence-overlap-upstream.old.stderr
index 4095949df13..6c3484c2d8c 100644
--- a/src/test/ui/coherence/coherence-overlap-upstream.stderr
+++ b/src/test/ui/coherence/coherence-overlap-upstream.old.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `Foo` for type `i16`:
-  --> $DIR/coherence-overlap-upstream.rs:12:1
+  --> $DIR/coherence-overlap-upstream.rs:16:1
    |
 LL | impl<T> Foo for T where T: Remote {}
    | --------------------------------- first implementation here
diff --git a/src/test/ui/coherence/coherence-overlap-upstream.re.stderr b/src/test/ui/coherence/coherence-overlap-upstream.re.stderr
new file mode 100644
index 00000000000..6c3484c2d8c
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-upstream.re.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `Foo` for type `i16`:
+  --> $DIR/coherence-overlap-upstream.rs:16:1
+   |
+LL | impl<T> Foo for T where T: Remote {}
+   | --------------------------------- first implementation here
+LL | impl Foo for i16 {}
+   | ^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
+   |
+   = note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-overlap-upstream.rs b/src/test/ui/coherence/coherence-overlap-upstream.rs
index 47dd7a78fe8..62f675003f9 100644
--- a/src/test/ui/coherence/coherence-overlap-upstream.rs
+++ b/src/test/ui/coherence/coherence-overlap-upstream.rs
@@ -2,6 +2,10 @@
 // though the upstream crate doesn't implement it for now.
 
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 
 extern crate coherence_lib;
 
@@ -10,6 +14,7 @@ use coherence_lib::Remote;
 trait Foo {}
 impl<T> Foo for T where T: Remote {}
 impl Foo for i16 {}
-//~^ ERROR E0119
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-overlapping-pairs.stderr b/src/test/ui/coherence/coherence-overlapping-pairs.old.stderr
index 19f283e89d1..b275af9668d 100644
--- a/src/test/ui/coherence/coherence-overlapping-pairs.stderr
+++ b/src/test/ui/coherence/coherence-overlapping-pairs.old.stderr
@@ -1,5 +1,5 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-overlapping-pairs.rs:8:1
+  --> $DIR/coherence-overlapping-pairs.rs:11:1
    |
 LL | impl<T> Remote for lib::Pair<T,Foo> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
diff --git a/src/test/ui/coherence/coherence-overlapping-pairs.re.stderr b/src/test/ui/coherence/coherence-overlapping-pairs.re.stderr
new file mode 100644
index 00000000000..0f2ec6f4ce0
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlapping-pairs.re.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-overlapping-pairs.rs:11:1
+   |
+LL | impl<T> Remote for lib::Pair<T,Foo> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-overlapping-pairs.rs b/src/test/ui/coherence/coherence-overlapping-pairs.rs
index 11b74ebacc5..de31a083940 100644
--- a/src/test/ui/coherence/coherence-overlapping-pairs.rs
+++ b/src/test/ui/coherence/coherence-overlapping-pairs.rs
@@ -1,4 +1,7 @@
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate coherence_lib as lib;
 use lib::Remote;
@@ -6,6 +9,7 @@ use lib::Remote;
 struct Foo;
 
 impl<T> Remote for lib::Pair<T,Foo> { }
-//~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[old]~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[re]~^^ ERROR E0117
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.old.stderr
index 072a98cf358..8b25bee6e2f 100644
--- a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr
+++ b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.old.stderr
@@ -1,5 +1,5 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-pair-covered-uncovered-1.rs:11:1
+  --> $DIR/coherence-pair-covered-uncovered-1.rs:15:1
    |
 LL | impl<T, U> Remote1<Pair<T, Local<U>>> for i32 { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.re.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.re.stderr
new file mode 100644
index 00000000000..0c654ca4183
--- /dev/null
+++ b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.re.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-pair-covered-uncovered-1.rs:15:1
+   |
+LL | impl<T, U> Remote1<Pair<T, Local<U>>> for i32 { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-pair-covered-uncovered-1.rs b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs
index f41e93aa994..91794b7999b 100644
--- a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs
+++ b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs
@@ -2,6 +2,10 @@
 // list of type parameters, not the self type.
 
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 
 extern crate coherence_lib as lib;
 use lib::{Remote1, Pair};
@@ -9,6 +13,7 @@ use lib::{Remote1, Pair};
 pub struct Local<T>(T);
 
 impl<T, U> Remote1<Pair<T, Local<U>>> for i32 { }
-//~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[old]~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[re]~^^ ERROR E0117
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered.old.stderr
index 3ba53829e34..39558d8dcc0 100644
--- a/src/test/ui/coherence/coherence-pair-covered-uncovered.stderr
+++ b/src/test/ui/coherence/coherence-pair-covered-uncovered.old.stderr
@@ -1,5 +1,5 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-pair-covered-uncovered.rs:8:1
+  --> $DIR/coherence-pair-covered-uncovered.rs:11:1
    |
 LL | impl<T,U> Remote for Pair<T,Local<U>> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered.re.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered.re.stderr
new file mode 100644
index 00000000000..9bddc153902
--- /dev/null
+++ b/src/test/ui/coherence/coherence-pair-covered-uncovered.re.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-pair-covered-uncovered.rs:11:1
+   |
+LL | impl<T,U> Remote for Pair<T,Local<U>> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-pair-covered-uncovered.rs b/src/test/ui/coherence/coherence-pair-covered-uncovered.rs
index 2400e9ec679..49a91412bec 100644
--- a/src/test/ui/coherence/coherence-pair-covered-uncovered.rs
+++ b/src/test/ui/coherence/coherence-pair-covered-uncovered.rs
@@ -1,4 +1,7 @@
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate coherence_lib as lib;
 use lib::{Remote, Pair};
@@ -6,6 +9,7 @@ use lib::{Remote, Pair};
 struct Local<T>(T);
 
 impl<T,U> Remote for Pair<T,Local<U>> { }
-//~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[old]~^ ERROR type parameter `T` must be used as the type parameter for some local type
+//[re]~^^ ERROR E0117
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr b/src/test/ui/coherence/coherence-projection-conflict-orphan.old.stderr
index 6929d9f3312..cde9360ddf2 100644
--- a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr
+++ b/src/test/ui/coherence/coherence-projection-conflict-orphan.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`:
-  --> $DIR/coherence-projection-conflict-orphan.rs:16:1
+  --> $DIR/coherence-projection-conflict-orphan.rs:19:1
    |
 LL | impl Foo<i32> for i32 { }
    | --------------------- first implementation here
 LL | 
-LL | impl<A:Iterator> Foo<A::Item> for A { }  //~ ERROR E0119
+LL | impl<A:Iterator> Foo<A::Item> for A { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
    |
    = note: upstream crates may add new impl of trait `std::iter::Iterator` for type `i32` in future versions
diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.re.stderr b/src/test/ui/coherence/coherence-projection-conflict-orphan.re.stderr
new file mode 100644
index 00000000000..cde9360ddf2
--- /dev/null
+++ b/src/test/ui/coherence/coherence-projection-conflict-orphan.re.stderr
@@ -0,0 +1,14 @@
+error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`:
+  --> $DIR/coherence-projection-conflict-orphan.rs:19:1
+   |
+LL | impl Foo<i32> for i32 { }
+   | --------------------- first implementation here
+LL | 
+LL | impl<A:Iterator> Foo<A::Item> for A { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
+   |
+   = note: upstream crates may add new impl of trait `std::iter::Iterator` for type `i32` in future versions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.rs b/src/test/ui/coherence/coherence-projection-conflict-orphan.rs
index 31325bea7c9..4f7fc71536b 100644
--- a/src/test/ui/coherence/coherence-projection-conflict-orphan.rs
+++ b/src/test/ui/coherence/coherence-projection-conflict-orphan.rs
@@ -1,3 +1,6 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![feature(rustc_attrs)]
 
 // Here we expect a coherence conflict because, even though `i32` does
@@ -13,6 +16,8 @@ pub trait Bar {
 
 impl Foo<i32> for i32 { }
 
-impl<A:Iterator> Foo<A::Item> for A { }  //~ ERROR E0119
+impl<A:Iterator> Foo<A::Item> for A { }
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr b/src/test/ui/coherence/coherence-projection-conflict-ty-param.old.stderr
index 92717e3f67a..b53a4c973ed 100644
--- a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr
+++ b/src/test/ui/coherence/coherence-projection-conflict-ty-param.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>`:
-  --> $DIR/coherence-projection-conflict-ty-param.rs:10:1
+  --> $DIR/coherence-projection-conflict-ty-param.rs:14:1
    |
 LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {}
    | ---------------------------------------- first implementation here
 LL | 
-LL | impl<T, U> Foo<T> for Option<U> { } //~ ERROR E0119
+LL | impl<T, U> Foo<T> for Option<U> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::option::Option<_>`
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-projection-conflict-ty-param.re.stderr b/src/test/ui/coherence/coherence-projection-conflict-ty-param.re.stderr
new file mode 100644
index 00000000000..b53a4c973ed
--- /dev/null
+++ b/src/test/ui/coherence/coherence-projection-conflict-ty-param.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>`:
+  --> $DIR/coherence-projection-conflict-ty-param.rs:14:1
+   |
+LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {}
+   | ---------------------------------------- first implementation here
+LL | 
+LL | impl<T, U> Foo<T> for Option<U> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::option::Option<_>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-projection-conflict-ty-param.rs b/src/test/ui/coherence/coherence-projection-conflict-ty-param.rs
index 490c7e24f57..819947fa547 100644
--- a/src/test/ui/coherence/coherence-projection-conflict-ty-param.rs
+++ b/src/test/ui/coherence/coherence-projection-conflict-ty-param.rs
@@ -1,12 +1,18 @@
 // Coherence error results because we do not know whether `T: Foo<P>` or not
 // for the second impl.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 use std::marker::PhantomData;
 
 pub trait Foo<P> { fn foo() {} }
 
 impl <P, T: Foo<P>> Foo<P> for Option<T> {}
 
-impl<T, U> Foo<T> for Option<U> { } //~ ERROR E0119
+impl<T, U> Foo<T> for Option<U> { }
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 fn main() {}
diff --git a/src/test/ui/coherence/coherence-projection-conflict.stderr b/src/test/ui/coherence/coherence-projection-conflict.old.stderr
index 1b0b4e1708f..c2e5fc86175 100644
--- a/src/test/ui/coherence/coherence-projection-conflict.stderr
+++ b/src/test/ui/coherence/coherence-projection-conflict.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`:
-  --> $DIR/coherence-projection-conflict.rs:11:1
+  --> $DIR/coherence-projection-conflict.rs:15:1
    |
 LL | impl Foo<i32> for i32 { }
    | --------------------- first implementation here
 LL | 
-LL | impl<A:Bar> Foo<A::Output> for A { } //~ ERROR E0119
+LL | impl<A:Bar> Foo<A::Output> for A { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-projection-conflict.re.stderr b/src/test/ui/coherence/coherence-projection-conflict.re.stderr
new file mode 100644
index 00000000000..c2e5fc86175
--- /dev/null
+++ b/src/test/ui/coherence/coherence-projection-conflict.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`:
+  --> $DIR/coherence-projection-conflict.rs:15:1
+   |
+LL | impl Foo<i32> for i32 { }
+   | --------------------- first implementation here
+LL | 
+LL | impl<A:Bar> Foo<A::Output> for A { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-projection-conflict.rs b/src/test/ui/coherence/coherence-projection-conflict.rs
index 34f078f9a8c..4086aeef8c0 100644
--- a/src/test/ui/coherence/coherence-projection-conflict.rs
+++ b/src/test/ui/coherence/coherence-projection-conflict.rs
@@ -1,3 +1,7 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 use std::marker::PhantomData;
 
 pub trait Foo<P> { fn foo() {} }
@@ -8,7 +12,9 @@ pub trait Bar {
 
 impl Foo<i32> for i32 { }
 
-impl<A:Bar> Foo<A::Output> for A { } //~ ERROR E0119
+impl<A:Bar> Foo<A::Output> for A { }
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 impl Bar for i32 {
     type Output = i32;
diff --git a/src/test/ui/coherence/coherence-projection-ok-orphan.rs b/src/test/ui/coherence/coherence-projection-ok-orphan.rs
index be7fbfbf1b6..652b438feb1 100644
--- a/src/test/ui/coherence/coherence-projection-ok-orphan.rs
+++ b/src/test/ui/coherence/coherence-projection-ok-orphan.rs
@@ -1,5 +1,8 @@
 // compile-pass
 // skip-codegen
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 // Here we do not get a coherence conflict because `Baz: Iterator`
 // does not hold and (due to the orphan rules), we can rely on that.
diff --git a/src/test/ui/coherence/coherence-projection-ok.rs b/src/test/ui/coherence/coherence-projection-ok.rs
index 74d44eb14b5..f759a9e1b45 100644
--- a/src/test/ui/coherence/coherence-projection-ok.rs
+++ b/src/test/ui/coherence/coherence-projection-ok.rs
@@ -1,5 +1,8 @@
 // compile-pass
 // skip-codegen
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 pub trait Foo<P> {}
 
 pub trait Bar {
diff --git a/src/test/ui/coherence/coherence-subtyping.stderr b/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() { }
diff --git a/src/test/ui/coherence/coherence-tuple-conflict.stderr b/src/test/ui/coherence/coherence-tuple-conflict.old.stderr
index 4baf71ebf09..e832bdebbdd 100644
--- a/src/test/ui/coherence/coherence-tuple-conflict.stderr
+++ b/src/test/ui/coherence/coherence-tuple-conflict.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait` for type `(_, _)`:
-  --> $DIR/coherence-tuple-conflict.rs:15:1
+  --> $DIR/coherence-tuple-conflict.rs:19:1
    |
 LL | impl<T> MyTrait for (T,T) {
    | ------------------------- first implementation here
 ...
-LL | impl<A,B> MyTrait for (A,B) { //~ ERROR E0119
+LL | impl<A,B> MyTrait for (A,B) {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_, _)`
 
 error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-tuple-conflict.re.stderr b/src/test/ui/coherence/coherence-tuple-conflict.re.stderr
new file mode 100644
index 00000000000..e832bdebbdd
--- /dev/null
+++ b/src/test/ui/coherence/coherence-tuple-conflict.re.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `MyTrait` for type `(_, _)`:
+  --> $DIR/coherence-tuple-conflict.rs:19:1
+   |
+LL | impl<T> MyTrait for (T,T) {
+   | ------------------------- first implementation here
+...
+LL | impl<A,B> MyTrait for (A,B) {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_, _)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence-tuple-conflict.rs b/src/test/ui/coherence/coherence-tuple-conflict.rs
index bece87a9dd9..130867b2242 100644
--- a/src/test/ui/coherence/coherence-tuple-conflict.rs
+++ b/src/test/ui/coherence/coherence-tuple-conflict.rs
@@ -1,3 +1,7 @@
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 use std::fmt::Debug;
 use std::default::Default;
 
@@ -12,7 +16,9 @@ impl<T> MyTrait for (T,T) {
     fn get(&self) -> usize { 0 }
 }
 
-impl<A,B> MyTrait for (A,B) { //~ ERROR E0119
+impl<A,B> MyTrait for (A,B) {
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
     fn get(&self) -> usize { self.dummy }
 }
 
diff --git a/src/test/ui/coherence/coherence-vec-local-2.stderr b/src/test/ui/coherence/coherence-vec-local-2.old.stderr
index 3cdcd957709..1c1118a58c6 100644
--- a/src/test/ui/coherence/coherence-vec-local-2.stderr
+++ b/src/test/ui/coherence/coherence-vec-local-2.old.stderr
@@ -1,7 +1,7 @@
 error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
-  --> $DIR/coherence-vec-local-2.rs:11:1
+  --> $DIR/coherence-vec-local-2.rs:14:1
    |
-LL | impl<T> Remote for Vec<Local<T>> { } //~ ERROR E0210
+LL | impl<T> Remote for Vec<Local<T>> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
    |
    = note: only traits defined in the current crate can be implemented for a type parameter
diff --git a/src/test/ui/coherence/coherence-vec-local-2.re.stderr b/src/test/ui/coherence/coherence-vec-local-2.re.stderr
new file mode 100644
index 00000000000..37859f7cfa2
--- /dev/null
+++ b/src/test/ui/coherence/coherence-vec-local-2.re.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-vec-local-2.rs:14:1
+   |
+LL | impl<T> Remote for Vec<Local<T>> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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-vec-local-2.rs b/src/test/ui/coherence/coherence-vec-local-2.rs
index b77b1f2e054..423543964c2 100644
--- a/src/test/ui/coherence/coherence-vec-local-2.rs
+++ b/src/test/ui/coherence/coherence-vec-local-2.rs
@@ -2,12 +2,17 @@
 // *non-fundamental* remote type like `Vec` is not considered local.
 
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate coherence_lib as lib;
 use lib::Remote;
 
 struct Local<T>(T);
 
-impl<T> Remote for Vec<Local<T>> { } //~ ERROR E0210
+impl<T> Remote for Vec<Local<T>> { }
+//[old]~^ ERROR E0210
+//[re]~^^ ERROR E0117
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence-vec-local.stderr b/src/test/ui/coherence/coherence-vec-local.old.stderr
index 319d2ebabd7..304aaaf3687 100644
--- a/src/test/ui/coherence/coherence-vec-local.stderr
+++ b/src/test/ui/coherence/coherence-vec-local.old.stderr
@@ -1,7 +1,7 @@
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence-vec-local.rs:11:1
+  --> $DIR/coherence-vec-local.rs:14:1
    |
-LL | impl Remote for Vec<Local> { } //~ ERROR E0117
+LL | impl Remote for Vec<Local> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
diff --git a/src/test/ui/coherence/coherence-vec-local.re.stderr b/src/test/ui/coherence/coherence-vec-local.re.stderr
new file mode 100644
index 00000000000..304aaaf3687
--- /dev/null
+++ b/src/test/ui/coherence/coherence-vec-local.re.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence-vec-local.rs:14:1
+   |
+LL | impl Remote for Vec<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`.
diff --git a/src/test/ui/coherence/coherence-vec-local.rs b/src/test/ui/coherence/coherence-vec-local.rs
index de12b43d485..351ddd2aa67 100644
--- a/src/test/ui/coherence/coherence-vec-local.rs
+++ b/src/test/ui/coherence/coherence-vec-local.rs
@@ -2,12 +2,17 @@
 // *non-fundamental* remote type like `Vec` is not considered local.
 
 // aux-build:coherence_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate coherence_lib as lib;
 use lib::Remote;
 
 struct Local;
 
-impl Remote for Vec<Local> { } //~ ERROR E0117
+impl Remote for Vec<Local> { }
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs
index 205f5fd1c57..a0303142622 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs
+++ b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs
@@ -4,6 +4,9 @@
 // aux-build:coherence_copy_like_lib.rs
 // compile-pass
 // skip-codgen
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 
 extern crate coherence_copy_like_lib as lib;
diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs
index ac62310fab7..bd8317e2246 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs
+++ b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs
@@ -4,6 +4,9 @@
 // aux-build:coherence_copy_like_lib.rs
 // compile-pass
 // skip-codegen
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 
 extern crate coherence_copy_like_lib as lib;
diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.old.stderr
index 0aa7320bc33..12c7a1f977c 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr
+++ b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>`:
-  --> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:17:1
+  --> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:19:1
    |
 LL | impl<T: lib::MyCopy> MyTrait for T { }
    | ---------------------------------- first implementation here
 ...
-LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } //~ ERROR E0119
+LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyFundamentalStruct<(MyType,)>`
    |
    = note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions
diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.re.stderr b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.re.stderr
new file mode 100644
index 00000000000..12c7a1f977c
--- /dev/null
+++ b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.re.stderr
@@ -0,0 +1,14 @@
+error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>`:
+  --> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:19:1
+   |
+LL | impl<T: lib::MyCopy> MyTrait for T { }
+   | ---------------------------------- first implementation here
+...
+LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyFundamentalStruct<(MyType,)>`
+   |
+   = note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs
index a3a851f606f..2a61042c6a0 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs
+++ b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs
@@ -2,7 +2,9 @@
 // `MyType: !MyTrait` along with other "fundamental" wrappers.
 
 // aux-build:coherence_copy_like_lib.rs
+// revisions: old re
 
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 
 extern crate coherence_copy_like_lib as lib;
@@ -14,7 +16,9 @@ trait MyTrait { fn foo() {} }
 impl<T: lib::MyCopy> MyTrait for T { }
 
 // Tuples are not fundamental.
-impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } //~ ERROR E0119
+impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr b/src/test/ui/coherence/coherence_copy_like_err_struct.old.stderr
index 03b4b7d8072..1b6c62e9bf3 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr
+++ b/src/test/ui/coherence/coherence_copy_like_err_struct.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct<MyType>`:
-  --> $DIR/coherence_copy_like_err_struct.rs:19:1
+  --> $DIR/coherence_copy_like_err_struct.rs:22:1
    |
 LL | impl<T: lib::MyCopy> MyTrait for T { }
    | ---------------------------------- first implementation here
 ...
-LL | impl MyTrait for lib::MyStruct<MyType> { } //~ ERROR E0119
+LL | impl MyTrait for lib::MyStruct<MyType> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct<MyType>`
    |
    = note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions
diff --git a/src/test/ui/coherence/coherence_copy_like_err_struct.re.stderr b/src/test/ui/coherence/coherence_copy_like_err_struct.re.stderr
new file mode 100644
index 00000000000..1b6c62e9bf3
--- /dev/null
+++ b/src/test/ui/coherence/coherence_copy_like_err_struct.re.stderr
@@ -0,0 +1,14 @@
+error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct<MyType>`:
+  --> $DIR/coherence_copy_like_err_struct.rs:22:1
+   |
+LL | impl<T: lib::MyCopy> MyTrait for T { }
+   | ---------------------------------- first implementation here
+...
+LL | impl MyTrait for lib::MyStruct<MyType> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct<MyType>`
+   |
+   = note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence_copy_like_err_struct.rs b/src/test/ui/coherence/coherence_copy_like_err_struct.rs
index f8c01b4e89e..38fc2e662d7 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_struct.rs
+++ b/src/test/ui/coherence/coherence_copy_like_err_struct.rs
@@ -1,4 +1,7 @@
 // aux-build:coherence_copy_like_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 // Test that we are able to introduce a negative constraint that
 // `MyType: !MyTrait` along with other "fundamental" wrappers.
@@ -16,6 +19,8 @@ impl<T: lib::MyCopy> MyTrait for T { }
 //     MyStruct<MyType>: !MyTrait
 //
 // which we cannot approve.
-impl MyTrait for lib::MyStruct<MyType> { } //~ ERROR E0119
+impl MyTrait for lib::MyStruct<MyType> { }
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_tuple.old.stderr
index 71c1a9173af..11bd788c761 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr
+++ b/src/test/ui/coherence/coherence_copy_like_err_tuple.old.stderr
@@ -1,10 +1,10 @@
 error[E0119]: conflicting implementations of trait `MyTrait` for type `(MyType,)`:
-  --> $DIR/coherence_copy_like_err_tuple.rs:18:1
+  --> $DIR/coherence_copy_like_err_tuple.rs:21:1
    |
 LL | impl<T: lib::MyCopy> MyTrait for T { }
    | ---------------------------------- first implementation here
 ...
-LL | impl MyTrait for (MyType,) { } //~ ERROR E0119
+LL | impl MyTrait for (MyType,) { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(MyType,)`
    |
    = note: upstream crates may add new impl of trait `lib::MyCopy` for type `(MyType,)` in future versions
diff --git a/src/test/ui/coherence/coherence_copy_like_err_tuple.re.stderr b/src/test/ui/coherence/coherence_copy_like_err_tuple.re.stderr
new file mode 100644
index 00000000000..11bd788c761
--- /dev/null
+++ b/src/test/ui/coherence/coherence_copy_like_err_tuple.re.stderr
@@ -0,0 +1,14 @@
+error[E0119]: conflicting implementations of trait `MyTrait` for type `(MyType,)`:
+  --> $DIR/coherence_copy_like_err_tuple.rs:21:1
+   |
+LL | impl<T: lib::MyCopy> MyTrait for T { }
+   | ---------------------------------- first implementation here
+...
+LL | impl MyTrait for (MyType,) { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(MyType,)`
+   |
+   = note: upstream crates may add new impl of trait `lib::MyCopy` for type `(MyType,)` in future versions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/coherence/coherence_copy_like_err_tuple.rs b/src/test/ui/coherence/coherence_copy_like_err_tuple.rs
index 791ea1640f9..7234bed1ba0 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_tuple.rs
+++ b/src/test/ui/coherence/coherence_copy_like_err_tuple.rs
@@ -2,6 +2,9 @@
 // `MyType: !MyTrait` along with other "fundamental" wrappers.
 
 // aux-build:coherence_copy_like_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 extern crate coherence_copy_like_lib as lib;
 
@@ -15,6 +18,8 @@ impl<T: lib::MyCopy> MyTrait for T { }
 //     (MyType,): !MyTrait
 //
 // which we cannot approve.
-impl MyTrait for (MyType,) { } //~ ERROR E0119
+impl MyTrait for (MyType,) { }
+//[old]~^ ERROR E0119
+//[re]~^^ ERROR E0119
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence_inherent.stderr b/src/test/ui/coherence/coherence_inherent.old.stderr
index 3974cfe94ad..fa564459b21 100644
--- a/src/test/ui/coherence/coherence_inherent.stderr
+++ b/src/test/ui/coherence/coherence_inherent.old.stderr
@@ -1,7 +1,7 @@
 error[E0599]: no method named `the_fn` found for type `&Lib::TheStruct` in the current scope
-  --> $DIR/coherence_inherent.rs:31:11
+  --> $DIR/coherence_inherent.rs:35:11
    |
-LL |         s.the_fn(); //~ ERROR no method named `the_fn` found
+LL |         s.the_fn();
    |           ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
diff --git a/src/test/ui/coherence/coherence_inherent.re.stderr b/src/test/ui/coherence/coherence_inherent.re.stderr
new file mode 100644
index 00000000000..fa564459b21
--- /dev/null
+++ b/src/test/ui/coherence/coherence_inherent.re.stderr
@@ -0,0 +1,13 @@
+error[E0599]: no method named `the_fn` found for type `&Lib::TheStruct` in the current scope
+  --> $DIR/coherence_inherent.rs:35:11
+   |
+LL |         s.the_fn();
+   |           ^^^^^^
+   |
+   = help: items from traits can only be used if the trait is in scope
+   = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
+           `use Lib::TheTrait;`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/coherence/coherence_inherent.rs b/src/test/ui/coherence/coherence_inherent.rs
index f77f84bbb0c..f0d3682adb8 100644
--- a/src/test/ui/coherence/coherence_inherent.rs
+++ b/src/test/ui/coherence/coherence_inherent.rs
@@ -1,6 +1,10 @@
 // Tests that methods that implement a trait cannot be invoked
 // unless the trait is imported.
 
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
+
 mod Lib {
     pub trait TheTrait {
         fn the_fn(&self);
@@ -28,7 +32,9 @@ mod NoImport {
     use Lib::TheStruct;
 
     fn call_the_fn(s: &TheStruct) {
-        s.the_fn(); //~ ERROR no method named `the_fn` found
+        s.the_fn();
+        //[old]~^ ERROR no method named `the_fn` found
+        //[re]~^^ ERROR E0599
     }
 }
 
diff --git a/src/test/ui/coherence/coherence_inherent_cc.stderr b/src/test/ui/coherence/coherence_inherent_cc.old.stderr
index fcb3db711a0..4d93e699031 100644
--- a/src/test/ui/coherence/coherence_inherent_cc.stderr
+++ b/src/test/ui/coherence/coherence_inherent_cc.old.stderr
@@ -1,7 +1,7 @@
 error[E0599]: no method named `the_fn` found for type `&coherence_inherent_cc_lib::TheStruct` in the current scope
-  --> $DIR/coherence_inherent_cc.rs:23:11
+  --> $DIR/coherence_inherent_cc.rs:26:11
    |
-LL |         s.the_fn(); //~ ERROR no method named `the_fn` found
+LL |         s.the_fn();
    |           ^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
diff --git a/src/test/ui/coherence/coherence_inherent_cc.re.stderr b/src/test/ui/coherence/coherence_inherent_cc.re.stderr
new file mode 100644
index 00000000000..4d93e699031
--- /dev/null
+++ b/src/test/ui/coherence/coherence_inherent_cc.re.stderr
@@ -0,0 +1,13 @@
+error[E0599]: no method named `the_fn` found for type `&coherence_inherent_cc_lib::TheStruct` in the current scope
+  --> $DIR/coherence_inherent_cc.rs:26:11
+   |
+LL |         s.the_fn();
+   |           ^^^^^^
+   |
+   = help: items from traits can only be used if the trait is in scope
+   = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
+           `use coherence_inherent_cc_lib::TheTrait;`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/coherence/coherence_inherent_cc.rs b/src/test/ui/coherence/coherence_inherent_cc.rs
index 7ab10b2aa66..2c980d839b9 100644
--- a/src/test/ui/coherence/coherence_inherent_cc.rs
+++ b/src/test/ui/coherence/coherence_inherent_cc.rs
@@ -1,4 +1,7 @@
 // aux-build:coherence_inherent_cc_lib.rs
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 
 // Tests that methods that implement a trait cannot be invoked
 // unless the trait is imported.
@@ -20,7 +23,9 @@ mod NoImport {
     use coherence_inherent_cc_lib::TheStruct;
 
     fn call_the_fn(s: &TheStruct) {
-        s.the_fn(); //~ ERROR no method named `the_fn` found
+        s.the_fn();
+        //[old]~^ ERROR no method named `the_fn` found
+        //[re]~^^ ERROR E0599
     }
 }
 
diff --git a/src/test/ui/coherence/coherence_local.rs b/src/test/ui/coherence/coherence_local.rs
index dc71253e3f7..cac45b0b9ed 100644
--- a/src/test/ui/coherence/coherence_local.rs
+++ b/src/test/ui/coherence/coherence_local.rs
@@ -4,6 +4,9 @@
 // aux-build:coherence_copy_like_lib.rs
 // compile-pass
 // skip-codegen
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 
 extern crate coherence_copy_like_lib as lib;
diff --git a/src/test/ui/coherence/coherence_local_err_struct.stderr b/src/test/ui/coherence/coherence_local_err_struct.old.stderr
index 7ff88c55b06..61c94c1c7ca 100644
--- a/src/test/ui/coherence/coherence_local_err_struct.stderr
+++ b/src/test/ui/coherence/coherence_local_err_struct.old.stderr
@@ -1,7 +1,7 @@
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence_local_err_struct.rs:16:1
+  --> $DIR/coherence_local_err_struct.rs:17:1
    |
-LL | impl lib::MyCopy for lib::MyStruct<MyType> { } //~ ERROR E0117
+LL | impl lib::MyCopy for lib::MyStruct<MyType> { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
diff --git a/src/test/ui/coherence/coherence_local_err_struct.re.stderr b/src/test/ui/coherence/coherence_local_err_struct.re.stderr
new file mode 100644
index 00000000000..61c94c1c7ca
--- /dev/null
+++ b/src/test/ui/coherence/coherence_local_err_struct.re.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence_local_err_struct.rs:17:1
+   |
+LL | impl lib::MyCopy for lib::MyStruct<MyType> { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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_local_err_struct.rs b/src/test/ui/coherence/coherence_local_err_struct.rs
index b94fc6c6abc..d6faaf2977a 100644
--- a/src/test/ui/coherence/coherence_local_err_struct.rs
+++ b/src/test/ui/coherence/coherence_local_err_struct.rs
@@ -2,8 +2,9 @@
 // `MyType: !MyTrait` along with other "fundamental" wrappers.
 
 // aux-build:coherence_copy_like_lib.rs
+// revisions: old re
 
-
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 
 extern crate coherence_copy_like_lib as lib;
@@ -13,7 +14,9 @@ struct MyType { x: i32 }
 // These are all legal because they are all fundamental types:
 
 // MyStruct is not fundamental.
-impl lib::MyCopy for lib::MyStruct<MyType> { } //~ ERROR E0117
+impl lib::MyCopy for lib::MyStruct<MyType> { }
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence_local_err_tuple.stderr b/src/test/ui/coherence/coherence_local_err_tuple.old.stderr
index eab59579cb6..934e2fcb890 100644
--- a/src/test/ui/coherence/coherence_local_err_tuple.stderr
+++ b/src/test/ui/coherence/coherence_local_err_tuple.old.stderr
@@ -1,7 +1,7 @@
 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
-  --> $DIR/coherence_local_err_tuple.rs:16:1
+  --> $DIR/coherence_local_err_tuple.rs:17:1
    |
-LL | impl lib::MyCopy for (MyType,) { } //~ ERROR E0117
+LL | impl lib::MyCopy for (MyType,) { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
    |
    = note: the impl does not reference any types defined in this crate
diff --git a/src/test/ui/coherence/coherence_local_err_tuple.re.stderr b/src/test/ui/coherence/coherence_local_err_tuple.re.stderr
new file mode 100644
index 00000000000..934e2fcb890
--- /dev/null
+++ b/src/test/ui/coherence/coherence_local_err_tuple.re.stderr
@@ -0,0 +1,12 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+  --> $DIR/coherence_local_err_tuple.rs:17:1
+   |
+LL | impl lib::MyCopy for (MyType,) { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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_local_err_tuple.rs b/src/test/ui/coherence/coherence_local_err_tuple.rs
index 2e95a0f663d..2685b2df8cb 100644
--- a/src/test/ui/coherence/coherence_local_err_tuple.rs
+++ b/src/test/ui/coherence/coherence_local_err_tuple.rs
@@ -2,8 +2,9 @@
 // `MyType: !MyTrait` along with other "fundamental" wrappers.
 
 // aux-build:coherence_copy_like_lib.rs
+// revisions: old re
 
-
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 
 extern crate coherence_copy_like_lib as lib;
@@ -13,7 +14,9 @@ struct MyType { x: i32 }
 // These are all legal because they are all fundamental types:
 
 // Tuples are not fundamental, so this is not a local impl.
-impl lib::MyCopy for (MyType,) { } //~ ERROR E0117
+impl lib::MyCopy for (MyType,) { }
+//[old]~^ ERROR E0117
+//[re]~^^ ERROR E0117
 
 
 fn main() { }
diff --git a/src/test/ui/coherence/coherence_local_ref.rs b/src/test/ui/coherence/coherence_local_ref.rs
index f2978bcd960..a52510b8ea9 100644
--- a/src/test/ui/coherence/coherence_local_ref.rs
+++ b/src/test/ui/coherence/coherence_local_ref.rs
@@ -4,6 +4,9 @@
 // aux-build:coherence_copy_like_lib.rs
 // compile-pass
 // skip-codegen
+// revisions: old re
+
+#![cfg_attr(re, feature(re_rebalance_coherence))]
 #![allow(dead_code)]
 
 extern crate coherence_copy_like_lib as lib;
diff --git a/src/test/ui/coherence/re-rebalance-coherence.rs b/src/test/ui/coherence/re-rebalance-coherence.rs
new file mode 100644
index 00000000000..33ad4e97536
--- /dev/null
+++ b/src/test/ui/coherence/re-rebalance-coherence.rs
@@ -0,0 +1,13 @@
+#![feature(re_rebalance_coherence)]
+
+// run-pass
+// aux-build:re_rebalance_coherence_lib.rs
+
+extern crate re_rebalance_coherence_lib as lib;
+use lib::*;
+
+struct Oracle;
+impl Backend for Oracle {}
+impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/auxiliary/re_rebalance_coherence_lib.rs b/src/test/ui/feature-gates/auxiliary/re_rebalance_coherence_lib.rs
new file mode 100644
index 00000000000..c8d027b25c7
--- /dev/null
+++ b/src/test/ui/feature-gates/auxiliary/re_rebalance_coherence_lib.rs
@@ -0,0 +1,23 @@
+
+pub trait Backend{}
+pub trait SupportsDefaultKeyword {}
+
+impl SupportsDefaultKeyword for Postgres {}
+
+pub struct Postgres;
+
+impl Backend for Postgres {}
+
+pub struct AstPass<DB>(::std::marker::PhantomData<DB>);
+
+pub trait QueryFragment<DB: Backend> {}
+
+
+#[derive(Debug, Clone, Copy)]
+pub struct BatchInsert<'a, T: 'a, Tab> {
+    _marker: ::std::marker::PhantomData<(&'a T, Tab)>,
+}
+
+impl<'a, T:'a, Tab, DB> QueryFragment<DB> for BatchInsert<'a, T, Tab>
+where DB: SupportsDefaultKeyword + Backend,
+{}
diff --git a/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs b/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs
new file mode 100644
index 00000000000..505a45379cd
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.rs
@@ -0,0 +1,13 @@
+// Test that the use of the box syntax is gated by `re-rebalance-coherence` feature gate.
+
+// aux-build:re_rebalance_coherence_lib.rs
+
+extern crate re_rebalance_coherence_lib as lib;
+use lib::*;
+
+struct Oracle;
+impl Backend for Oracle {}
+impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}
+//~^ ERROR E0210
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.stderr b/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.stderr
new file mode 100644
index 00000000000..5972e610e47
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-re-rebalance-coherence.stderr
@@ -0,0 +1,11 @@
+error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
+  --> $DIR/feature-gate-re-rebalance-coherence.rs:10:1
+   |
+LL | impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type
+   |
+   = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0210`.