-
Notifications
You must be signed in to change notification settings - Fork 385
Add a protector test that demonstrates the base tag diagnostic #2523
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
The diagnostic cannot just happen for protectors, right? At least that function that computes it seems to be more generic than just protectors. |
tests/fail/stacked_borrows/invalidate_against_protector3.stderr
Outdated
Show resolved
Hide resolved
I think actually it can only happen for protectors. When the problem is that the used pointer has been invalidated, we print the creation span of the invalidated pointer, not the invalidating pointer. And since you can't invalidate the base tag, I don't think we'll ever print its span. We also can't print the base tag's creation span for a use-outside-provenance issue, because the base tag is always valid for the whole allocation. And the base tag always has write permission. |
89a4030
to
70be91d
Compare
70be91d
to
3cfb991
Compare
Ah, makes sense, thanks. |
@bors r+ |
☀️ Test successful - checks-actions |
Per #2519 (comment), this demonstrates this case for protector diagnostics:
This diagnostic is inspired by what Miri used to do with rust-lang/rust#60076 (comment)