-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #104741 - bryangarza:bug-104588-async-track-caller, r…
…=compiler-errors Switch `#[track_caller]` back to a no-op unless feature gate is enabled This patch fixes a regression, in which `#[track_caller]`, which was previously a no-op, was changed to actually turn on the behavior. This should instead only happen behind the `closure_track_caller` feature gate. Also, add a warning for the user to understand how their code will compile depending on the feature gate being turned on or not. Fixes #104588
- Loading branch information
Showing
8 changed files
with
134 additions
and
34 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
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