-
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
handle diverging functions forwarding their return place #66827
Conversation
// (even a ZST read/write) needs to error, so let us make this | ||
// a NULL place. | ||
// | ||
// FIXME: Ideally we'd make sure that the place projections also |
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.
Like just doing a place projection on a null place should error?
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.
Place projections should have inbounds
rules, basically. We have an implementation of that in Miri, and these days I am actually not ashamed of it any more. ;)
But I am worried about the perf impact of this and I think it is currently actually impossible to violate the inbounds requirement, so I didn't bother working on moving that into the core engine.
@bors r+ |
📌 Commit 2869aba has been approved by |
⌛ Testing commit 2869aba with merge d703ed834af1ea4b1c38e85e7dc220786f876865... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-azure |
Chocolatey was down. @bors retry |
⌛ Testing commit 2869aba with merge 1041db3d91d3f1be462da9124ae0b1b7e16d5a14... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-azure |
@bors retry spurious |
…oli-obk handle diverging functions forwarding their return place Fixes rust-lang/miri#1075: the shim around diverging closures turned into function pointers actually "obtains" a return place inside a diverging function, but just uses it as the return place for a diverging callee. Handle this by using NULL places. This is kind of a hack as it breaks our invariant that all places are dereferencable, but we'd eventually let raw pointers break that anyway I assume so that seems fine. r? @oli-obk
Rollup of 7 pull requests Successful merges: - #66346 (Replace .unwrap() with ? in std::os::unix::net) - #66789 (rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.) - #66822 (libunwind_panic: adjust miri panic hack) - #66827 (handle diverging functions forwarding their return place) - #66828 (Less minification) - #66850 (rustc: hide HirId's fmt::Debug output from -Z span_free_formats.) - #66907 (rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.) Failed merges: - #66874 (Miri engine: proper support for `Assert` MIR terminators) r? @ghost
Rollup of 7 pull requests Successful merges: - #66346 (Replace .unwrap() with ? in std::os::unix::net) - #66789 (rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.) - #66822 (libunwind_panic: adjust miri panic hack) - #66827 (handle diverging functions forwarding their return place) - #66828 (Less minification) - #66850 (rustc: hide HirId's fmt::Debug output from -Z span_free_formats.) - #66907 (rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.) Failed merges: - #66874 (Miri engine: proper support for `Assert` MIR terminators) r? @ghost
…oli-obk handle diverging functions forwarding their return place Fixes rust-lang/miri#1075: the shim around diverging closures turned into function pointers actually "obtains" a return place inside a diverging function, but just uses it as the return place for a diverging callee. Handle this by using NULL places. This is kind of a hack as it breaks our invariant that all places are dereferencable, but we'd eventually let raw pointers break that anyway I assume so that seems fine. r? @oli-obk
…oli-obk handle diverging functions forwarding their return place Fixes rust-lang/miri#1075: the shim around diverging closures turned into function pointers actually "obtains" a return place inside a diverging function, but just uses it as the return place for a diverging callee. Handle this by using NULL places. This is kind of a hack as it breaks our invariant that all places are dereferencable, but we'd eventually let raw pointers break that anyway I assume so that seems fine. r? @oli-obk
…oli-obk handle diverging functions forwarding their return place Fixes rust-lang/miri#1075: the shim around diverging closures turned into function pointers actually "obtains" a return place inside a diverging function, but just uses it as the return place for a diverging callee. Handle this by using NULL places. This is kind of a hack as it breaks our invariant that all places are dereferencable, but we'd eventually let raw pointers break that anyway I assume so that seems fine. r? @oli-obk
Rollup of 5 pull requests Successful merges: - #66245 (Conditional compilation for sanitizers) - #66654 (Handle const-checks for `&mut` outside of `HasMutInterior`) - #66822 (libunwind_panic: adjust miri panic hack) - #66827 (handle diverging functions forwarding their return place) - #66834 (rustbuild fixes) Failed merges: r? @ghost
Test diverging closure coercion Adds a test for #1075. Depends on rust-lang/rust#66827.
Fixes rust-lang/miri#1075: the shim around diverging closures turned into function pointers actually "obtains" a return place inside a diverging function, but just uses it as the return place for a diverging callee. Handle this by using NULL places.
This is kind of a hack as it breaks our invariant that all places are dereferencable, but we'd eventually let raw pointers break that anyway I assume so that seems fine.
r? @oli-obk