Repository navigation
alloctests: use thread-local in c_str_alloc_error - #165960
Conversation
|
Any special-casing of Miri in the standard library requires review. cc @rust-lang/miri |
|
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
9c0972d to
887646e
Compare
|
A better alternative may be to use a thread-local flag to control the allocator. Having the libtest harness around is nice e.g. for using nextest to run the tests. |
|
This test needs to be in a separate crate anyway and nextest is unlikely to work with the testing setup of the standard library. And finally it should be possible to add a check at the start of the test for |
|
nextest works very well in https://github.com/rust-lang/miri-test-libstd and I recently ported a no-harness test to use the harness because it was causing problems there. (#165993) Thread-local storage "obviously" does the right thing and seems like the both easier and more correct fix here to me, compared to ad-hoc replicating parts of the libtest argument parsing. |
887646e to
a292cb1
Compare
Yes, that makes a lot more sense. Done |
|
Thanks! |
c_str_alloc_error not use libtestc_str_alloc_error
alloctests: use thread-local in `c_str_alloc_error` Fixes rust-lang#165901 As suggested by @bjorn3 in rust-lang#165901 (comment)
alloctests: use thread-local in `c_str_alloc_error` Fixes rust-lang#165901 As suggested by @bjorn3 in rust-lang#165901 (comment)
…uwer Rollup of 13 pull requests Successful merges: - #166054 (stdarch subtree update) - #165289 (lexer: Update to Unicode 18) - #165960 (alloctests: use thread-local in `c_str_alloc_error`) - #166002 (#[optimize]: keep low opt levels unoptimized) - #166049 (rustc_target: Require altivec feature for ELFv2 powerpc64 targets) - #165200 (fix abi kind of thumb windows targets) - #165935 (Duplicate attribute diagnostic cleanups) - #165999 (Update TPDE submodule) - #166045 (rustdoc: Correctly filter deref impls on type aliases) - #166063 (Fix bad hyperlink) - #166066 (Update books) - #166072 (simplify Appearances iter) - #166075 (Remove dead code emitting `UnusedBuiltinAttribute`)
Rollup of 15 pull requests Successful merges: - #166054 (stdarch subtree update) - #165939 (Convert `pretty-std` debuginfo test to `gdb-repr`) - #165289 (lexer: Update to Unicode 18) - #165960 (alloctests: use thread-local in `c_str_alloc_error`) - #166002 (#[optimize]: keep low opt levels unoptimized) - #166003 (Fix ICE in tail_expr_drop_order lint with async drops) - #166049 (rustc_target: Require altivec feature for ELFv2 powerpc64 targets) - #165200 (fix abi kind of thumb windows targets) - #165966 (Document failing cases for spawning processes when using Command) - #165999 (Update TPDE submodule) - #166045 (rustdoc: Correctly filter deref impls on type aliases) - #166063 (Fix bad hyperlink) - #166066 (Update books) - #166072 (simplify Appearances iter) - #166075 (Remove dead code emitting `UnusedBuiltinAttribute`)
Rollup merge of #165960 - Jules-Bertholet:unflake, r=RalfJung alloctests: use thread-local in `c_str_alloc_error` Fixes #165901 As suggested by @bjorn3 in #165901 (comment)
Rollup of 15 pull requests Successful merges: - rust-lang/rust#166054 (stdarch subtree update) - rust-lang/rust#165939 (Convert `pretty-std` debuginfo test to `gdb-repr`) - rust-lang/rust#165289 (lexer: Update to Unicode 18) - rust-lang/rust#165960 (alloctests: use thread-local in `c_str_alloc_error`) - rust-lang/rust#166002 (#[optimize]: keep low opt levels unoptimized) - rust-lang/rust#166003 (Fix ICE in tail_expr_drop_order lint with async drops) - rust-lang/rust#166049 (rustc_target: Require altivec feature for ELFv2 powerpc64 targets) - rust-lang/rust#165200 (fix abi kind of thumb windows targets) - rust-lang/rust#165966 (Document failing cases for spawning processes when using Command) - rust-lang/rust#165999 (Update TPDE submodule) - rust-lang/rust#166045 (rustdoc: Correctly filter deref impls on type aliases) - rust-lang/rust#166063 (Fix bad hyperlink) - rust-lang/rust#166066 (Update books) - rust-lang/rust#166072 (simplify Appearances iter) - rust-lang/rust#166075 (Remove dead code emitting `UnusedBuiltinAttribute`)
Fixes #165901
As suggested by @bjorn3 in #165901 (comment)