Alexander Færøy
6be6352b98
Merge branch 'conversation' into 'main'
...
Overhaul send_control_message
See merge request tpo/core/arti!1367
2023-07-10 13:14:11 +00:00
Alexander Færøy
943c12739d
Merge branch 'recurse' into 'main'
...
tor-hsclient: Mock traits: Work around an async boobytrap
See merge request tpo/core/arti!1365
2023-07-10 13:13:31 +00:00
Ian Jackson
fd2e4979be
clippy: tor-error: Use convert::identity for into_internal!
...
This launders the closure so that clippy's
clippy::redundant_closure_call can't see it.
We can't have a local #[allow] because it would be on an expression,
which isn't allowed on stable.
This avoids having to use more clumsy idioms at call sites.
2023-07-10 13:49:51 +01:00
Ian Jackson
1a8395cd11
tor-llcrypto: Add a missing instance of the standard lint block
...
This fixes a needless_vec lint on nightly.
2023-07-10 13:49:51 +01:00
Ian Jackson
473447a82e
Run maint/add_warning to actually apply new lint allows
2023-07-10 13:49:51 +01:00
Ian Jackson
01cb7ee0a1
clippy: in tests, allow clippy::useless_vec
...
This is a perf issue, only. If tests are too slow, we will notice and
ca speed them up. We should optimise for clarity and convenience,
rather than speed.
Forbidding this can result in churn between vec![] and [] as tests are
updated and changed.
2023-07-10 13:49:51 +01:00
Ian Jackson
43bf89d540
clippy: globally allow clippy::needless_raw_string_hashes
...
Rationale: no-one writes these by default without thinkinh. If they
are unnecessary, then either the string must have had " in it
before (in which case it might do again), or it is near other strings
which *do* need it.
And having it does no harm; indeed IMO it can increase clarity.
Alternative to !1388's
Fix new "needless_raw_string_hashes" lint from clippy +nightly
2023-07-10 13:49:51 +01:00
Alexander Færøy
590c72eb03
Update s101 stats.
2023-07-10 14:35:27 +02:00
Nick Mathewson
9f3619d5c9
Merge branch 'clippy-vec' into 'main'
...
Fix new "useless_vec" warning from clippy +nightly
See merge request tpo/core/arti!1395
2023-07-10 12:07:31 +00:00
Ian Jackson
25b7573f58
Merge branch 'clippy-common' into 'main'
...
clippy +nightly: Uncontroversial adjustments from Nick
See merge request tpo/core/arti!1394
2023-07-10 12:01:02 +00:00
Nick Mathewson
c2601ec896
Explain the code for the #952 fix.
...
Let's explain what Trinity did in its fix for #952 , so that we know
why this code is here the next time we find it.
2023-07-10 08:00:08 -04:00
Ian Jackson
501454370f
Fix new "useless_vec" warning from clippy +nightly
...
Explanation at
https://rust-lang.github.io/rust-clippy/master/index.html#/useless_vec
This is the non-tests subset of the same-named commmit in !1388 ,
(recreated by hand by me, and then checked against that commit;
I stole the commit message from Nick's.)
This should be uncontroversial I think.
2023-07-10 12:35:21 +01:00
Nick Mathewson
22f55b7cf8
Remove some needless into_iter() calls.
...
Clippy nightly now detects when you're calling into_iter() and
passing the result into something that accepts an
`impl IntoIterator`.
2023-07-10 12:33:21 +01:00
Nick Mathewson
0b6cc7ba5e
Add exceptions for some cases of diverging_sub_expression
...
See here for documentation on the lint:
https://rust-lang.github.io/rust-clippy/master/index.html#/diverging_sub_expression
The issue here, from what I can tell, is that the lint triggers
whenever you use a diverging expression as a function body within an
2023-07-10 12:33:21 +01:00
Nick Mathewson
7e78224460
Add an exception for clippy::arc_with_non_send_sync.
...
We're doing this deliberately, I believe.
2023-07-10 12:33:21 +01:00
gabi-250
2db3e73434
Merge branch 'da-task' into 'main'
...
RFC: tor-rtmock: Use derive-adhoc for composite runtimes
See merge request tpo/core/arti!1381
2023-07-10 10:53:23 +00:00
Ian Jackson
ca32680ba6
Merge branch 'onion-service-client-docs' into 'main'
...
Update documentation regarding the `onion-service-client` feature
See merge request tpo/core/arti!1392
2023-07-10 09:41:04 +00:00
trinity-1686a
c98894cebc
fix chutney in CI
2023-07-08 12:31:20 +02:00
Kunal Mehta
7acd7de369
Update documentation regarding the `onion-service-client` feature
...
It is no longer experimental, but still not rated for security-sensitive
usage per <https://blog.torproject.org/arti_116_released/ >.
2023-07-07 22:01:51 -04:00
Ian Jackson
77b0dc2edc
Merge branch 'raw_event_report' into 'main'
...
Fix warn_report and error_report macros.
See merge request tpo/core/arti!1390
2023-07-07 20:07:45 +00:00
Nick Mathewson
53c599d50f
Fix warn_report and error_report macros.
...
Originally they didn't check err.kind(), since err.kind() can never
increase their severity. We lost that behavior with !1386 , and we
became dependent on it with arti!1383. Since they both merged at
the same time, CI broke.
This patch restores their original behavior.
2023-07-07 15:46:41 -04:00
Nick Mathewson
ba3876b22a
Merge branch 'feat' into 'main'
...
arti: Build with HS client support by default
Closes #948
See merge request tpo/core/arti!1382
2023-07-07 19:28:05 +00:00
Nick Mathewson
b6b7edad59
Merge branch 'event_report_everywhere' into 'main'
...
Throughout: Use event_report!() macros for reporting Errors.
Closes #949
See merge request tpo/core/arti!1383
2023-07-07 19:27:20 +00:00
Nick Mathewson
b251784041
Merge branch 'fix-os-onionbalance' into 'main'
...
be more lenient while parsing inner hs desc
Closes #952
See merge request tpo/core/arti!1389
2023-07-07 19:26:27 +00:00
trinity-1686a
2d170425c0
be more lenient while parsing inner hs desc
2023-07-07 21:06:05 +02:00
Ian Jackson
778244c3af
Merge branch 'report' into 'main'
...
tor-error: tracing module: Use macro to generate macros
See merge request tpo/core/arti!1386
2023-07-07 18:09:46 +00:00
Ian Jackson
08632739eb
Document (retrospectively) the behaviour of 1.1.6 re HS client
2023-07-07 19:04:16 +01:00
Ian Jackson
696adc3c94
tor-error: tracing module: Use macro to generate macros
...
This abolishes some quintuplication.
The output is identical except that:
* The syntax display in the rustdoc output for the resulting macros
seems to have somewhat less whitepsace.
* The whimsical error messages in the examples are all identical.
Ah well.
2023-07-07 18:38:24 +01:00
Nick Mathewson
7d1c8dfde0
Merge branch 'inclusive' into 'main'
...
rng ranges: Use inclusive Duration ranges in several places
See merge request tpo/core/arti!1385
2023-07-07 17:07:58 +00:00
Nick Mathewson
25c6fe61e4
Throughout: Use *_report!() macros for reporting Errors.
...
I identified the cases to replace by searching for the string
`.report()`. There are a few that I didn't change:
* A couple of cases that used anyhow::Error,
* One case that reported two Errors.
* Two cases in `tor_hsclient::err` that just did
`error!("Bug: {}")`.
I have also not audited the cases in `tor-hsclient` where we're using
`tor_error::Report` manually.
Nonetheless, closes #949 .
2023-07-07 13:00:21 -04:00
Ian Jackson
220900a852
tor-error: tracing module: Fix link to tracing macro
2023-07-07 17:48:05 +01:00
Ian Jackson
bcc3e6fef8
rng ranges: Use inclusive Duration ranges in several places
...
Many of these call sites would panic if, somehow, the upper bound was
zero. In most cases it is very complicated to see if whether this
could happen.
However, there is a better answer:
Durations are (conceptually) dense, so picking the closed set (which
includes its boundary) rather than the open one (which doesn't) will
make little practical difference.
So change four call sites to use `..=` instead of just `..`.
2023-07-07 16:13:52 +01:00
Nick Mathewson
6187b6d5ca
geoip: Enable the niche optimization for CountryCode.
...
Since we're going to be using `Option<CountryCode>` all over, let's
save the extra byte.
Sadly this required std::mem::transmute(), which is unsafe, so maybe
we should think twice.
2023-07-07 10:33:33 -04:00
Nick Mathewson
70f0fe634f
Merge branch 'report-bugs-v2' into 'main'
...
Optional tracing support in tor-error for error reporting
See merge request tpo/core/arti!1379
2023-07-07 13:49:59 +00:00
Nick Mathewson
023d288ba2
event_report: assert correctness of format ending
...
(Also, document that this static assertion is the reason why you are
seeing a confusing error message.)
2023-07-07 09:00:31 -04:00
Nick Mathewson
a441b4e9d3
circmgr: Use event_report!() and similar macros
...
This simplifies our logging a little, and implements part of
2023-07-07 09:00:31 -04:00
Nick Mathewson
7168feefdd
tor-error: Add optional tracing support
...
The main contribution here is a set of convenience macros for
logging error `Report`s. Notably, this macros always logs
`Internal` and `BadAspiUsage` errors at `WARN`, unless they
are already at `ERROR` or more.
This is a little tricky because `tracing::event!()` requires
its Level argument to be a constant.
2023-07-07 09:00:31 -04:00
Ian Jackson
80f397fb0b
Merge branch 'allow_missing_panics' into 'main'
...
add_warning: Tolerate clippy::missing_panics_doc
Closes #950
See merge request tpo/core/arti!1380
2023-07-07 12:53:46 +00:00
Saksham Mittal
9de4f38b38
Make CompoundFactory private for external code
2023-07-07 18:18:44 +05:30
Nick Mathewson
2b3d4150e3
Merge branch 'clippy-nightly-20230703' into 'main'
...
Fix various warnings from clippy nightly
Closes #943
See merge request tpo/core/arti!1369
2023-07-07 12:26:45 +00:00
Ian Jackson
4c0935e13a
arti: Build with HS client support by default
...
Fixes #948
2023-07-07 12:54:08 +01:00
Ian Jackson
61344f68a5
arti Cargo.tomL: wrap default features list
2023-07-07 12:52:05 +01:00
Ian Jackson
6e495d8400
tor-rtmock: Use derive-adhoc for composite runtimes
2023-07-07 10:26:44 +01:00
Nick Mathewson
4caf86349c
Remove explicit allows for missing_panics_docs.
...
These are no longer needed.
2023-07-06 14:36:13 -04:00
Nick Mathewson
03f9f9987a
Run add_warning to remove `missing_panics_doc` deny.
...
Closes #950 .
2023-07-06 14:32:23 -04:00
Nick Mathewson
7e2fa11065
add_warning: Tolerate clippy::missing_panics_doc
...
As of current nightly, this lint now includes expect()s,
which makes it trigger way more than we'd like.
See discussion on #950 .
2023-07-06 14:29:40 -04:00
Nick Mathewson
07b4b11d7a
Avoid matches!(x, None), matches!(x, Ok(_))
...
This appeases clippy-nightly.
2023-07-06 14:26:48 -04:00
Nick Mathewson
486b6b8c82
tor-rtcompat: Simplify trivial all() expressions.
...
Clippy nightly doesn't like `#[cfg(all(...))]` with only a single
expression inside the `all(...)`.
This requires an adjustment in check_doc_features.
2023-07-06 14:26:43 -04:00
gabi-250
34b7699fff
Merge branch 'task5' into 'main'
...
tor-rtmock: Minor followups for impl_runtime
See merge request tpo/core/arti!1378
2023-07-06 16:05:30 +00:00
Ian Jackson
de97288c53
tor-rtmock: statically assert that the macro makes a Runtime impl
2023-07-06 15:58:42 +01:00