D7791: rust-nodemap: NodeMap trait with simplest implementor

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Jan 21 17:27:04 EST 2020


martinvonz added inline comments.

INLINE COMMENTS

> Alphare wrote in nodemap.rs:150
> > I find Deref<Target = [Block]> + Send hard to understand. I think it would be helpful to name it. Could we at least define an alias for it?
> 
> Alas, trait aliases are not stable: rust#55628 <https://github.com/rust-lang/rust/issues/55628>.
> 
> On a more subjective note, I find this syntax quite readable as it is (as readable as Rust usually is), and since this is a single occurrence in a private field, I find it reasonable.

> Alas, trait aliases are not stable: rust#55628.

I didn't know about trait aliases, but I think you can already do this:

  trait Thing : Deref<Target = [Block]> + Send  {}



> ... since this is a single occurrence in a private field, I find it reasonable.

It's one instance right now. It's 7 instances of `Box<dyn Deref<...>>` at the end of the series...

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7791/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7791

To: gracinet, #hg-reviewers, kevincox
Cc: Alphare, martinvonz, durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list