]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #55736 - estebank:elide-anon-lt, r=petrochenkov
authorMark Rousskov <mark.simulacrum@gmail.com>
Fri, 9 Nov 2018 01:14:58 +0000 (18:14 -0700)
committerGitHub <noreply@github.com>
Fri, 9 Nov 2018 01:14:58 +0000 (18:14 -0700)
Elide anon lifetimes in conflicting impl note

Fix #54690.

src/librustc/traits/specialize/mod.rs
src/test/ui/coherence/coherence-impls-copy.stderr
src/test/ui/e0119/issue-28981.stderr

index 0ce1d8f8227553ec5e3d312fa4ca6eda15635c66..d7b5dd049e35088f015a6628a1794e8489089d2b 100644 (file)
@@ -396,7 +396,10 @@ fn to_pretty_impl_header(tcx: TyCtxt<'_, '_, '_>, impl_def_id: DefId) -> Option<
     if !substs.is_noop() {
         types_without_default_bounds.extend(substs.types());
         w.push('<');
-        w.push_str(&substs.iter().map(|k| k.to_string()).collect::<Vec<_>>().join(", "));
+        w.push_str(&substs.iter()
+            .map(|k| k.to_string())
+            .filter(|k| &k[..] != "'_")
+            .collect::<Vec<_>>().join(", "));
         w.push('>');
     }
 
index 613ee0a269e70cd62a285e3a469da5cde0bad64c..dc417957795f5b3b6765e7ea37de569e47ee7cce 100644 (file)
@@ -14,7 +14,7 @@ LL | impl Copy for &'static NotSync {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
-           - impl<'_, T> std::marker::Copy for &T
+           - impl<T> std::marker::Copy for &T
              where T: ?Sized;
 
 error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
@@ -24,7 +24,7 @@ LL | impl Copy for &'static [NotSync] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
-           - impl<'_, T> std::marker::Copy for &T
+           - impl<T> std::marker::Copy for &T
              where T: ?Sized;
 
 error[E0206]: the trait `Copy` may not be implemented for this type
index 4886ad7717574e6eae004a6529139beccaac83d3..76ff88d6cc62346b52412741cd1026668d7b5627 100644 (file)
@@ -5,7 +5,7 @@ LL | impl<Foo> Deref for Foo { } //~ ERROR must be used
    | ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: conflicting implementation in crate `core`:
-           - impl<'_, T> std::ops::Deref for &T
+           - impl<T> std::ops::Deref for &T
              where T: ?Sized;
 
 error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g. `MyStruct<Foo>`)