| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit executes maint/add_warning with the just added change to
deny string slices except in tests.
I recommend auditing this by checking out the previous commit followed
by running the script yourself and then verifying that the diff is
identical to this commit.
This commit makes cargo clippy fail. We will add exceptions in the next
commit.
|
| |
|
|
| |
Typos found with codespell
|
| |
|
|
|
|
|
|
| |
futures 0.3.32 has deprecated UnboundedReceiver::try_next() in favor of
UnboundedReceiver::try_recv(), but try_recv() was only introduced in
0.3.32, so using it would cause our minimal versions checks to fail
(rightfully so, because our code wouldn't build with futures 0.3.x for x
< 32).
|
| |
|
|
| |
Run maint/add_warning
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Run cargo fix --edition
2. Selectively revert the "if let"->"match" changes.
These changes are meant to protect us from the lifetime changes
for "if let" bindings in Rust 2024.
But we're not actually relying on the old lifetime rules
anywhere, and the match syntax here is quite ugly.
3. Automatically revert `$pat:expr_2021` to `$pat:expr`.
(We don't actually want to restrict the expression syntax
that our macros accept).
Done with
`git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'`
4. Run cargo fmt.
|
| |
|
|
| |
Fixes: #2033
|
| |
|
|
|
| |
Option::replace has been around since 1.31,
but the clippy warning is new.
|
| |
|
|
|
| |
This doesn't seem to happen with my local compiler. Anyway, suppress
it. I don't think we want to split up this function.
|
| |
|
|
|
| |
This gets rid of a clippy complaint about subthread_block_on_future
being too complicated.
|
| | |
|
| |
|
|
| |
The future no longer needs to be `Send + 'static`.
|
| | |
|
| |
|
|
|
|
|
|
| |
This test demonstrates that the intended use pattern compiles and
works.
It couldn't exist until now because we couldn't conveniently make a
`Send + 'static` future out of `rx.next()`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we put the future into the data structure, had the exeuctor
poll it there, and only woke up the subthread when the future was
ready.
Now, instead, we put a new TaskFutureInfo variant into the data
structure, and the executor context switches to the subthread every
time. Then we poll the future on the subthread.
Moving the future into the data structure meant we had to do use a
proxy future to store the return value. Now that's not needed any
more.
Now the future doesn't need to be Send + 'static.
Fixes #1933.
|
| |
|
|
|
|
| |
Eliminate the data_ variable and instead use a block scope.
This seems a bit nicer, and will align slightly better with
forthcoming changes.
|
| | |
|
| | |
|
| |
|
|
| |
We're going to introduce a new call site for this.
|
| |
|
|
| |
Be clearer that `fut` is only `None` during the main loop.
|
| |
|
|
|
|
| |
SubthreadFuture was a type in some early version of this branch, that
it's not in-tree now. subthread_spawn returns impl Future and the
concrete type is a channel receiver.
|
| |
|
|
| |
Let's use Tokio terminology here.
|
| |
|
|
| |
This is the TODO we are fixing with this MR.
|
| |
|
|
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167975
Also allow ourselves the option of changing this in the future.
|
| | |
|
| |
|
|
|
| |
This will let us call _inner from blocking_io, with a different
precondition. No functional change.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This is going to become a hazard. Let's be explicit.
This means using educe to derive the Default for Data.
We also need to update our educe dependency to 0.4.22, since that's
when Default(expression= "...") started working correctly.
|
| |
|
|
|
|
|
|
| |
execute_until_first_stall is now simply a wrapper which does some
logging. It will do a bit more in a moment.
Giving the inner function a more obvious name is helpful, since the
executor main loop is a thing one is often looking for.
|
| |
|
|
| |
rustfmt.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Forbid re-entering the executor using ToplevelBlockOn::block_on.
This was always forbidden in the case of MockExecutor, but that meant
that tests using MockExecutor would malfunction if the code under test
needed to re-enter the executor from sync code (since the code under test
would have to use block_on, which wrong). See #1835.
Provide a function which *can* do this, reenter_block_on. The
MockExecutor needs to know the difference, and other runtimes may too.
They are conceptually quite different operations.
Introduce ToplevelRuntime as a convenience alias.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Document the new plan for blocking interaction in the trait-level
docs for the Blocking trait (used to be SpawnBlocking).
Add cross-references (in some cases to not-yet-existing pieces).
* Rename: spawn_blocking to spawn_thread. We're going to distinguish
thread-creation (relatively expensive) from brief entry to sync code
(relatively cheap, but more restricted).
* Rename the SpawnBlocking trait to Blocking, and its ThreadHandle
to ThreadHandle. This trait is going to gain more functionality.
* Add the missing mention of `Blocking` to the docs for `Runtime`.
|
| |
|
|
|
|
|
|
|
|
| |
We're going to distinguish top-level runtime entry, from *re*-entry to
an existing executor. It is most convenient to rename this trait
first. Documentation of the distinction will come later.
(We're going to retain the function name `block_on`, but we want the trait
to be more obviously a top-level only thing, though, so we give it a
name that will hopefully avoid it peroulating throughout the codebase..)
|
| |
|
|
| |
The MockExecutor doesn't have a threadpool.
|
| | |
|
| | |
|
| |
|
|
|
| |
This makes it clearer that this is a specific term, which a
definition.
|
| |
|
|
|
| |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2793#note_3161972
|
| |
|
|
|
| |
The rustdocs for a fn in a trait impl are rendered, but are very
unobvious. Put the information in the top-level documentation.
|
| |
|
|
| |
We'll expose this with some new traits in tor_rtmock.
|
| | |
|
| |
|
|
|
|
|
| |
No change to output, but much less open-coding.
Move the doc comment that was on the Debugg impl, to the `DebugTasks`
helper struct.
|
| |
|
|
| |
Show where each test sub-case is started, in stderr output.
|
| |
|
|
| |
We're going to add another call site.
|
| |
|
|
| |
We're going to add another call site.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We're going to want to add a field inside the Arc but not inside the
Mutex, so make the Arc contents into a named-fields struct.
We don't need ArcMutexData any more. Arc<Shared> will do fine.
Previously, we needed to implement .lock() on ArcMutexData but because
Arc<Shared> derefs to Shared, we can implement it on Shared just as
well.
The field in MockExecutor ought to be renamed, but that's textually
intrusive so will come in the next commit.
|
| |
|
|
|
| |
In an earlier version of this code there was a Polling state, but
there isn't now.
|