1
Fork 0

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
This commit is contained in:
Bryan Garza 2022-11-22 21:15:27 +00:00
parent 1d12c3cea3
commit 04926e0534
6 changed files with 157 additions and 1 deletions

View file

@ -350,6 +350,8 @@ lint_builtin_mutable_transmutes =
lint_builtin_unstable_features = unstable feature
lint_ungated_async_fn_track_caller = `#[track_caller]` on async functions is a no-op, unless the `closure_track_caller` feature is enabled
lint_builtin_unreachable_pub = unreachable `pub` {$what}
.suggestion = consider restricting its visibility
.help = or consider exporting it for use by other crates