-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix drop and drop_in_place by transforming self of drop and drop_in_place methods into a Drop trait objects for types that have a non-empty DropGlue.
- Loading branch information
Showing
2 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Verifies that drops can be called on arbitrary trait objects. | ||
// | ||
// FIXME(#122848): Remove only-linux when fixed. | ||
//@ only-linux | ||
//@ needs-sanitizer-cfi | ||
//@ compile-flags: -Clto -Copt-level=0 -Cprefer-dynamic=off -Ctarget-feature=-crt-static -Zsanitizer=cfi | ||
//@ run-pass | ||
|
||
struct CustomDrop; | ||
impl Drop for CustomDrop { | ||
fn drop(&mut self) {} | ||
} | ||
|
||
fn main() { | ||
let _ = Box::new(CustomDrop) as Box<dyn Send>; | ||
} |