Commit Graph

166 Commits

Author SHA1 Message Date
John Nunley 3065c372e1 v4.7.1
Signed-off-by: John Nunley <dev@notgull.net>
2024-04-27 16:05:50 -07:00
Giacomo Stevanato 3cfa07f3d7
Improve panic message for when a task is polled after completion (#73) 2024-04-24 00:25:55 +09:00
Taiki Endo 24adf39992 Always set #![no_std] to fix redundant import warning
```
error: the item `Box` is imported redundantly
 --> src/runnable.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^^^^^^^^^^^^^
 --> /rustc/5119208fd78a77547c705d1695428c88d6791263/library/std/src/prelude/mod.rs:125:13
  |
  = note: the item `Box` is already defined here
  |
  = note: `-D unused-imports` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(unused_imports)]`
```
2024-03-03 06:47:46 -08:00
dependabot[bot] c2122eb91b Update flaky_test requirement from 0.1 to 0.2
Updates the requirements on [flaky_test](https://github.com/denoland/flaky_test) to permit the latest version.
- [Release notes](https://github.com/denoland/flaky_test/releases)
- [Commits](https://github.com/denoland/flaky_test/compare/v0.1.0...v0.2.2)

---
updated-dependencies:
- dependency-name: flaky_test
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 10:55:06 +09:00
dependabot[bot] ef60b9c7a2 Update smol requirement from 1 to 2
Updates the requirements on [smol](https://github.com/smol-rs/smol) to permit the latest version.
- [Release notes](https://github.com/smol-rs/smol/releases)
- [Changelog](https://github.com/smol-rs/smol/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/smol/compare/v1.0.0...v2.0.0)

---
updated-dependencies:
- dependency-name: smol
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-07 13:25:01 +09:00
Taiki Endo 04fe57a95d Migrate to Rust 2021 2024-01-07 13:20:09 +09:00
Taiki Endo b5f4978f54 Ignore dead_code warnings for tuple structs in tests
We use Box to be able to catch memory leaks using miri/valgrind.

```
error: field `0` is never read
  --> tests/join.rs:29:24
   |
29 |             struct Fut(Box<i32>);
   |                    --- ^^^^^^^^
   |                    |
   |                    field in this struct
...
99 |     future!(f, POLL, DROP_F, DROP_T);
   |     -------------------------------- in this macro invocation
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
   = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
29 |             struct Fut(());
   |                        ~~

error: field `0` is never read
  --> tests/join.rs:47:24
   |
47 |             struct Out(Box<i32>, bool);
   |                    --- ^^^^^^^^
   |                    |
   |                    field in this struct
...
99 |     future!(f, POLL, DROP_F, DROP_T);
   |     -------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
   |
47 |             struct Out((), bool);
   |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
100 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~

error: field `0` is never read
   --> tests/join.rs:29:24
    |
29  |             struct Fut(Box<i32>);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
118 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
29  |             struct Fut(());
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:47:24
    |
47  |             struct Out(Box<i32>, bool);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
118 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
47  |             struct Out((), bool);
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
119 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~

error: field `0` is never read
   --> tests/join.rs:29:24
    |
29  |             struct Fut(Box<i32>);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
137 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
29  |             struct Fut(());
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:47:24
    |
47  |             struct Out(Box<i32>, bool);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
137 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
47  |             struct Out((), bool);
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
138 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~

error: field `0` is never read
   --> tests/join.rs:29:24
    |
29  |             struct Fut(Box<i32>);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
156 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
29  |             struct Fut(());
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:47:24
    |
47  |             struct Out(Box<i32>, bool);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
156 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
47  |             struct Out((), bool);
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
157 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~

error: field `0` is never read
   --> tests/join.rs:29:24
    |
29  |             struct Fut(Box<i32>);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
185 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
29  |             struct Fut(());
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:47:24
    |
47  |             struct Out(Box<i32>, bool);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
185 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
47  |             struct Out((), bool);
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
186 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~

error: field `0` is never read
   --> tests/join.rs:29:24
    |
29  |             struct Fut(Box<i32>);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
216 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
29  |             struct Fut(());
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:47:24
    |
47  |             struct Out(Box<i32>, bool);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
216 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
47  |             struct Out((), bool);
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
217 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~

error: field `0` is never read
   --> tests/join.rs:29:24
    |
29  |             struct Fut(Box<i32>);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
247 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
29  |             struct Fut(());
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:47:24
    |
47  |             struct Out(Box<i32>, bool);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
247 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
47  |             struct Out((), bool);
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
248 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~

error: field `0` is never read
   --> tests/join.rs:29:24
    |
29  |             struct Fut(Box<i32>);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
285 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
29  |             struct Fut(());
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:47:24
    |
47  |             struct Out(Box<i32>, bool);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
285 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
47  |             struct Out((), bool);
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
286 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~

error: field `0` is never read
   --> tests/join.rs:29:24
    |
29  |             struct Fut(Box<i32>);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
319 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
29  |             struct Fut(());
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:47:24
    |
47  |             struct Out(Box<i32>, bool);
    |                    --- ^^^^^^^^
    |                    |
    |                    field in this struct
...
319 |     future!(f, POLL, DROP_F, DROP_T);
    |     -------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `future` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
47  |             struct Out((), bool);
    |                        ~~

error: field `0` is never read
   --> tests/join.rs:75:26
    |
75  |             struct Guard(Box<i32>);
    |                    ----- ^^^^^^^^
    |                    |
    |                    field in this struct
...
320 |     schedule!(s, SCHEDULE, DROP_S);
    |     ------------------------------ in this macro invocation
    |
    = note: this error originates in the macro `schedule` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
75  |             struct Guard(());
    |                          ~~
```
2024-01-07 13:20:09 +09:00
Taiki Endo 8f2c088750 ci: Use cargo-hack's --rust-version flag for msrv check
This respects rust-version field in Cargo.toml, so it removes the need
to manage MSRV in both the CI file and Cargo.toml.
2024-01-07 13:20:09 +09:00
John Nunley cb8fc148eb
v4.7.0
Signed-off-by: John Nunley <dev@notgull.net>
2024-01-03 18:39:31 -08:00
Piotr Osiewicz b276d25810
feat(runnable): reintroduce into_raw/from_raw functions
These APIs were removed prior to async-task 4.0 (in commit deb709f419); they can however be useful to e.g. pass Runnable as a context argument to GCD's dispatch_async_f, which takes an opaque *mut () as an argument. Without exposing from_raw/into_raw one has to box the Runnable in order to get something that can be passed across that boundary, which seems wasteful.
2023-12-20 17:22:35 -08:00
John Nunley dfa237486f
v4.6.0 (#64)
Signed-off-by: John Nunley <dev@notgull.net>
2023-12-16 18:55:33 -08:00
Piotr Osiewicz e909f77172
m: Add leap_unwrap & make RawTask::TASK_LAYOUT non-optional
This PR makes RawTask::TASK_LAYOUT non-optional by panicking in const context in case of not having it. Note that due to MSRV being 1.47 a panic! could not be used in const context, so I resorted to out of bounds array read.
The error message in case of failure is that of the faulty expression ('async_task_failed_to_compile[1]'), which is pretty bad, but in reality we should not be getting there ever.
2023-12-14 15:13:56 -08:00
dependabot[bot] 918ec72b65 Update futures-lite requirement from 1.12.0 to 2.0.0
Updates the requirements on [futures-lite](https://github.com/smol-rs/futures-lite) to permit the latest version.
- [Release notes](https://github.com/smol-rs/futures-lite/releases)
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/futures-lite/compare/v1.12.0...v2.0.0)

---
updated-dependencies:
- dependency-name: futures-lite
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 10:32:42 +09:00
John Nunley af1ed48bad
v4.5.0
Signed-off-by: John Nunley <dev@notgull.net>
2023-10-17 19:17:27 -07:00
ivmarkov f222e1ced0
feat: Support for CPU architectures with no atomic instructions
Adds a `portable-atomic` feature to support these architectures.
2023-10-11 08:43:00 -07:00
Taiki Endo e4131393be Remove needless import 2023-10-08 17:21:34 +09:00
Taiki Endo 4d1362c16b Fix clippy::non_canonical_partial_ord_impl warning in example
```
warning: non-canonical implementation of `partial_cmp` on an `Ord` type
  --> examples/with-metadata.rs:31:1
   |
31 | /  impl PartialOrd for ByDuration {
32 | |      fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
   | | _______________________________________________________________________-
33 | ||         self.duration()
34 | ||             .partial_cmp(&other.duration())
35 | ||             .map(|ord| ord.reverse())
36 | ||     }
   | ||_____- help: change this to: `{ Some(self.cmp(other)) }`
37 | |  }
   | |__^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl
   = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default
