-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Test and assert that we do not reveal a static item's memory AllocId #116571
Conversation
There's one more thing we could do but I don't know how hard it is... we could make sure to not call |
@@ -212,6 +212,10 @@ pub fn eval_to_const_value_raw_provider<'tcx>( | |||
tcx: TyCtxt<'tcx>, | |||
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>, | |||
) -> ::rustc_middle::mir::interpret::EvalToConstValueResult<'tcx> { | |||
assert!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert!( | |
// This shouldn't be used for statics, since statics are conceptually places, | |
// not values -- so what we do here could break pointer identity. | |
assert!( |
This is related to the changes in #116835, right? Though there you said that we cannot yet assert that we don't use the query on statics, and here actually that passes CI, including Miri CI? I am confused. |
The "eval to const value" path (where I added the assert) invokes the "eval to alloc" code path where we cannot, because that is also used by |
Ah, okay. So what's your plan with this PR? I'm fine with landing it after adding the comment suggested above, but you also have other PRs touching the same area and changing how we handle alloc IDs around statics. |
Yea this becomes obsolte if we manage to land the other PRs. I'll make sure to carry over your comment change to the asserts I'm adding elsewhere |
r? @RalfJung
as per #116564 (comment)