diff options
-rw-r--r-- | .cargo_vcs_info.json | 7 | ||||
-rw-r--r-- | Android.bp | 22 | ||||
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | Cargo.toml.orig | 6 | ||||
-rw-r--r-- | METADATA | 10 | ||||
-rw-r--r-- | TEST_MAPPING | 216 | ||||
-rw-r--r-- | cargo2android.json | 4 | ||||
-rw-r--r-- | src/entry.rs | 10 | ||||
-rw-r--r-- | src/lib.rs | 1 |
10 files changed, 241 insertions, 45 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 13f94be..92e2ebe 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,5 @@ { "git": { - "sha1": "f64673580dfc649954eb744eb2734f2f118baa47" - }, - "path_in_vcs": "tokio-macros" -}
\ No newline at end of file + "sha1": "623c09c52c2c38a8d75e94c166593547e8477707" + } +} @@ -1,4 +1,4 @@ -// This file is generated by cargo2android.py --config cargo2android.json. +// This file is generated by cargo2android.py --run --dependencies --tests. // Do not modify this file as changes will be overridden on upgrade. package { @@ -21,8 +21,6 @@ license { rust_proc_macro { name: "libtokio_macros", crate_name: "tokio_macros", - cargo_env_compat: true, - cargo_pkg_version: "1.7.0", srcs: ["src/lib.rs"], edition: "2018", rustlibs: [ @@ -31,3 +29,21 @@ rust_proc_macro { "libsyn", ], } + +rust_test_host { + name: "tokio-macros_host_test_src_lib", + crate_name: "tokio_macros", + srcs: ["src/lib.rs"], + test_suites: ["general-tests"], + auto_gen_config: true, + test_options: { + unit_test: true, + }, + edition: "2018", + rustlibs: [ + "libproc_macro2", + "libquote", + "libsyn", + "libtokio", + ], +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 633b43f..eb5504c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,3 @@ -# 1.7.0 (December 15th, 2021) - -- macros: address remainging clippy::semicolon_if_nothing_returned warning ([#4252]) - -[#4252]: https://github.com/tokio-rs/tokio/pull/4252 - # 1.6.0 (November 16th, 2021) - macros: fix mut patterns in `select!` macro ([#4211]) @@ -11,12 +11,12 @@ [package] edition = "2018" -rust-version = "1.46" name = "tokio-macros" -version = "1.7.0" +version = "1.6.0" authors = ["Tokio Contributors <team@tokio.rs>"] description = "Tokio's proc macros.\n" homepage = "https://tokio.rs" +documentation = "https://docs.rs/tokio-macros/1.6.0/tokio_macros" categories = ["asynchronous"] license = "MIT" repository = "https://github.com/tokio-rs/tokio" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index d9b0579..2114cd2 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -2,15 +2,17 @@ name = "tokio-macros" # When releasing to crates.io: # - Remove path dependencies +# - Update doc url +# - Cargo.toml # - Update CHANGELOG.md. # - Create "tokio-macros-1.0.x" git tag. -version = "1.7.0" +version = "1.6.0" edition = "2018" -rust-version = "1.46" 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/1.6.0/tokio_macros" description = """ Tokio's proc macros. """ @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/tokio-macros/tokio-macros-1.7.0.crate" + value: "https://static.crates.io/crates/tokio-macros/tokio-macros-1.6.0.crate" } - version: "1.7.0" + version: "1.6.0" license_type: NOTICE last_upgrade_date { - year: 2022 - month: 3 - day: 1 + year: 2021 + month: 11 + day: 16 } } diff --git a/TEST_MAPPING b/TEST_MAPPING index de9aee1..6c266ef 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,30 +1,218 @@ // Generated by update_crate_tests.py for tests that depend on this crate. { - "imports": [ + "presubmit": [ { - "path": "external/rust/crates/futures-util" + "name": "doh_unit_test" }, { - "path": "external/rust/crates/tokio" + "name": "futures-util_device_test_src_lib" }, { - "path": "external/rust/crates/tokio-test" - } - ], - "presubmit": [ + "name": "tokio-test_device_test_src_lib" + }, { - "name": "doh_unit_test" + "name": "tokio-test_device_test_tests_block_on" }, { - "name": "rustBinderTest" - } - ], - "presubmit-rust": [ + "name": "tokio-test_device_test_tests_io" + }, { - "name": "doh_unit_test" + "name": "tokio-test_device_test_tests_macros" + }, + { + "name": "tokio_device_test_tests__require_full" + }, + { + "name": "tokio_device_test_tests_buffered" + }, + { + "name": "tokio_device_test_tests_io_async_fd" + }, + { + "name": "tokio_device_test_tests_io_async_read" + }, + { + "name": "tokio_device_test_tests_io_chain" + }, + { + "name": "tokio_device_test_tests_io_copy" + }, + { + "name": "tokio_device_test_tests_io_copy_bidirectional" + }, + { + "name": "tokio_device_test_tests_io_driver" + }, + { + "name": "tokio_device_test_tests_io_driver_drop" + }, + { + "name": "tokio_device_test_tests_io_lines" + }, + { + "name": "tokio_device_test_tests_io_mem_stream" + }, + { + "name": "tokio_device_test_tests_io_read" + }, + { + "name": "tokio_device_test_tests_io_read_buf" + }, + { + "name": "tokio_device_test_tests_io_read_exact" + }, + { + "name": "tokio_device_test_tests_io_read_line" + }, + { + "name": "tokio_device_test_tests_io_read_to_end" + }, + { + "name": "tokio_device_test_tests_io_read_to_string" + }, + { + "name": "tokio_device_test_tests_io_read_until" + }, + { + "name": "tokio_device_test_tests_io_split" + }, + { + "name": "tokio_device_test_tests_io_take" + }, + { + "name": "tokio_device_test_tests_io_write" + }, + { + "name": "tokio_device_test_tests_io_write_all" + }, + { + "name": "tokio_device_test_tests_io_write_buf" + }, + { + "name": "tokio_device_test_tests_io_write_int" + }, + { + "name": "tokio_device_test_tests_macros_join" + }, + { + "name": "tokio_device_test_tests_macros_pin" + }, + { + "name": "tokio_device_test_tests_macros_select" + }, + { + "name": "tokio_device_test_tests_macros_test" + }, + { + "name": "tokio_device_test_tests_macros_try_join" + }, + { + "name": "tokio_device_test_tests_net_bind_resource" + }, + { + "name": "tokio_device_test_tests_net_lookup_host" + }, + { + "name": "tokio_device_test_tests_no_rt" + }, + { + "name": "tokio_device_test_tests_process_kill_on_drop" + }, + { + "name": "tokio_device_test_tests_rt_basic" + }, + { + "name": "tokio_device_test_tests_rt_common" + }, + { + "name": "tokio_device_test_tests_rt_threaded" + }, + { + "name": "tokio_device_test_tests_sync_barrier" + }, + { + "name": "tokio_device_test_tests_sync_broadcast" + }, + { + "name": "tokio_device_test_tests_sync_errors" + }, + { + "name": "tokio_device_test_tests_sync_mpsc" + }, + { + "name": "tokio_device_test_tests_sync_mutex" + }, + { + "name": "tokio_device_test_tests_sync_mutex_owned" + }, + { + "name": "tokio_device_test_tests_sync_notify" + }, + { + "name": "tokio_device_test_tests_sync_oneshot" + }, + { + "name": "tokio_device_test_tests_sync_rwlock" + }, + { + "name": "tokio_device_test_tests_sync_semaphore" + }, + { + "name": "tokio_device_test_tests_sync_semaphore_owned" + }, + { + "name": "tokio_device_test_tests_sync_watch" + }, + { + "name": "tokio_device_test_tests_task_abort" + }, + { + "name": "tokio_device_test_tests_task_blocking" + }, + { + "name": "tokio_device_test_tests_task_local" + }, + { + "name": "tokio_device_test_tests_task_local_set" + }, + { + "name": "tokio_device_test_tests_tcp_accept" + }, + { + "name": "tokio_device_test_tests_tcp_connect" + }, + { + "name": "tokio_device_test_tests_tcp_echo" + }, + { + "name": "tokio_device_test_tests_tcp_into_split" + }, + { + "name": "tokio_device_test_tests_tcp_into_std" + }, + { + "name": "tokio_device_test_tests_tcp_peek" + }, + { + "name": "tokio_device_test_tests_tcp_shutdown" + }, + { + "name": "tokio_device_test_tests_tcp_socket" + }, + { + "name": "tokio_device_test_tests_tcp_split" + }, + { + "name": "tokio_device_test_tests_time_rt" + }, + { + "name": "tokio_device_test_tests_udp" + }, + { + "name": "tokio_device_test_tests_uds_cred" }, { - "name": "rustBinderTest" + "name": "tokio_device_test_tests_uds_split" } ] } diff --git a/cargo2android.json b/cargo2android.json deleted file mode 100644 index 341300b..0000000 --- a/cargo2android.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "run": true, - "tests": true -}
\ No newline at end of file diff --git a/src/entry.rs b/src/entry.rs index 5cb4a49..01f8ee4 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -339,17 +339,17 @@ fn parse_knobs(mut input: syn::ItemFn, is_test: bool, config: FinalConfig) -> To let body = &input.block; let brace_token = input.block.brace_token; let (tail_return, tail_semicolon) = match body.stmts.last() { - Some(syn::Stmt::Semi(syn::Expr::Return(_), _)) => (quote! { return }, quote! { ; }), - Some(syn::Stmt::Semi(..)) | Some(syn::Stmt::Local(..)) | None => { - match &input.sig.output { + Some(syn::Stmt::Semi(expr, _)) => match expr { + syn::Expr::Return(_) => (quote! { return }, quote! { ; }), + _ => match &input.sig.output { syn::ReturnType::Type(_, ty) if matches!(&**ty, syn::Type::Tuple(ty) if ty.elems.is_empty()) => { (quote! {}, quote! { ; }) // unit } syn::ReturnType::Default => (quote! {}, quote! { ; }), // unit syn::ReturnType::Type(..) => (quote! {}, quote! {}), // ! or another - } - } + }, + }, _ => (quote! {}, quote! {}), }; input.block = syn::parse2(quote_spanned! {last_stmt_end_span=> @@ -5,6 +5,7 @@ rust_2018_idioms, unreachable_pub )] +#![cfg_attr(docsrs, deny(rustdoc::broken_intra_doc_links))] #![doc(test( no_crate_inject, attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) |