diff options
| author | Gus Wynn <guswynn@gmail.com> | 2021-09-11 12:06:05 -0700 |
|---|---|---|
| committer | Gus Wynn <guswynn@gmail.com> | 2021-09-11 12:10:06 -0700 |
| commit | 74ea16301e2e6fb96ac8414761cf227775e64dfd (patch) | |
| tree | 5bbaa2232ffa96371ce0555199d7dadf8740d0e1 /src/test | |
| parent | 67ee91e77e8106357df63fc2d4b6f04f36ccd2da (diff) | |
| download | rust-74ea16301e2e6fb96ac8414761cf227775e64dfd.tar.gz rust-74ea16301e2e6fb96ac8414761cf227775e64dfd.zip | |
skip the uninhabitated check and comments
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/boxed.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/other_items.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/other_items.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/return.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/return.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/trait.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/unit.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/lint/must_not_suspend/warn.rs | 2 |
9 files changed, 27 insertions, 9 deletions
diff --git a/src/test/ui/lint/must_not_suspend/boxed.rs b/src/test/ui/lint/must_not_suspend/boxed.rs index d64d07e5e0d..1f823fc559d 100644 --- a/src/test/ui/lint/must_not_suspend/boxed.rs +++ b/src/test/ui/lint/must_not_suspend/boxed.rs @@ -17,7 +17,7 @@ fn bar() -> Box<Umm> { async fn other() {} pub async fn uhoh() { - let _guard = bar(); //~ boxed `Umm` held across + let _guard = bar(); //~ ERROR boxed `Umm` held across other().await; } diff --git a/src/test/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs b/src/test/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs index aff8ff33b65..1554408c174 100644 --- a/src/test/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs +++ b/src/test/ui/lint/must_not_suspend/feature-gate-must_not_suspend.rs @@ -1,6 +1,6 @@ // edition:2018 -#[must_not_suspend = "You gotta use Umm's, ya know?"] //~ the `#[must_not_suspend]` +#[must_not_suspend = "You gotta use Umm's, ya know?"] //~ ERROR the `#[must_not_suspend]` struct Umm { _i: i64 } diff --git a/src/test/ui/lint/must_not_suspend/other_items.rs b/src/test/ui/lint/must_not_suspend/other_items.rs new file mode 100644 index 00000000000..5aa1abb14d3 --- /dev/null +++ b/src/test/ui/lint/must_not_suspend/other_items.rs @@ -0,0 +1,8 @@ +// edition:2018 +#![feature(must_not_suspend)] +#![deny(must_not_suspend)] + +#[must_not_suspend] //~ ERROR attribute should be +mod inner {} + +fn main() {} diff --git a/src/test/ui/lint/must_not_suspend/other_items.stderr b/src/test/ui/lint/must_not_suspend/other_items.stderr new file mode 100644 index 00000000000..41c8896921b --- /dev/null +++ b/src/test/ui/lint/must_not_suspend/other_items.stderr @@ -0,0 +1,10 @@ +error: `must_not_suspend` attribute should be applied to a struct, enum, or trait + --> $DIR/other_items.rs:5:1 + | +LL | #[must_not_suspend] + | ^^^^^^^^^^^^^^^^^^^ +LL | mod inner {} + | ------------ is not a struct, enum, or trait + +error: aborting due to previous error + diff --git a/src/test/ui/lint/must_not_suspend/return.rs b/src/test/ui/lint/must_not_suspend/return.rs index 5f80e789376..5b1fa5e2721 100644 --- a/src/test/ui/lint/must_not_suspend/return.rs +++ b/src/test/ui/lint/must_not_suspend/return.rs @@ -2,7 +2,7 @@ #![feature(must_not_suspend)] #![deny(must_not_suspend)] -#[must_not_suspend] //~ attribute should be +#[must_not_suspend] //~ ERROR attribute should be fn foo() -> i32 { 0 } diff --git a/src/test/ui/lint/must_not_suspend/return.stderr b/src/test/ui/lint/must_not_suspend/return.stderr index ff1798320cf..fdada85eb4d 100644 --- a/src/test/ui/lint/must_not_suspend/return.stderr +++ b/src/test/ui/lint/must_not_suspend/return.stderr @@ -1,4 +1,4 @@ -error: `must_not_suspend` attribute should be applied to a struct, enum, `impl Trait`, or `dyn Trait` +error: `must_not_suspend` attribute should be applied to a struct, enum, or trait --> $DIR/return.rs:5:1 | LL | #[must_not_suspend] @@ -6,7 +6,7 @@ LL | #[must_not_suspend] LL | / fn foo() -> i32 { LL | | 0 LL | | } - | |_- is a function + | |_- is not a struct, enum, or trait error: aborting due to previous error diff --git a/src/test/ui/lint/must_not_suspend/trait.rs b/src/test/ui/lint/must_not_suspend/trait.rs index 0438e072ce6..6c911cb4b0f 100644 --- a/src/test/ui/lint/must_not_suspend/trait.rs +++ b/src/test/ui/lint/must_not_suspend/trait.rs @@ -18,8 +18,8 @@ fn r#dyn() -> Box<dyn Wow> { async fn other() {} pub async fn uhoh() { - let _guard1 = r#impl(); //~ implementer of `Wow` held across - let _guard2 = r#dyn(); //~ boxed `Wow` trait object held across + let _guard1 = r#impl(); //~ ERROR implementer of `Wow` held across + let _guard2 = r#dyn(); //~ ERROR boxed `Wow` trait object held across other().await; } diff --git a/src/test/ui/lint/must_not_suspend/unit.rs b/src/test/ui/lint/must_not_suspend/unit.rs index 4e87b801114..d3a19f70432 100644 --- a/src/test/ui/lint/must_not_suspend/unit.rs +++ b/src/test/ui/lint/must_not_suspend/unit.rs @@ -17,7 +17,7 @@ fn bar() -> Umm { async fn other() {} pub async fn uhoh() { - let _guard = bar(); //~ `Umm` held across + let _guard = bar(); //~ ERROR `Umm` held across other().await; } diff --git a/src/test/ui/lint/must_not_suspend/warn.rs b/src/test/ui/lint/must_not_suspend/warn.rs index d0d72384807..50a696ba523 100644 --- a/src/test/ui/lint/must_not_suspend/warn.rs +++ b/src/test/ui/lint/must_not_suspend/warn.rs @@ -17,7 +17,7 @@ fn bar() -> Umm { async fn other() {} pub async fn uhoh() { - let _guard = bar(); //~ `Umm` held across + let _guard = bar(); //~ WARNING `Umm` held across other().await; } |
