-
Notifications
You must be signed in to change notification settings - Fork 389
Don't back up past the caller when looking for an FnEntry span #2537
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
Conversation
What's still confusing me here is that I would expect a FnEntry retag to point at the beginning of a fn call. |
That's not how these spans work in general. Perhaps adding the detail about the "FnEntry retag" but not suggesting that it may be above this on the stack (my brain want to say below, but I suppose based on the above we'd say above) is what's confusing? These spans always walk the stack from the top until they get to some code in the local project, because that is usually where the user can take action. I think the ideal output here would include both a local span which indicates where the issue is in the user's code, and also the FnEntry span which points at the argument, and possibly to another library's internals. I'll update with an attempt at that soon. |
Conceptually, stacks always grow upwards. Have you ever tried adding something to the bottom of a stack of books? ;) The fact that on x86 in the call stack, "higher" frames are located at "smaller" memory addresses, is entirely an implementation detail of how the stack is represented in the machine, but changes nothing about the conceptual orientation of the stack. IMO. |
Makes sense, though we can also make this a separate PR -- now that I understand the spec and purpose of |
e7ba7ec
to
d2a1782
Compare
☔ The latest upstream changes (presumably #2548) made this pull request unmergeable. Please resolve the merge conflicts. |
d2a1782
to
546fdc1
Compare
7091efe
to
42f64f7
Compare
Thanks! |
☀️ Test successful - checks-actions |
Fixes #2536
This adds a fix for the logic as well as a regression test. In the new test
tests/fail/stacked_borrows/fnentry_invalidation2.rs
, before this PR, we display this diagnostic:Which is very misleading. It is not this call itself, but what happens within the call that invalidates the tag we want. With this PR, we get:
Which is much better.