Compare commits

...

5 Commits

Author SHA1 Message Date
dependabot[bot] 57a81111ee
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 04:21:28 +00: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
11 changed files with 30 additions and 30 deletions

View File

@ -64,16 +64,11 @@ jobs:
msrv:
runs-on: ubuntu-latest
strategy:
matrix:
# When updating this, the reminder to update the minimum supported
# Rust version in Cargo.toml.
rust: ['1.57']
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo build
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- run: cargo hack build --feature-powerset --no-dev-deps --rust-version
clippy:
runs-on: ubuntu-latest

View File

@ -1,3 +1,8 @@
# Version 4.7.0
- Add `from_raw` and `into_raw` functions for `Runnable` to ease passing it
across an FFI boundary. (#65)
# Version 4.6.0
- Bump MSRV to 1.57. (#63)

View File

@ -3,9 +3,9 @@ name = "async-task"
# When publishing a new version:
# - Update CHANGELOG.md
# - Create "v4.x.y" git tag
version = "4.6.0"
version = "4.7.0"
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
edition = "2018"
edition = "2021"
rust-version = "1.57"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/smol-rs/async-task"
@ -30,7 +30,7 @@ flume = { version = "0.11", default-features = false }
futures-lite = "2.0.0"
once_cell = "1"
pin-project-lite = "0.2.10"
smol = "1"
smol = "2"
# rewrite dependencies to use the this version of async-task when running tests
[patch.crates-io]

View File

@ -21,7 +21,7 @@ macro_rules! future {
static $drop: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Fut(Box<i32>);
struct Fut(#[allow(dead_code)] Box<i32>);
impl Future for Fut {
type Output = Box<i32>;
@ -56,7 +56,7 @@ macro_rules! schedule {
static $sched: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Guard(Box<i32>);
struct Guard(#[allow(dead_code)] Box<i32>);
impl Drop for Guard {
fn drop(&mut self) {

View File

@ -24,7 +24,7 @@ macro_rules! future {
static $drop_t: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Fut(Box<i32>);
struct Fut(#[allow(dead_code)] Box<i32>);
impl Future for Fut {
type Output = Out;
@ -43,7 +43,7 @@ macro_rules! future {
}
#[derive(Default)]
struct Out(Box<i32>, bool);
struct Out(#[allow(dead_code)] Box<i32>, bool);
impl Drop for Out {
fn drop(&mut self) {
@ -71,7 +71,7 @@ macro_rules! schedule {
static $sched: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Guard(Box<i32>);
struct Guard(#[allow(dead_code)] Box<i32>);
impl Drop for Guard {
fn drop(&mut self) {

View File

@ -26,7 +26,7 @@ macro_rules! future {
static $drop_t: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Fut(Box<i32>);
struct Fut(#[allow(dead_code)] Box<i32>);
impl Future for Fut {
type Output = Out;
@ -44,7 +44,7 @@ macro_rules! future {
}
#[derive(Default)]
struct Out(Box<i32>, bool);
struct Out(#[allow(dead_code)] Box<i32>, bool);
impl Drop for Out {
fn drop(&mut self) {
@ -72,7 +72,7 @@ macro_rules! schedule {
static $sched: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Guard(Box<i32>);
struct Guard(#[allow(dead_code)] Box<i32>);
impl Drop for Guard {
fn drop(&mut self) {

View File

@ -23,7 +23,7 @@ macro_rules! future {
static $drop: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Fut(Box<i32>);
struct Fut(#[allow(dead_code)] Box<i32>);
impl Future for Fut {
type Output = ();
@ -59,7 +59,7 @@ macro_rules! schedule {
static $sched: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Guard(Box<i32>);
struct Guard(#[allow(dead_code)] Box<i32>);
impl Drop for Guard {
fn drop(&mut self) {

View File

@ -24,7 +24,7 @@ macro_rules! future {
static $drop_t: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Fut(Box<i32>);
struct Fut(#[allow(dead_code)] Box<i32>);
impl Future for Fut {
type Output = Out;
@ -43,7 +43,7 @@ macro_rules! future {
}
#[derive(Default)]
struct Out(Box<i32>, bool);
struct Out(#[allow(dead_code)] Box<i32>, bool);
impl Drop for Out {
fn drop(&mut self) {
@ -71,7 +71,7 @@ macro_rules! schedule {
static $sched: AtomicUsize = AtomicUsize::new(0);
let $name = {
struct Guard(Box<i32>);
struct Guard(#[allow(dead_code)] Box<i32>);
impl Drop for Guard {
fn drop(&mut self) {

View File

@ -29,7 +29,7 @@ macro_rules! future {
static WAKER: AtomicWaker = AtomicWaker::new();
let ($name, $get_waker) = {
struct Fut(Cell<bool>, Box<i32>);
struct Fut(Cell<bool>, #[allow(dead_code)] Box<i32>);
impl Future for Fut {
type Output = ();
@ -76,7 +76,7 @@ macro_rules! schedule {
let ($name, $chan) = {
let (s, r) = flume::unbounded();
struct Guard(Box<i32>);
struct Guard(#[allow(dead_code)] Box<i32>);
impl Drop for Guard {
fn drop(&mut self) {

View File

@ -26,7 +26,7 @@ macro_rules! future {
static WAKER: AtomicWaker = AtomicWaker::new();
let ($name, $get_waker) = {
struct Fut(Box<i32>);
struct Fut(#[allow(dead_code)] Box<i32>);
impl Future for Fut {
type Output = ();
@ -67,7 +67,7 @@ macro_rules! schedule {
let ($name, $chan) = {
let (s, r) = flume::unbounded();
struct Guard(Box<i32>);
struct Guard(#[allow(dead_code)] Box<i32>);
impl Drop for Guard {
fn drop(&mut self) {

View File

@ -26,7 +26,7 @@ macro_rules! future {
static WAKER: AtomicWaker = AtomicWaker::new();
let ($name, $get_waker) = {
struct Fut(Cell<bool>, Box<i32>);
struct Fut(Cell<bool>, #[allow(dead_code)] Box<i32>);
impl Future for Fut {
type Output = Box<i32>;
@ -73,7 +73,7 @@ macro_rules! schedule {
let ($name, $chan) = {
let (s, r) = flume::unbounded();
struct Guard(Box<i32>);
struct Guard(#[allow(dead_code)] Box<i32>);
impl Drop for Guard {
fn drop(&mut self) {