macros: Disambiguate the built-in #[test] attribute in macro expansion.#2503
Merged
Darksonn merged 1 commit intotokio-rs:masterfrom May 12, 2020
Merged
macros: Disambiguate the built-in #[test] attribute in macro expansion.#2503Darksonn merged 1 commit intotokio-rs:masterfrom
Darksonn merged 1 commit intotokio-rs:masterfrom
Conversation
LucioFranco
approved these changes
May 9, 2020
Member
LucioFranco
left a comment
There was a problem hiding this comment.
I assume this is not a breaking change?
Contributor
Author
I guess that depends on whether or not this is supposed to be supported today: use some_other_lib::test;
#[tokio::test]
async fn some_test() { }Currently, the |
Member
|
seems fine to me |
Member
|
CI appears to be stuck, and I can't restart it. |
`tokio::test` and related macros now use the absolute path `::core::prelude::v1::test` to refer to the built-in `test` macro. This absolute path was introduced in rust-lang/rust#62086.
2077109 to
a7e6771
Compare
Contributor
Author
|
The CI failures (on Windows) appear to be unrelated to this change: They look familiar, but I don't know off the top of my head which other PR did this. |
jensim
pushed a commit
to jensim/tokio
that referenced
this pull request
Jun 7, 2020
tokio-rs#2503) `tokio::test` and related macros now use the absolute path `::core::prelude::v1::test` to refer to the built-in `test` macro. This absolute path was introduced in rust-lang/rust#62086.
|
I want to know how to test async function. |
Member
|
Please open a new discussion if you have a question. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tokio::testand related macros now use the absolute path::core::prelude::v1::testto refer to the built-intestmacro.This absolute path was introduced in rust-lang/rust#62086.
Motivation
The following example currently fails due to shadowing of the
testmacro (playground):