forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#106188 - bryangarza:bug-104588-async-track-ca…
…ller_beta-backport, r=compiler-errors Backport: Switch `#[track_caller]` back to a no-op unless feature gate is enabled Backport of rust-lang#104741 r? `@compiler-errors` since you reviewed the original PR requested by `@Mark-Simulacrum` rust-lang#104741 (comment)
- Loading branch information
Showing
8 changed files
with
149 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// edition:2021 | ||
|
||
#![feature(async_closure, stmt_expr_attributes)] | ||
|
||
fn main() { | ||
let _ = #[track_caller] async || { | ||
//~^ ERROR `#[track_caller]` on closures is currently unstable [E0658] | ||
}; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/async-await/track-caller/async-closure-gate.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,12 @@ | ||
error[E0658]: `#[track_caller]` on closures is currently unstable | ||
--> $DIR/async-closure-gate.rs:6: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: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
29 changes: 29 additions & 0 deletions
29
src/test/ui/async-await/track-caller/panic-track-caller.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,29 @@ | ||
warning: `#[track_caller]` on async functions is a no-op | ||
--> $DIR/panic-track-caller.rs:50:1 | ||
| | ||
LL | #[track_caller] | ||
| ^^^^^^^^^^^^^^^ | ||
LL | / async fn bar_track_caller() { | ||
LL | | panic!() | ||
LL | | } | ||
| |_- this function will not propagate the caller location | ||
| | ||
= 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 | ||
= note: `#[warn(ungated_async_fn_track_caller)]` on by default | ||
|
||
warning: `#[track_caller]` on async functions is a no-op | ||
--> $DIR/panic-track-caller.rs:62:5 | ||
| | ||
LL | #[track_caller] | ||
| ^^^^^^^^^^^^^^^ | ||
LL | / async fn bar_assoc() { | ||
LL | | panic!(); | ||
LL | | } | ||
| |_____- this function will not propagate the caller location | ||
| | ||
= 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 | ||
|
||
warning: 2 warnings emitted | ||
|
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