macros: fix #[tokio::main] without rt-core (#2139)

The Tokio runtime provides a "shell" runtime when `rt-core` is not
available. This shell runtime is enough to support `#[tokio::main`] and
`#[tokio::test].

A previous change disabled these two attr macros when `rt-core` was not
selected. This patch fixes this by re-enabling the `main` and `test`
attr macros without `rt-core` and adds some integration tests to prevent
future regressions.
This commit is contained in:
Carl Lerche
2020-01-21 10:46:32 -08:00
committed by GitHub
parent fbe143b142
commit 38bff0adda
9 changed files with 451 additions and 369 deletions
+1
View File
@@ -1,4 +1,5 @@
#![warn(rust_2018_idioms)]
#![cfg(feature = "full")]
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
use tokio::process::{Child, Command};