```
2023-10-08 14:43:10 +09:00
John Nunley 30296f9582
v4.4.1
Signed-off-by: John Nunley <dev@notgull.net>
2023-09-25 10:48:49 -07:00
Taiki Endo c240866704 Update actions/checkout action to v4 2023-09-10 18:21:24 +09:00
Taiki Endo 16028248e1 Format let-else 2023-08-27 23:53:57 +09:00
dependabot[bot] c42a143176 Update flume requirement from 0.10 to 0.11
Updates the requirements on [flume](https://github.com/zesterer/flume) to permit the latest version.
- [Changelog](https://github.com/zesterer/flume/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zesterer/flume/commits)

---
updated-dependencies:
- dependency-name: flume
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 20:43:37 +09:00
Ken Hoover 9cd6f58545
docs(examples): Add example for capturing metadata
* docs(examples): Add example for capturing metadata

Adds an example of capturing metadata within the future creation
function.

* refactor(examples): Added ByDuration::duration helper

* style(examples): Deref the &mut &Cell to &Cell immediately

One less deref involved after this.

* style(examples): Fix clippy
2023-08-03 19:58:32 -07:00
Ken Hoover 182c4ddfe2
docs: Clarify safety docs for `spawn_unchecked`
* docs(safety): Clarify safety requirements for spawn_unchecked

* docs(safety): Clarify free spawn_unchecked function safety reqs
2023-08-02 17:35:11 -07:00
John Nunley d598dc8026
Add smol-rs logo (#47) 2023-07-17 14:31:59 +09:00
Taiki Endo 9ff587ecab Minimize GITHUB_TOKEN permissions
Refs: https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token
2023-03-26 16:33:40 +09:00
Taiki Endo 97b97f46c8 Set CARGO_NET_GIT_FETCH_WITH_CLI=true in CI 2023-03-26 16:33:01 +09:00
John Nunley eeee41da55
v4.4.0 (#45)
- Ensure that the allocation doesn't exceed `isize::MAX` (#32)
- Add `FallibleTask::is_finished()` (#34)
- Add a metadata generic parameter to tasks (#33)
- Add panic propagation to tasks (#37)
- Add a way to tell if the task was woken while running from the schedule function (#42)
2023-03-24 10:16:58 -07:00
John Nunley 194e7a56ca
Add async-executor test to the CI (#44) 2023-03-24 04:27:11 -07:00
Js2xxx 00581f524e
Add `woken_while_running` as another argument to the scheduling function (#42) 2023-03-23 20:36:38 +01:00
Taiki Endo 9eb81969cc Enable dependabot update for Rust 2022-12-28 12:28:11 +09:00
Taiki Endo b792decfe6 Clean up CI config 2022-12-28 12:28:11 +09:00
John Nunley 2e0a196eef
Add panic propagation (#37)
* Add panic propogation

* Make propagation a builder option
2022-11-26 19:02:30 -08:00
Taiki Endo e2493422e5 Add default metadata type to FallibleTask 2022-11-27 00:32:43 +09:00
Taiki Endo 6a43c00517 Remove msrv field from .clippy.toml
Since Rust 1.64, Clippy respects `rust-version` field in Cargo.toml.
rust-lang/rust@b776fb8
2022-11-27 00:32:43 +09:00
John Nunley d5bd8beeb6
Add metadata to tasks (#33)
* Add metadata to tasks

* Make sure to drop the header.

* Revamp so that it uses a generator instead

* Fix heap allocation

* Slightly more elegant strategy

* Add a test for using metadata.

* Use non-driven block_on() instead.
2022-11-06 09:52:00 -08:00
Mark Logan 230b0a4c84
Add FallibleTask::is_finished() (#34) 2022-10-04 04:53:50 +09:00
Taiki Endo a3b235d32a Use MAX associated constant
```
warning: use of constant `std::isize::MAX` that will be deprecated in a future Rust version: replaced by the `MAX` associated constant on this type
   --> src/utils.rs💯68
    |
