aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-12-23 12:50:58 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-12-23 12:50:58 +0000
commit85a7135cfd753080f6356cce297f576c36704d73 (patch)
tree65c53b7e11d3e3d89f2835515ad962de1716c0ed
parentaada36a2e57f947ff05cd06cb5f701e0b959b847 (diff)
parent83002a558890f7bb2a5f3e597298dbc2768bb6d3 (diff)
downloadtokio-macros-85a7135cfd753080f6356cce297f576c36704d73.tar.gz
Upgrade rust/crates/tokio-macros to 0.3.2 am: b98e0debbb am: 7152cb68d5 am: 83002a5588
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tokio-macros/+/1534332 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I904f65c7aa51d2b40e5f1c3b60540148773b4db8
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp33
-rw-r--r--CHANGELOG.md9
-rw-r--r--Cargo.toml4
-rw-r--r--Cargo.toml.orig4
-rw-r--r--METADATA8
-rw-r--r--src/entry.rs18
-rw-r--r--src/lib.rs26
8 files changed, 62 insertions, 42 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 1024f0a..bb691dc 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "1c28c3b0a867b0147293055fe648d1185f9648a9"
+ "sha1": "171724863db9c82929737d37bd93725e5a5f8af0"
}
}
diff --git a/Android.bp b/Android.bp
index 01f7b5a..bb0e701 100644
--- a/Android.bp
+++ b/Android.bp
@@ -28,30 +28,29 @@ rust_test_host {
}
// dependent_library ["feature_list"]
-// arc-swap-0.4.7
+// autocfg-1.0.1
// bytes-0.6.0 "default,std"
// cfg-if-0.1.10
// cfg-if-1.0.0
-// fnv-1.0.7 "default,std"
-// futures-core-0.3.7 "alloc,default,std"
-// instant-0.1.8
-// lazy_static-1.4.0
-// libc-0.2.80 "default,std"
-// lock_api-0.4.1
+// futures-core-0.3.8 "alloc,default,std"
+// instant-0.1.9
+// libc-0.2.81 "align,default,std"
+// lock_api-0.4.2
// log-0.4.11
// memchr-2.3.4 "default,std"
-// mio-0.7.4 "default,os-poll,os-util,tcp,udp,uds"
+// mio-0.7.6 "default,net,os-ext,os-poll,os-util,tcp,udp,uds"
// num_cpus-1.13.0
-// parking_lot-0.11.0 "default"
-// parking_lot_core-0.8.0
-// pin-project-lite-0.1.11
+// once_cell-1.5.2 "alloc,default,std"
+// parking_lot-0.11.1 "default"
+// parking_lot_core-0.8.2
+// pin-project-lite-0.2.0
// proc-macro2-1.0.24 "default,proc-macro"
-// quote-1.0.7 "default,proc-macro"
+// quote-1.0.8 "default,proc-macro"
// scopeguard-1.1.0
-// signal-hook-registry-1.2.1
+// signal-hook-registry-1.3.0
// slab-0.4.2
-// smallvec-1.4.2
-// syn-1.0.48 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote"
-// tokio-0.3.2 "bytes,default,fnv,fs,full,futures-core,io-std,io-util,lazy_static,libc,macros,memchr,mio,net,num_cpus,parking_lot,process,rt,rt-multi-thread,signal,signal-hook-registry,slab,stream,sync,time,tokio-macros,winapi"
-// tokio-macros-0.3.1
+// smallvec-1.5.1
+// syn-1.0.55 "clone-impls,default,derive,full,parsing,printing,proc-macro,quote"
+// tokio-0.3.6 "bytes,default,fs,full,futures-core,io-std,io-util,libc,macros,memchr,mio,net,num_cpus,once_cell,parking_lot,process,rt,rt-multi-thread,signal,signal-hook-registry,slab,stream,sync,time,tokio-macros,winapi"
+// tokio-macros-0.3.2
// unicode-xid-0.2.1 "default"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 50dfc39..881da1e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# 0.3.2 (December 19, 2020)
+
+### Fixed
+
+- fix outdated macro documentation ([#3180])
+- add portability note to `tokio::main` ([#3199])
+
# 0.3.1 (October 25, 2020)
### Fixed
@@ -51,3 +58,5 @@
[#2177]: https://github.com/tokio-rs/tokio/pull/2177
[#2225]: https://github.com/tokio-rs/tokio/pull/2225
[#3038]: https://github.com/tokio-rs/tokio/pull/3038
+[#3180]: https://github.com/tokio-rs/tokio/pull/3180
+[#3199]: https://github.com/tokio-rs/tokio/pull/3199
diff --git a/Cargo.toml b/Cargo.toml
index b702b0f..4dad0d6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,11 +13,11 @@
[package]
edition = "2018"
name = "tokio-macros"
-version = "0.3.1"
+version = "0.3.2"
authors = ["Tokio Contributors <team@tokio.rs>"]
description = "Tokio's proc macros.\n"
homepage = "https://tokio.rs"
-documentation = "https://docs.rs/tokio-macros/0.3.1/tokio_macros"
+documentation = "https://docs.rs/tokio-macros/0.3.2/tokio_macros"
categories = ["asynchronous"]
license = "MIT"
repository = "https://github.com/tokio-rs/tokio"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 5a594e7..7f312e8 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -7,13 +7,13 @@ name = "tokio-macros"
# - Cargo.toml
# - Update CHANGELOG.md.
# - Create "v0.3.x" git tag.
-version = "0.3.1"
+version = "0.3.2"
edition = "2018"
authors = ["Tokio Contributors <team@tokio.rs>"]
license = "MIT"
repository = "https://github.com/tokio-rs/tokio"
homepage = "https://tokio.rs"
-documentation = "https://docs.rs/tokio-macros/0.3.1/tokio_macros"
+documentation = "https://docs.rs/tokio-macros/0.3.2/tokio_macros"
description = """
Tokio's proc macros.
"""
diff --git a/METADATA b/METADATA
index adc2084..bd97fb7 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/tokio-macros/tokio-macros-0.3.1.crate"
+ value: "https://static.crates.io/crates/tokio-macros/tokio-macros-0.3.2.crate"
}
- version: "0.3.1"
+ version: "0.3.2"
license_type: NOTICE
last_upgrade_date {
year: 2020
- month: 10
- day: 28
+ month: 12
+ day: 22
}
}
diff --git a/src/entry.rs b/src/entry.rs
index f5c62a4..8f80499 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -193,17 +193,23 @@ fn parse_knobs(
let name = ident.unwrap().to_string().to_lowercase();
let msg = match name.as_str() {
"threaded_scheduler" | "multi_thread" => {
- format!("Set the runtime flavor with #[{}(flavor = \"multi_thread\")].", macro_name)
- },
+ format!(
+ "Set the runtime flavor with #[{}(flavor = \"multi_thread\")].",
+ macro_name
+ )
+ }
"basic_scheduler" | "current_thread" | "single_threaded" => {
- format!("Set the runtime flavor with #[{}(flavor = \"current_thread\")].", macro_name)
- },
+ format!(
+ "Set the runtime flavor with #[{}(flavor = \"current_thread\")].",
+ macro_name
+ )
+ }
"flavor" | "worker_threads" => {
format!("The `{}` attribute requires an argument.", name)
- },
+ }
name => {
format!("Unknown attribute {} is specified; expected one of: `flavor`, `worker_threads`", name)
- },
+ }
};
return Err(syn::Error::new_spanned(path, msg));
}
diff --git a/src/lib.rs b/src/lib.rs
index 5172258..b07005f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,4 @@
-#![doc(html_root_url = "https://docs.rs/tokio-macros/0.3.1")]
+#![doc(html_root_url = "https://docs.rs/tokio-macros/0.3.2")]
#![allow(clippy::needless_doctest_main)]
#![warn(
missing_debug_implementations,
@@ -35,6 +35,12 @@ use proc_macro::TokenStream;
/// [Builder](../tokio/runtime/struct.Builder.html), which provides a more
/// powerful interface.
///
+/// Note: This macro can be used on any function and not just the `main`
+/// function. Using it on a non-main function makes the function behave
+/// as if it was synchronous by starting a new runtime each time it is called.
+/// If the function is called often, it is preferable to create the runtime using
+/// the runtime builder so the runtime can be reused across calls.
+///
/// # Multi-threaded runtime
///
/// To use the multi-threaded runtime, the macro can be configured using
@@ -138,8 +144,8 @@ use proc_macro::TokenStream;
/// ### NOTE:
///
/// If you rename the tokio crate in your dependencies this macro will not work.
-/// If you must rename the 0.2 version of tokio because you're also using the
-/// 0.1 version of tokio, you _must_ make the tokio 0.2 crate available as
+/// If you must rename the 0.3 version of tokio because you're also using the
+/// 0.1 version of tokio, you _must_ make the tokio 0.3 crate available as
/// `tokio` in the module where this macro is expanded.
#[proc_macro_attribute]
#[cfg(not(test))] // Work around for rust-lang/rust#62127
@@ -183,9 +189,9 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
/// ### NOTE:
///
/// If you rename the tokio crate in your dependencies this macro
-/// will not work. If you must rename the 0.2 version of tokio because
+/// will not work. If you must rename the 0.3 version of tokio because
/// you're also using the 0.1 version of tokio, you _must_ make the
-/// tokio 0.2 crate available as `tokio` in the module where this
+/// tokio 0.3 crate available as `tokio` in the module where this
/// macro is expanded.
#[proc_macro_attribute]
#[cfg(not(test))] // Work around for rust-lang/rust#62127
@@ -208,7 +214,7 @@ pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream {
///
/// ### Using default
///
-/// The default test runtime is multi-threaded.
+/// The default test runtime is single-threaded.
///
/// ```no_run
/// #[tokio::test]
@@ -220,9 +226,9 @@ pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream {
/// ### NOTE:
///
/// If you rename the tokio crate in your dependencies this macro
-/// will not work. If you must rename the 0.2 version of tokio because
+/// will not work. If you must rename the 0.3 version of tokio because
/// you're also using the 0.1 version of tokio, you _must_ make the
-/// tokio 0.2 crate available as `tokio` in the module where this
+/// tokio 0.3 crate available as `tokio` in the module where this
/// macro is expanded.
#[proc_macro_attribute]
pub fn test(args: TokenStream, item: TokenStream) -> TokenStream {
@@ -243,9 +249,9 @@ pub fn test(args: TokenStream, item: TokenStream) -> TokenStream {
/// ### NOTE:
///
/// If you rename the tokio crate in your dependencies this macro
-/// will not work. If you must rename the 0.2 version of tokio because
+/// will not work. If you must rename the 0.3 version of tokio because
/// you're also using the 0.1 version of tokio, you _must_ make the
-/// tokio 0.2 crate available as `tokio` in the module where this
+/// tokio 0.3 crate available as `tokio` in the module where this
/// macro is expanded.
#[proc_macro_attribute]
pub fn test_rt(args: TokenStream, item: TokenStream) -> TokenStream {