Repository navigation
std: simplify the miri bypass of the stack overflow detection logic - #163743
Conversation
|
Any special-casing of Miri in the standard library requires review. cc @rust-lang/miri |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
bd5d0fe to
a429208
Compare
| if cfg!(miri) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Isn't the existing handler already required to be sound on a null pointer? Why does Miri need a special check?
There was a problem hiding this comment.
drop_handler unconditionally accesses the thread information BTreeMap, which means there is some extra synchronisation – enough to make some miri tests fail.
| make_handler(false) | ||
| if cfg!(miri) { | ||
| return Handler::null(); | ||
| } |
There was a problem hiding this comment.
A comment similar to above would be good.
a429208 to
cdd050c
Compare
|
Looks good to me too r? ChrisDenton |
…uwer Rollup of 9 pull requests Successful merges: - #163743 (std: simplify the miri bypass of the stack overflow detection logic) - #164474 (core: implement `char::is_xid_{start|continue}`) - #164643 (Const-stabilize `{BinaryHeap, BTreeMap, BTreeSet, LinkedList, VecDeque)::{len, is_empty}`) - #164739 (Use cfi_encoding instead of name in abi checking in miri) - #162927 (stabilize ptr_cast_slice) - #163372 (Restrict `PartialEq` and `PartialOrd` documentation to thin pointers) - #164261 (Simplify MSYS check in is_terminal on Windows) - #164698 (Remove FCP from libs tracking checklist) - #164810 (Don't prioritize issues that require internal features)
Rollup merge of #163743 - joboet:miri_bypass_stack_overflow, r=ChrisDenton std: simplify the miri bypass of the stack overflow detection logic This is split out from #162296. Using `cfg!(miri)` instead of compile-time configuration avoids creating warnings about unused imports. And by creating a `init` function in the main module, there's space to put further shared logic. This would disable the stack overflow logic when running Cygwin targets under miri, but Cygwin isn't supported by miri anyhow.
…uwer Rollup of 9 pull requests Successful merges: - rust-lang/rust#163743 (std: simplify the miri bypass of the stack overflow detection logic) - rust-lang/rust#164474 (core: implement `char::is_xid_{start|continue}`) - rust-lang/rust#164643 (Const-stabilize `{BinaryHeap, BTreeMap, BTreeSet, LinkedList, VecDeque)::{len, is_empty}`) - rust-lang/rust#164739 (Use cfi_encoding instead of name in abi checking in miri) - rust-lang/rust#162927 (stabilize ptr_cast_slice) - rust-lang/rust#163372 (Restrict `PartialEq` and `PartialOrd` documentation to thin pointers) - rust-lang/rust#164261 (Simplify MSYS check in is_terminal on Windows) - rust-lang/rust#164698 (Remove FCP from libs tracking checklist) - rust-lang/rust#164810 (Don't prioritize issues that require internal features)
This is split out from #162296. Using
cfg!(miri)instead of compile-time configuration avoids creating warnings about unused imports. And by creating ainitfunction in the main module, there's space to put further shared logic.This would disable the stack overflow logic when running Cygwin targets under miri, but Cygwin isn't supported by miri anyhow.