Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tail call checks wrt #[track_caller] #135973

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

WaffleLapkin
Copy link
Member

Only check the caller + disallow caller having the attribute.

fixes #134336

r? @compiler-errors

apparently there were no tests for #[track_caller] before... ooops

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 24, 2025
@WaffleLapkin WaffleLapkin added the F-explicit_tail_calls `#![feature(explicit_tail_calls)]` label Jan 24, 2025
@rust-log-analyzer

This comment has been minimized.

@WaffleLapkin WaffleLapkin force-pushed the tail-track-caller-fix branch from 032f4e7 to d746614 Compare January 24, 2025 19:14
@rust-log-analyzer

This comment has been minimized.

@WaffleLapkin WaffleLapkin force-pushed the tail-track-caller-fix branch from d746614 to e4229ac Compare January 24, 2025 19:56
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me after nit

// so a `track_caller` can only tail call other `track_caller` functions.
//
// The issue is however that we can't know if a function is `track_caller` or not at
// this point (THIR can be polymorthic, we may have an unresolved trait function).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// this point (THIR can be polymorthic, we may have an unresolved trait function).
// this point (THIR can be polymorphic, we may have an unresolved trait function).

Or you can say "generic" here if you want it to be understandable to more general audience :3

@compiler-errors
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2025
only check the caller + disallow caller having the attr.
@WaffleLapkin WaffleLapkin force-pushed the tail-track-caller-fix branch from e4229ac to 992e3b4 Compare February 6, 2025 20:08
@WaffleLapkin
Copy link
Member Author

@bors r=compiler-errors rollup

@bors
Copy link
Contributor

bors commented Feb 6, 2025

📌 Commit 992e3b4 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 6, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 6, 2025
…, r=compiler-errors

fix tail call checks wrt `#[track_caller]`

Only check the caller + disallow caller having the attribute.

fixes rust-lang#134336

r? `@compiler-errors`

<sub>apparently there were no tests for `#[track_caller]` before... ooops</sub>
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#135973 (fix tail call checks wrt `#[track_caller]`)
 - rust-lang#136191 (compiler: replace few consts arrays with statics to remove const dupes)
 - rust-lang#136565 (compiler: Clean up weird `rustc_abi` reexports)
 - rust-lang#136582 (Revert "CI: build FreeBSD artifacts on FreeBSD 13.4")
 - rust-lang#136592 (Make sure we don't overrun the stack in canonicalizer)
 - rust-lang#136627 (MIR validation: add comment explaining the limitations of CfgChecker)
 - rust-lang#136634 (Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.)
 - rust-lang#136643 (ping me for attribute-related changes)
 - rust-lang#136644 (Add `rustc_hir_pretty::item_to_string` function)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#135973 (fix tail call checks wrt `#[track_caller]`)
 - rust-lang#136191 (compiler: replace few consts arrays with statics to remove const dupes)
 - rust-lang#136565 (compiler: Clean up weird `rustc_abi` reexports)
 - rust-lang#136582 (Revert "CI: build FreeBSD artifacts on FreeBSD 13.4")
 - rust-lang#136627 (MIR validation: add comment explaining the limitations of CfgChecker)
 - rust-lang#136634 (Stabilise `Cursor::{get_mut, set_position}` in `const` scenarios.)
 - rust-lang#136643 (ping me for attribute-related changes)
 - rust-lang#136644 (Add `rustc_hir_pretty::item_to_string` function)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1c794b9 into rust-lang:master Feb 7, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 7, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
Rollup merge of rust-lang#135973 - WaffleLapkin:tail-track-caller-fix, r=compiler-errors

fix tail call checks wrt `#[track_caller]`

Only check the caller + disallow caller having the attribute.

fixes rust-lang#134336

r? `@compiler-errors`

<sub>apparently there were no tests for `#[track_caller]` before... ooops</sub>
@WaffleLapkin WaffleLapkin deleted the tail-track-caller-fix branch February 7, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-explicit_tail_calls `#![feature(explicit_tail_calls)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: failed to resolve instance for <Self as EnvFuture>::g
5 participants