rust/library/core/src
Jacob Pratt 05f22c3614
Rollup merge of #121840 - oli-obk:freeze, r=dtolnay
Expose the Freeze trait again (unstably) and forbid implementing it manually

non-emoji version of https://github.com/rust-lang/rust/pull/121501

cc #60715

This trait is useful for generic constants (associated consts of generic traits). See the test (`tests/ui/associated-consts/freeze.rs`) added in this PR for a usage example. The builtin `Freeze` trait is the only way to do it, users cannot work around this issue.

It's also a useful trait for building some very specific abstrations, as shown by the usage by the `zerocopy` crate: https://github.com/google/zerocopy/issues/941

cc ```@RalfJung```

T-lang signed off on reexposing this unstably: https://github.com/rust-lang/rust/pull/121501#issuecomment-1969827742
2024-03-11 03:47:19 -04:00
..
alloc rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
array add missing PartialOrd impl doc for array 2024-03-06 10:28:56 +01:00
ascii implement Default for AsciiChar 2024-02-13 12:04:44 +01:00
async_iter Step all bootstrap cfgs forward 2024-02-08 07:44:34 -05:00
cell Add some optimizations 2023-10-13 14:54:33 +02:00
char Distinguish between library and lang UB in assert_unsafe_precondition 2024-03-08 18:53:58 -05:00
cmp Use generic NonZero everywhere in core. 2024-02-22 15:17:33 +01:00
convert include feedback from workingjubilee 2024-03-04 10:04:46 +01:00
ffi Rollup merge of #112136 - clarfonthey:ffi-c_str, r=cuviper 2024-03-10 10:58:14 +01:00
fmt Auto merge of #122059 - nyurik:with-as-const-str, r=cuviper 2024-03-08 04:15:17 +00:00
future Use root obligation on E0277 for some cases 2024-03-03 18:53:35 +00:00
hash Allow newly added non_local_definitions in std 2024-02-17 13:59:46 +01:00
intrinsics remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsics 2024-02-25 08:14:52 +01:00
io BorrowedCursor docs clarification 2024-03-10 09:48:56 +01:00
iter Be more lax in .into_iter() suggestion when encountering Iterator methods on non-Iterator 2024-03-03 18:53:36 +00:00
macros Rust is a proper name: rust → Rust 2024-03-07 07:49:22 +01:00
mem Implement MaybeUninit::fill{,_with,_from} 2024-03-05 15:27:35 -05:00
net net: Add branch to Parser::read_number for parsing without checked 2024-03-04 18:46:09 -05:00
num fix legacy numeric constant diag items 2024-03-09 23:33:27 -07:00
ops Distinguish between library and lang UB in assert_unsafe_precondition 2024-03-08 18:53:58 -05:00
panic Replace some usage of #[rustc_on_unimplemented] with 2024-01-05 15:23:09 +01:00
prelude Add Future and IntoFuture to the 2024 prelude 2024-02-18 23:20:05 +01:00
ptr Auto merge of #121662 - saethlin:precondition-unification, r=RalfJung 2024-03-10 01:23:54 +00:00
slice Rollup merge of #121148 - clarfonthey:try-range, r=dtolnay 2024-03-11 03:47:18 -04:00
str Distinguish between library and lang UB in assert_unsafe_precondition 2024-03-08 18:53:58 -05:00
sync Rust is a proper name: rust → Rust 2024-03-07 07:49:22 +01:00
task fix: remove memory leak due to missing drop implementation for local waker. Also, fix some 2024-03-09 14:38:58 -03:00
unicode Bump Unicode to version 15.1.0, regenerate tables 2024-02-09 17:35:46 +01:00
any.rs Fix Hash impl 2024-02-25 14:09:30 +00:00
arch.rs Rust is a proper name: rust → Rust 2024-03-07 07:49:22 +01:00
ascii.rs Use generic NonZero internally. 2024-02-15 08:09:42 +01:00
asserting.rs [RFC 2011] Library code 2022-05-22 07:18:32 -03:00
bool.rs core is now compilable 2023-04-16 07:20:26 +00:00
borrow.rs doc: replace wrong punctuation mark 2023-07-28 14:46:17 +02:00
cell.rs Explain why we don't use intrinsics::is_nonoverlapping 2024-03-09 13:36:36 -05:00
clone.rs remove redundant imports 2023-12-10 10:56:22 +08:00
cmp.rs Rollup merge of #115386 - RalfJung:partial-eq-chain, r=dtolnay 2024-02-05 11:07:25 +01:00
default.rs implement Default for AsciiChar 2024-02-13 12:04:44 +01:00
error.md Fix minor grammar typo 2023-09-06 09:47:22 -07:00
error.rs style library/core/src/error.rs 2024-03-02 16:03:23 +08:00
escape.rs Use generic NonZero internally. 2024-02-15 08:09:42 +01:00
hint.rs Distinguish between library and lang UB in assert_unsafe_precondition 2024-03-08 18:53:58 -05:00
internal_macros.rs add track_caller for arith ops 2023-11-24 00:54:06 +08:00
intrinsics.rs Auto merge of #121662 - saethlin:precondition-unification, r=RalfJung 2024-03-10 01:23:54 +00:00
lib.rs Rollup merge of #121840 - oli-obk:freeze, r=dtolnay 2024-03-11 03:47:19 -04:00
marker.rs Forbid implementing Freeze even if the trait is stabilized 2024-02-29 14:10:29 +00:00
option.rs Auto merge of #121454 - reitermarkus:generic-nonzero-library, r=dtolnay 2024-02-23 14:27:33 +00:00
panic.rs Distinguish between library and lang UB in assert_unsafe_precondition 2024-03-08 18:53:58 -05:00
panicking.rs const_eval_select: make it safe but be careful with what we expose on stable for now 2024-03-02 16:09:31 +01:00
pin.rs Rename pointer field on Pin 2024-01-16 14:58:42 -05:00
primitive.rs
primitive_docs.rs Use generic NonZero everywhere in core. 2024-02-22 15:17:33 +01:00
result.rs Add flatmap/flat_map -> and_then suggestions 2024-02-22 18:05:28 +00:00
time.rs Rollup merge of #120307 - djc:duration-constructors, r=Mark-Simulacrum 2024-02-11 08:25:42 +01:00
tuple.rs Rollup merge of #118307 - scottmcm:tuple-eq-simpler, r=joshtriplett 2024-02-11 08:25:41 +01:00
unit.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00