100 |         if !new_align.is_power_of_two() || new_size > core::isize::MAX as usize - (new_align - 1) {
    |                                                                    ^^^
    |
    = note: requested on the command line with `-W deprecated-in-future`

warning: use of associated function `core::num::<impl isize>::max_value` that will be deprecated in a future Rust version: replaced by the `MAX` associated constant on this type
   --> src/raw.rs:313:47
    |
313 | ...                   if state > isize::max_value() as usize {
    |                                         ^^^^^^^^^

warning: use of associated function `core::num::<impl isize>::max_value` that will be deprecated in a future Rust version: replaced by the `MAX` associated constant on this type
   --> src/raw.rs:343:27
    |
343 |         if state > isize::max_value() as usize {
    |
```
2022-09-24 22:45:24 +09:00
Taiki Endo cfaee09495 Ensure that allocation doesn't exceed isize::MAX 2022-09-24 22:45:24 +09:00
Taiki Endo 06fe691ea3 Enable -Zmiri-strict-provenance 2022-08-16 22:54:42 +09:00
Taiki Endo 2bee1db71a Fix clippy::unit_arg warning in test
```
warning: passing a unit value to a function
   --> tests/panic.rs:134:44
    |
134 |     future::block_on(future::or(&mut task, future::ready(Default::default())));
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(clippy::unit_arg)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: move the expression in front of the call and replace it with the unit literal `()`
    |
134 ~     future::block_on(future::or(&mut task, {
135 +         Default::default();
136 +         future::ready(())
137 ~     }));
    |

warning: passing a unit value to a function
   --> tests/panic.rs:200:52
    |
200 |             future::block_on(future::or(&mut task, future::ready(Default::default())));
    |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
help: move the expression in front of the call and replace it with the unit literal `()`
    |
200 ~             future::block_on(future::or(&mut task, {
201 +                 Default::default();
202 +                 future::ready(())
203 ~             }));
    |
```
2022-07-17 21:58:01 +09:00
Taiki Endo ceb5fc6671 Ignore clippy::redundant_clone warning in test
```
warning: redundant clone
   --> tests/waker_ready.rs:192:25
    |
192 |     let w2 = get_waker().clone();
    |                         ^^^^^^^^ help: remove this
    |
    = note: `#[warn(clippy::redundant_clone)]` on by default
note: this value is dropped without further use
   --> tests/waker_ready.rs:192:14
    |
192 |     let w2 = get_waker().clone();
    |              ^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
```
2022-07-17 21:56:58 +09:00
Taiki Endo b45e15dd73 Apply clippy to tests and examples 2022-07-17 21:44:54 +09:00
Taiki Endo f910d25edb Release 4.3.0 2022-07-08 01:06:47 +09:00
Michael Woerister b841796fc0
Add layout_info field to TaskVTable so that debuggers can decode raw tasks (#29) 2022-07-08 00:59:46 +09:00
John Nunley 8a6ffad662
Evaluate the layouts for the tasks at compile time (#30) 2022-07-07 21:32:40 +09:00
Taiki Endo e8b536caaf Update CI config 2022-07-03 00:30:39 +09:00
Taiki Endo 512262efdd
Update MIRIFLAGS (#28) 2022-07-03 00:30:11 +09:00
Taiki Endo 8a886c252a Revert "Temporarily disable Miri weak memory emulation"
This reverts commit 545b5ab2d0.
2022-06-23 23:16:51 +09:00
Taiki Endo f943443b63 Disable Miri preemption 2022-06-17 19:23:28 +09:00
Taiki Endo 545b5ab2d0 Temporarily disable Miri weak memory emulation 2022-06-16 22:46:26 +09:00