skip the uninhabitated check and comments
This commit is contained in:
parent
67ee91e77e
commit
74ea16301e
12 changed files with 59 additions and 26 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
8
src/test/ui/lint/must_not_suspend/other_items.rs
Normal file
8
src/test/ui/lint/must_not_suspend/other_items.rs
Normal file
|
|
@ -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() {}
|
||||
10
src/test/ui/lint/must_not_suspend/other_items.stderr
Normal file
10
src/test/ui/lint/must_not_suspend/other_items.stderr
Normal file
|
|
@ -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
|
||||
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue