forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#112117 - bryangarza:track-caller-feature-gate…
…, r=compiler-errors Add separate feature gate for async fn track caller This patch adds a feature gate `async_fn_track_caller` that is separate from `closure_track_caller`. This is to allow enabling `async_fn_track_caller` separately. Fixes rust-lang#110009
- Loading branch information
Showing
20 changed files
with
326 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-block.rs:8:13 | ||
| | ||
LL | let _ = #[track_caller] async { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-block.rs:15:13 | ||
| | ||
LL | let _ = #[track_caller] async { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-block.rs:23:17 | ||
| | ||
LL | let _ = #[track_caller] async { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
30 changes: 30 additions & 0 deletions
30
tests/ui/async-await/track-caller/async-block.nofeat.stderr
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-block.rs:8:13 | ||
| | ||
LL | let _ = #[track_caller] async { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-block.rs:15:13 | ||
| | ||
LL | let _ = #[track_caller] async { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-block.rs:23:17 | ||
| | ||
LL | let _ = #[track_caller] async { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
// edition:2021 | ||
// revisions: afn nofeat | ||
|
||
#![feature(stmt_expr_attributes)] | ||
#![cfg_attr(afn, feature(async_fn_track_caller))] | ||
|
||
fn main() { | ||
let _ = #[track_caller] async { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
} | ||
|
||
#[track_caller] | ||
async fn foo() { | ||
let _ = #[track_caller] async { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
} | ||
|
||
#[track_caller] | ||
async fn foo2() { | ||
let _ = async { | ||
let _ = #[track_caller] async { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
tests/ui/async-await/track-caller/async-closure-gate.afn.stderr
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:8:13 | ||
| | ||
LL | let _ = #[track_caller] async || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:15:13 | ||
| | ||
LL | let _ = #[track_caller] async || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:21:13 | ||
| | ||
LL | let _ = #[track_caller] || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:28:17 | ||
| | ||
LL | let _ = #[track_caller] || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:36:9 | ||
| | ||
LL | #[track_caller] || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:45:13 | ||
| | ||
LL | #[track_caller] || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error: aborting due to 6 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
57 changes: 57 additions & 0 deletions
57
tests/ui/async-await/track-caller/async-closure-gate.nofeat.stderr
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:8:13 | ||
| | ||
LL | let _ = #[track_caller] async || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:15:13 | ||
| | ||
LL | let _ = #[track_caller] async || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:21:13 | ||
| | ||
LL | let _ = #[track_caller] || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:28:17 | ||
| | ||
LL | let _ = #[track_caller] || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:36:9 | ||
| | ||
LL | #[track_caller] || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:45:13 | ||
| | ||
LL | #[track_caller] || { | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information | ||
= help: add `#![feature(closure_track_caller)]` to the crate attributes to enable | ||
|
||
error: aborting due to 6 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,50 @@ | ||
// edition:2021 | ||
// revisions: afn nofeat | ||
|
||
#![feature(async_closure, stmt_expr_attributes)] | ||
#![cfg_attr(afn, feature(async_fn_track_caller))] | ||
|
||
fn main() { | ||
let _ = #[track_caller] async || { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
} | ||
|
||
#[track_caller] | ||
async fn foo() { | ||
let _ = #[track_caller] async || { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
} | ||
|
||
async fn foo2() { | ||
let _ = #[track_caller] || { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
} | ||
|
||
fn foo3() { | ||
async { | ||
let _ = #[track_caller] || { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
} | ||
} | ||
|
||
async fn foo4() { | ||
let _ = || { | ||
#[track_caller] || { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
}; | ||
} | ||
|
||
fn foo5() { | ||
async { | ||
let _ = || { | ||
#[track_caller] || { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
}; | ||
} | ||
} |
Oops, something went wrong.