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

Make processing of entrypoints more efficient #4513

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
508959c
Make processing of entrypoints more efficient
udoprog Feb 17, 2022
b520907
Abide by minimum Rust requirement
udoprog Feb 17, 2022
b593c90
Fix clippy lints
udoprog Feb 17, 2022
61ea5f9
Make sure to test for missing runtime
udoprog Feb 17, 2022
59e648f
Skip over angle brackets and treat last braced block seen as body
udoprog Feb 18, 2022
5369043
rustfmt
udoprog Feb 18, 2022
6122d6d
fix trybuild output
udoprog Feb 18, 2022
ce27bec
Trim more stuff from patterns
udoprog Feb 18, 2022
439841d
Bump async-stream dependency to 0.3.2 to avoid minimal-versions issue
udoprog Feb 18, 2022
dcc8a7a
Perform return type heuristics to determine when to return and not
udoprog Feb 18, 2022
04e95aa
Actually implement heuristics
udoprog Feb 19, 2022
5824c57
Update tokio-macros/src/select.rs
udoprog Feb 19, 2022
b78862f
Improve return heuristics by checking for `where`
udoprog Feb 19, 2022
5c97ae4
Only do find_last_stmt_range for last block found
udoprog Feb 19, 2022
9d83d83
Ensure that skip_angle_brackets skips over composite tokens that cont…
udoprog Feb 19, 2022
27ea4b8
rustfmt
udoprog Feb 19, 2022
7d74def
Fix logic for determining continutations in skip_angle_brackets
udoprog Feb 19, 2022
3de31aa
Ensure we're always reporting some error about failing to process
udoprog Feb 19, 2022
d924545
Ensure we always print some error when failing to expand
udoprog Feb 19, 2022
fd293b7
Add groups_in_return_position test
udoprog Feb 20, 2022
4e3c5b6
Merge remote-tracking branch 'upstream/master' into entrypoints
udoprog Feb 25, 2022
c71a888
Regenerate trybuild with -Dwarnings
udoprog Feb 25, 2022
df3cbb6
deny duplicate_macro_attributes
udoprog Feb 26, 2022
d48f452
Merge remote-tracking branch 'upstream/master' into entrypoints
udoprog Mar 24, 2022
e314165
bump tracing dependency to abide by minimal-versions
udoprog Mar 24, 2022
59d49ff
bump tracing in tokio-util
udoprog Mar 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests-build/tests/fail/macros_core_no_default.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: The default runtime flavor is `multi_thread`, but the `rt-multi-thread` feature is disabled.
--> $DIR/macros_core_no_default.rs:3:1
error: the default runtime flavor is `multi_thread`, but the `rt-multi-thread` feature is disabled
--> tests/fail/macros_core_no_default.rs:3:1
|
3 | #[tokio::main]
| ^^^^^^^^^^^^^^
Expand Down
58 changes: 20 additions & 38 deletions tests-build/tests/fail/macros_invalid_input.stderr
Original file line number Diff line number Diff line change
@@ -1,71 +1,53 @@
error: the `async` keyword is missing from the function declaration
--> $DIR/macros_invalid_input.rs:4:1
error: functions marked with `#[tokio::main]` must be `async`
--> tests/fail/macros_invalid_input.rs:4:1
|
4 | fn main_is_not_async() {}
| ^^

error: Unknown attribute foo is specified; expected one of: `flavor`, `worker_threads`, `start_paused`
--> $DIR/macros_invalid_input.rs:6:15
error: unknown option `foo`, expected one of: `flavor`, `worker_threads`, `start_paused`
--> tests/fail/macros_invalid_input.rs:6:15
|
6 | #[tokio::main(foo)]
| ^^^

error: Must have specified ident
--> $DIR/macros_invalid_input.rs:9:15
error: unknown option `threadpool`, expected one of: `flavor`, `worker_threads`, `start_paused`
--> tests/fail/macros_invalid_input.rs:9:15
|
9 | #[tokio::main(threadpool::bar)]
| ^^^^^^^^^^^^^^^
| ^^^^^^^^^^

error: the `async` keyword is missing from the function declaration
--> $DIR/macros_invalid_input.rs:13:1
error: functions marked with `#[tokio::test]` must be `async`
--> tests/fail/macros_invalid_input.rs:13:1
|
13 | fn test_is_not_async() {}
| ^^

error: Unknown attribute foo is specified; expected one of: `flavor`, `worker_threads`, `start_paused`
--> $DIR/macros_invalid_input.rs:15:15
error: unknown option `foo`, expected one of: `flavor`, `worker_threads`, `start_paused`
--> tests/fail/macros_invalid_input.rs:15:15
|
15 | #[tokio::test(foo)]
| ^^^

error: Unknown attribute foo is specified; expected one of: `flavor`, `worker_threads`, `start_paused`
--> $DIR/macros_invalid_input.rs:18:15
error: unknown option `foo`, expected one of: `flavor`, `worker_threads`, `start_paused`
--> tests/fail/macros_invalid_input.rs:18:15
|
18 | #[tokio::test(foo = 123)]
| ^^^^^^^^^
| ^^^

error: Failed to parse value of `flavor` as string.
--> $DIR/macros_invalid_input.rs:21:24
error: no such runtime flavor, the runtime flavors are: "current_thread", "multi_thread"
--> tests/fail/macros_invalid_input.rs:21:24
|
21 | #[tokio::test(flavor = 123)]
| ^^^

error: No such runtime flavor `foo`. The runtime flavors are `current_thread` and `multi_thread`.
--> $DIR/macros_invalid_input.rs:24:24
error: no such runtime flavor, the runtime flavors are: "current_thread", "multi_thread"
--> tests/fail/macros_invalid_input.rs:24:24
|
24 | #[tokio::test(flavor = "foo")]
| ^^^^^

error: The `start_paused` option requires the `current_thread` runtime flavor. Use `#[tokio::test(flavor = "current_thread")]`
--> $DIR/macros_invalid_input.rs:27:55
|
27 | #[tokio::test(flavor = "multi_thread", start_paused = false)]
| ^^^^^

error: Failed to parse value of `worker_threads` as integer.
--> $DIR/macros_invalid_input.rs:30:57
|
30 | #[tokio::test(flavor = "multi_thread", worker_threads = "foo")]
| ^^^^^

error: The `worker_threads` option requires the `multi_thread` runtime flavor. Use `#[tokio::test(flavor = "multi_thread")]`
--> $DIR/macros_invalid_input.rs:33:59
error: the `worker_threads` option requires the "multi_thread" runtime flavor. Use `#[tokio::test(flavor = "multi_thread")]`
--> tests/fail/macros_invalid_input.rs:33:59
|
33 | #[tokio::test(flavor = "current_thread", worker_threads = 4)]
| ^

error: second test attribute is supplied
--> $DIR/macros_invalid_input.rs:37:1
|
37 | #[test]
| ^^^^^^^
7 changes: 0 additions & 7 deletions tokio-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ categories = ["asynchronous"]
[lib]
proc-macro = true

[features]

[dependencies]
proc-macro2 = "1.0.7"
quote = "1"
syn = { version = "1.0.56", features = ["full"] }

[dev-dependencies]
tokio = { version = "1.0.0", path = "../tokio", features = ["full"] }

Expand Down