Skip to content

Commit

Permalink
Rollup merge of rust-lang#55736 - estebank:elide-anon-lt, r=petrochenkov
Browse files Browse the repository at this point in the history
Elide anon lifetimes in conflicting impl note

Fix rust-lang#54690.
  • Loading branch information
Mark-Simulacrum authored Nov 9, 2018
2 parents 8fd4e5a + 3ec837e commit e873984
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/librustc/traits/specialize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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('>');
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-impls-copy.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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]`:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/e0119/issue-28981.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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>`)
Expand Down

0 comments on commit e873984

Please sign in to comment.