Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on proc-macro-hack #2520

Merged
merged 3 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- master
- '[0-9]+.[0-9]+'
schedule:
- cron: '40 1 * * *'
- cron: '0 1 * * *'

env:
RUSTFLAGS: -D warnings
Expand Down Expand Up @@ -61,8 +61,8 @@ jobs:
matrix:
rust:
# This is the minimum Rust version supported by futures-core, futures-io, futures-sink, futures-task.
# When updating this, the reminder to update the minimum required version in .clippy.toml.
- 1.36.0
# When updating this, the reminder to update the minimum required version in README.md, Cargo.toml, and .clippy.toml.
- 1.36
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -92,8 +92,8 @@ jobs:
matrix:
rust:
# This is the minimum Rust version supported by futures, futures-util, futures-macro, futures-executor, futures-channel, futures-test.
# When updating this, the reminder to update the minimum required version in README.md.
- 1.41.0
# When updating this, the reminder to update the minimum required version in README.md and Cargo.toml.
- 1.45
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
30 changes: 6 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<a href="https://crates.io/crates/futures">
<img alt="Crates.io" src="https://img.shields.io/crates/v/futures.svg">
</a>

<a href="https://www.rust-lang.org">
<img alt="Rustc Version" src="https://img.shields.io/badge/rustc-1.41+-lightgray.svg">
</a>
</p>

<p align="center">
Expand All @@ -42,13 +38,7 @@ Add this to your `Cargo.toml`:
futures = "0.3"
```

Now, you can use futures-rs:

```rust
use futures::future::Future;
```

The current futures-rs requires Rust 1.41 or later.
The current `futures` requires Rust 1.45 or later.

### Feature `std`

Expand All @@ -61,19 +51,11 @@ a `#[no_std]` environment, use:
futures = { version = "0.3", default-features = false }
```

# License

This project is licensed under either of

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
https://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
https://opensource.org/licenses/MIT)

at your option.
## License

### Contribution
Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in futures-rs by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
3 changes: 2 additions & 1 deletion futures-channel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "futures-channel"
edition = "2018"
version = "0.4.0-alpha.0"
edition = "2018"
rust-version = "1.45"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
Expand Down
23 changes: 23 additions & 0 deletions futures-channel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# futures-channel

Channels for asynchronous communication using futures-rs.

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
futures-channel = "0.3"
```

The current `futures-channel` requires Rust 1.45 or later.

## License

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
3 changes: 2 additions & 1 deletion futures-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "futures-core"
edition = "2018"
version = "1.0.0-alpha.0"
edition = "2018"
rust-version = "1.36"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
Expand Down
23 changes: 23 additions & 0 deletions futures-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# futures-core

The core traits and types in for the `futures` library.

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
futures-core = "0.3"
```

The current `futures-core` requires Rust 1.36 or later.

## License

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
3 changes: 2 additions & 1 deletion futures-executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "futures-executor"
edition = "2018"
version = "0.4.0-alpha.0"
edition = "2018"
rust-version = "1.45"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
Expand Down
23 changes: 23 additions & 0 deletions futures-executor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# futures-executor

Executors for asynchronous tasks based on the futures-rs library.

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
futures-executor = "0.3"
```

The current `futures-executor` requires Rust 1.45 or later.

## License

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
3 changes: 2 additions & 1 deletion futures-io/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "futures-io"
edition = "2018"
version = "0.3.17"
edition = "2018"
rust-version = "1.36"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
Expand Down
23 changes: 23 additions & 0 deletions futures-io/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# futures-io

