<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/arti.git/crates/tor-linkspec/src, branch arti-v0.6.0</title>
<subtitle>mirror of https://gitlab.torproject.org/tpo/core/arti
</subtitle>
<id>http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v0.6.0</id>
<link rel='self' href='http://git.dilluti0n.com/mirrors/arti.git/atom?h=arti-v0.6.0'/>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/'/>
<updated>2022-07-11T15:18:51Z</updated>
<entry>
<title>tor-linkspec: Stop using infallible writers.</title>
<updated>2022-07-11T15:18:51Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2022-07-09T17:48:24Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=8ef003c623c6211041b56900beb0e9980d415ad4'/>
<id>urn:sha1:8ef003c623c6211041b56900beb0e9980d415ad4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert each write_onto_infallible implementation into write_onto.</title>
<updated>2022-07-11T15:18:51Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2022-07-08T15:37:50Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=8810af7f6522d43408e30d04d21c4ec6102d73b3'/>
<id>urn:sha1:8810af7f6522d43408e30d04d21c4ec6102d73b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rename "write" methods on tor-bytes to "write_infallible".</title>
<updated>2022-07-11T15:18:51Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2022-07-08T15:20:50Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=7938f65c66020d6d7f143307f3336f340f398c63'/>
<id>urn:sha1:7938f65c66020d6d7f143307f3336f340f398c63</id>
<content type='text'>
This comprises four renames:

```
write_onto -&gt; write_onto_infallible
write_into -&gt; write_into_infallible
write -&gt; write_infallible
writer_and_consume -&gt; write_and_consume_infallible.
```

The rest of this branch will be concerned with replacing these
`_infallible` methods with ones that return a `Result`.  This is
part of #513.
</content>
</entry>
<entry>
<title>ChanMgr: errors: attribute errors to correct address.</title>
<updated>2022-07-06T15:51:28Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2022-07-05T15:47:30Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=dd491931c8841f2eaed7fea19d6b0777e990a254'/>
<id>urn:sha1:dd491931c8841f2eaed7fea19d6b0777e990a254</id>
<content type='text'>
Even when keys are relevant, we still don't want to attribute errors
to a set of addresses when we have a single address that we're
connected with.
</content>
</entry>
<entry>
<title>Run maint/add_warning crates/*/src/{lib,main}.rs</title>
<updated>2022-06-23T18:15:42Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2022-06-23T18:15:29Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=589c6e52bb49ccfe6c0ad9d18d6b994978e46c6c'/>
<id>urn:sha1:589c6e52bb49ccfe6c0ad9d18d6b994978e46c6c</id>
<content type='text'>
Update all lint blocks
</content>
</entry>
<entry>
<title>lints: Add let_unit_value allow to all crates</title>
<updated>2022-05-31T14:23:52Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2022-05-31T10:46:13Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=4f42101554822c44782c164cac0051e3b4055abd'/>
<id>urn:sha1:4f42101554822c44782c164cac0051e3b4055abd</id>
<content type='text'>
From running add_warning, with manual picking of the right
hunks/lines.
</content>
</entry>
<entry>
<title>lints: Add lint block delimiters to every crate</title>
<updated>2022-05-31T12:00:31Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2022-05-30T17:43:12Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=ba0843da4a7ba1e63846a286b870b893092e0a4f'/>
<id>urn:sha1:ba0843da4a7ba1e63846a286b870b893092e0a4f</id>
<content type='text'>
This was the result of:
  maint/add_warning crates/*/src/{lib,main}.rs
and then manually curating the results.
</content>
</entry>
<entry>
<title>Resolve the new `derive_partial_eq_without_eq` lint.</title>
<updated>2022-05-23T16:55:37Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2022-05-23T16:32:31Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=546ae3000eb179aedc97de30b0ccdb1d45b93395'/>
<id>urn:sha1:546ae3000eb179aedc97de30b0ccdb1d45b93395</id>
<content type='text'>
It's a little overzealous sometimes, but it's mostly to the good.
</content>
</entry>
<entry>
<title>squash! Bump every crate's edition to 2021.</title>
<updated>2022-04-25T17:06:26Z</updated>
<author>
<name>Nick Mathewson</name>
<email>nickm@torproject.org</email>
</author>
<published>2022-04-25T16:40:33Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=2f6bc6bdc431fa36de70a167eea777dcf3f60bf2'/>
<id>urn:sha1:2f6bc6bdc431fa36de70a167eea777dcf3f60bf2</id>
<content type='text'>
Remove all `use` statements for `TryFrom` and `TryInto`.  These are
now redundant in Rust 2021.
</content>
</entry>
<entry>
<title>Disable clippy::clone_on_ref_ptr</title>
<updated>2022-02-24T18:15:44Z</updated>
<author>
<name>Ian Jackson</name>
<email>ijackson@chiark.greenend.org.uk</email>
</author>
<published>2022-02-24T18:15:44Z</published>
<link rel='alternate' type='text/html' href='http://git.dilluti0n.com/mirrors/arti.git/commit/?id=afb50fe7354a8715290516e74e89679f0649568e'/>
<id>urn:sha1:afb50fe7354a8715290516e74e89679f0649568e</id>
<content type='text'>
This lint is IMO inherently ill-conceived.

I have looked for the reasons why this might be thought to be a good
idea and there were basically two (and they are sort of contradictory):

I. "Calling ‘.clone()` on an Rc, Arc, or Weak can obscure the fact
    that only the pointer is being cloned, not the underlying data."

This is the wording from
  https://rust-lang.github.io/rust-clippy/v0.0.212/#clone_on_ref_ptr

It is a bit terse; we are left to infer why it is a bad idea to
obscure this fact.  It seems to me that if it is bad to obscure some
fact, that must be because the fact is a hazard.  But why would it be
a hazard to not copy the underlying data ?

In other languages, faliing to copy the underlying data is a serious
correctness hazard.  There is a whose class of bugs where things were
not copied, and then mutated and/or reused in multiple places in ways
that were not what the programmer intended.  In my experience, this is
a very common bug when writing Python and Javascript.  I'm told it's
common in golang too.

But in Rust this bug is much much harder to write.  The data inside an
Arc is immutable.  To have this bug you'd have use interior mutability
- ie mess around with Mutex or RefCell.  That provides a good barrier
to these kind of accidents.

II. "The reason for writing Rc::clone and Arc::clone [is] to make it
     clear that only the pointer is being cloned, as opposed to the
     underlying data. The former is always fast, while the latter can
     be very expensive depending on what is being cloned."

This is the reasoning found here
  https://github.com/rust-lang/rust-clippy/issues/2048

This is saying that *not* using Arc::clone is hazardous.
Specifically, that a deep clone is a performance hazard.

But for this argument, the lint is precisely backwards.  It's linting
the "good" case and asking for it to be written in a more explicit
way; while the supposedly bad case can be written conveniently.

Also, many objects (in our codebase, and in all the libraries we use)
that are Clone are in fact simply handles.  They contain Arc(s) (or
similar) and are cheap to clone.  Indeed, that is the usual case.

It does not make sense to distinguish in the syntax we use to clone
such a handle, whether the handle is a transparent Arc, or an opaque
struct containing one or more other handles.

Forcing Arc::clone to be written as such makes for code churn when a
type is changed from Arc&lt;Something&gt; to Something: Clone, or vice
versa.
</content>
</entry>
</feed>
