rust/library/core/tests/lib.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

178 lines
4.5 KiB
Rust
Raw Normal View History

#![feature(alloc_layout_extra)]
2020-05-18 19:24:37 +00:00
#![feature(array_chunks)]
#![feature(array_ptr_get)]
#![feature(array_windows)]
2023-07-03 17:11:39 +00:00
#![feature(ascii_char)]
#![feature(ascii_char_variants)]
2023-12-08 20:33:14 +00:00
#![feature(async_iter_from_iter)]
#![feature(async_iterator)]
#![feature(bigint_helper_methods)]
2018-04-06 20:45:31 +00:00
#![feature(cell_update)]
#![feature(clone_to_uninit)]
2022-10-07 18:59:23 +00:00
#![feature(const_align_offset)]
#![feature(const_align_of_val_raw)]
2021-12-23 11:07:41 +00:00
#![feature(const_black_box)]
#![feature(const_cell_into_inner)]
2022-11-08 16:39:40 +00:00
#![feature(const_hash)]
#![feature(const_heap)]
#![feature(const_intrinsic_copy)]
2021-11-17 00:58:52 +00:00
#![feature(const_maybe_uninit_as_mut_ptr)]
#![feature(const_nonnull_new)]
2022-10-07 19:46:28 +00:00
#![feature(const_pointer_is_aligned)]
#![feature(const_ptr_as_ref)]
#![feature(const_ptr_write)]
2024-04-29 13:27:34 +00:00
#![feature(const_three_way_compare)]
2021-03-13 17:40:47 +00:00
#![feature(const_trait_impl)]
2021-12-23 11:07:41 +00:00
#![feature(const_likely)]
#![feature(core_intrinsics)]
#![feature(core_io_borrowed_buf)]
#![feature(core_private_bignum)]
#![feature(core_private_diy_float)]
#![feature(dec2flt)]
#![feature(duration_consts_float)]
2020-08-30 17:31:34 +00:00
#![feature(duration_constants)]
2024-01-24 13:14:17 +00:00
#![feature(duration_constructors)]
2017-07-06 15:13:29 +00:00
#![feature(exact_size_is_empty)]
#![feature(extern_types)]
#![feature(freeze)]
#![feature(flt2dec)]
2017-03-17 14:05:44 +00:00
#![feature(fmt_internals)]
#![feature(float_minimum_maximum)]
2021-12-08 02:10:39 +00:00
#![feature(future_join)]
2022-05-22 10:18:32 +00:00
#![feature(generic_assert_internals)]
2022-05-20 14:04:13 +00:00
#![feature(array_try_from_fn)]
#![feature(hasher_prefixfree_extras)]
#![feature(hashmap_internals)]
2019-08-06 11:13:13 +00:00
#![feature(try_find)]
#![feature(layout_for_ptr)]
2017-12-17 22:44:03 +00:00
#![feature(pattern)]
2021-10-09 15:28:20 +00:00
#![feature(slice_take)]
#![feature(slice_from_ptr_range)]
#![feature(slice_split_once)]
#![feature(split_as_slice)]
#![feature(maybe_uninit_fill)]
2020-12-01 06:24:04 +00:00
#![feature(maybe_uninit_write_slice)]
#![feature(maybe_uninit_uninit_array_transpose)]
2020-06-16 11:07:15 +00:00
#![feature(min_specialization)]
2023-12-08 20:33:14 +00:00
#![feature(noop_waker)]
#![feature(numfmt)]
#![feature(num_midpoint)]
#![feature(offset_of_nested)]
2023-09-28 09:15:43 +00:00
#![feature(isqrt)]
#![feature(unsigned_is_multiple_of)]
#![feature(step_trait)]
2018-04-05 13:55:28 +00:00
#![feature(str_internals)]
2022-04-04 14:53:53 +00:00
#![feature(std_internals)]
#![feature(test)]
#![feature(trusted_len)]
#![feature(try_blocks)]
2021-04-15 08:13:39 +00:00
#![feature(try_trait_v2)]
#![feature(slice_internals)]
#![feature(slice_partition_dedup)]
2022-11-10 20:48:41 +00:00
#![feature(ip)]
2020-09-19 08:26:46 +00:00
#![feature(iter_advance_by)]
2022-01-02 16:31:56 +00:00
#![feature(iter_array_chunks)]
#![feature(iter_chain)]
2022-02-20 00:46:55 +00:00
#![feature(iter_collect_into)]
#![feature(iter_partition_in_place)]
#![feature(iter_intersperse)]
#![feature(iter_is_partitioned)]
2022-06-21 06:57:02 +00:00
#![feature(iter_next_chunk)]
#![feature(iter_order_by)]
#![feature(iter_repeat_n)]
#![feature(iterator_try_collect)]
#![feature(iterator_try_reduce)]
2022-11-10 20:48:41 +00:00
#![feature(const_ip)]
#![feature(const_ipv4)]
#![feature(const_ipv6)]
#![feature(const_mut_refs)]
#![feature(const_pin)]
#![feature(never_type)]
#![feature(unwrap_infallible)]
#![feature(pointer_is_aligned_to)]
2021-11-30 15:50:44 +00:00
#![feature(portable_simd)]
2021-03-26 20:10:21 +00:00
#![feature(ptr_metadata)]
#![feature(unsized_tuple_coercion)]
#![feature(const_option)]
2021-12-14 17:58:01 +00:00
#![feature(const_option_ext)]
2021-10-16 16:18:00 +00:00
#![feature(const_result)]
#![cfg_attr(target_has_atomic = "128", feature(integer_atomics))]
2023-09-23 17:23:51 +00:00
#![cfg_attr(test, feature(cfg_match))]
2021-09-02 05:28:47 +00:00
#![feature(int_roundings)]
#![feature(split_array)]
#![feature(strict_provenance)]
#![feature(strict_provenance_atomic_ptr)]
#![feature(trusted_random_access)]
2021-03-26 20:10:21 +00:00
#![feature(unsize)]
#![feature(const_array_from_ref)]
#![feature(const_slice_from_ref)]
#![feature(waker_getters)]
#![feature(error_generic_member_access)]
#![feature(trait_upcasting)]
#![feature(is_ascii_octdigit)]
2021-03-28 12:24:49 +00:00
#![feature(get_many_mut)]
#![feature(iter_map_windows)]
2023-11-22 06:30:09 +00:00
#![allow(internal_features)]
#![deny(unsafe_op_in_unsafe_fn)]
#![deny(fuzzy_provenance_casts)]
mod alloc;
mod any;
mod array;
2018-03-09 03:55:54 +00:00
mod ascii;
2022-05-22 10:18:32 +00:00
mod asserting;
2023-12-08 20:33:14 +00:00
mod async_iter;
mod atomic;
2019-09-07 14:49:27 +00:00
mod bool;
mod cell;
mod char;
2015-10-15 19:07:20 +00:00
mod clone;
mod cmp;
2020-12-26 00:59:08 +00:00
mod const_ptr;
mod convert;
mod ffi;
mod fmt;
2021-12-08 02:10:39 +00:00
mod future;
mod hash;
2015-10-15 19:07:20 +00:00
mod intrinsics;
mod io;
mod iter;
mod lazy;
2023-09-23 17:23:51 +00:00
#[cfg(test)]
mod macros;
2018-07-27 10:12:55 +00:00
mod manually_drop;
mod mem;
2022-11-10 20:48:41 +00:00
mod net;
2014-12-23 20:52:02 +00:00
mod nonzero;
mod num;
mod ops;
mod option;
2022-09-27 19:09:32 +00:00
mod panic;
2017-12-17 22:44:03 +00:00
mod pattern;
mod pin;
mod pin_macro;
mod ptr;
mod result;
mod simd;
mod slice;
2014-08-19 01:43:43 +00:00
mod str;
2018-04-05 13:55:28 +00:00
mod str_lossy;
mod task;
mod time;
mod tuple;
mod unicode;
mod waker;
/// Copied from `std::test_helpers::test_rng`, see that function for rationale.
#[track_caller]
#[allow(dead_code)] // Not used in all configurations.
pub(crate) fn test_rng() -> rand_xorshift::XorShiftRng {
use core::hash::{BuildHasher, Hash, Hasher};
let mut hasher = std::hash::RandomState::new().build_hasher();
core::panic::Location::caller().hash(&mut hasher);
let hc64 = hasher.finish();
let seed_vec = hc64.to_le_bytes().into_iter().chain(0u8..8).collect::<Vec<u8>>();
let seed: [u8; 16] = seed_vec.as_slice().try_into().unwrap();
rand::SeedableRng::from_seed(seed)
}