The `AsyncRead`, `AsyncWrite`, `AsyncSeek`, and `AsyncBufRead` traits for the futures-rs library.

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
futures-io = "0.3"
```

The current `futures-io` requires Rust 1.36 or later.

## License

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
7 changes: 2 additions & 5 deletions futures-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "futures-macro"
edition = "2018"
version = "0.4.0-alpha.0"
edition = "2018"
rust-version = "1.45"
authors = ["Taylor Cramer <cramertj@google.com>", "Taiki Endo <te316e89@gmail.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
Expand All @@ -15,11 +16,7 @@ proc-macro = true

[features]

[build-dependencies]
autocfg = "1"

[dependencies]
proc-macro2 = "1.0"
proc-macro-hack = "0.5.19"
quote = "1.0"
syn = { version = "1.0.56", features = ["full"] }
28 changes: 0 additions & 28 deletions futures-macro/build.rs

This file was deleted.

17 changes: 6 additions & 11 deletions futures-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,38 @@ mod select;
mod stream_select;

/// The `join!` macro.
#[cfg_attr(fn_like_proc_macro, proc_macro)]
#[cfg_attr(not(fn_like_proc_macro), proc_macro_hack::proc_macro_hack)]
#[proc_macro]
pub fn join_internal(input: TokenStream) -> TokenStream {
crate::join::join(input)
}

/// The `try_join!` macro.
#[cfg_attr(fn_like_proc_macro, proc_macro)]
#[cfg_attr(not(fn_like_proc_macro), proc_macro_hack::proc_macro_hack)]
#[proc_macro]
pub fn try_join_internal(input: TokenStream) -> TokenStream {
crate::join::try_join(input)
}

/// The `select!` macro.
#[cfg_attr(fn_like_proc_macro, proc_macro)]
#[cfg_attr(not(fn_like_proc_macro), proc_macro_hack::proc_macro_hack)]
#[proc_macro]
pub fn select_internal(input: TokenStream) -> TokenStream {
crate::select::select(input)
}

/// The `select_biased!` macro.
#[cfg_attr(fn_like_proc_macro, proc_macro)]
#[cfg_attr(not(fn_like_proc_macro), proc_macro_hack::proc_macro_hack)]
#[proc_macro]
pub fn select_biased_internal(input: TokenStream) -> TokenStream {
crate::select::select_biased(input)
}

// TODO: Change this to doc comment once rustdoc bug fixed.
// TODO: Change this to doc comment once rustdoc bug fixed: https://github.com/rust-lang/futures-rs/pull/2435
// The `test` attribute.
#[proc_macro_attribute]
pub fn test_internal(input: TokenStream, item: TokenStream) -> TokenStream {
crate::executor::test(input, item)
}

/// The `stream_select!` macro.
#[cfg_attr(fn_like_proc_macro, proc_macro)]
#[cfg_attr(not(fn_like_proc_macro), proc_macro_hack::proc_macro_hack)]
#[proc_macro]
pub fn stream_select_internal(input: TokenStream) -> TokenStream {
crate::stream_select::stream_select(input.into())
.unwrap_or_else(syn::Error::into_compile_error)
Expand Down
3 changes: 2 additions & 1 deletion futures-sink/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "futures-sink"
edition = "2018"
version = "0.4.0-alpha.0"
edition = "2018"
rust-version = "1.36"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
Expand Down
23 changes: 23 additions & 0 deletions futures-sink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# futures-sink

The asynchronous `Sink` trait for the futures-rs library.

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
futures-sink = "0.3"
```

The current `futures-sink` requires Rust 1.36 or later.

## License

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
3 changes: 2 additions & 1 deletion futures-task/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "futures-task"
edition = "2018"
version = "0.4.0-alpha.0"
edition = "2018"
rust-version = "1.36"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
Expand Down
23 changes: 23 additions & 0 deletions futures-task/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# futures-task

Tools for working with tasks.

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
futures-task = "0.3"
```

The current `futures-task` requires Rust 1.36 or later.

## License

Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
[MIT license](LICENSE-MIT) at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
3 changes: 2 additions & 1 deletion futures-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "futures-test"
edition = "2018"
version = "0.4.0-alpha.0"
edition = "2018"
rust-version = "1.45"
authors = ["Wim Looman <wim@nemo157.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
Expand Down
Loading