rust/library/core/src
Matthias Krüger 37efd55210
Rollup merge of #99511 - RalfJung:raw_eq, r=wesleywiser
make raw_eq precondition more restrictive

Specifically, don't allow comparing pointers that way. Comparing pointers is subtle because you have to talk about what happens to the provenance.

This matches what [Miri already implements](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=9eb1dfb8a61b5a2d4a7cee43df2717af), and all existing users are fine with this.

If raw_eq on pointers is ever desired, we can adjust the intrinsic spec and Miri implementation as needed, but for now that seems just unnecessary. Also, this is a const intrinsic, and in const, comparing pointers this way is *not possible* -- so if we allow the intrinsic to compare pointers in general, we need to impose an extra restrictions saying that in const-context, pointers are *not* okay.
2022-08-11 22:53:01 +02:00
..
alloc Re-optimize Layout::array 2022-07-13 17:07:41 -07:00
array more typos 2022-08-11 07:37:22 -04:00
async_iter Add Stream alias for AsyncIterator 2022-03-15 20:59:13 -07:00
cell Move/rename lazy::{OnceCell, Lazy} to cell::{OnceCell, LazyCell} 2022-06-16 19:53:59 +04:00
char docs: remove repetition 2022-08-09 21:54:05 +00:00
convert Warn on unused doc(hidden) on trait impl items 2022-05-08 22:53:14 +02:00
ffi Inline CStr::from_bytes_with_nul_unchecked::rt_impl 2022-08-10 12:21:17 +00:00
fmt rustdoc: extend #[doc(tuple_variadic)] to fn pointers 2022-07-17 16:32:06 -07:00
future Stabilize future_poll_fn 2022-07-16 10:04:14 +09:00
hash rustdoc: extend #[doc(tuple_variadic)] to fn pointers 2022-07-17 16:32:06 -07:00
iter Fix Skip::next for non-fused inner iterators 2022-07-18 21:10:47 +02:00
macros Revert write! and writeln! to late drop temporaries 2022-07-24 11:12:00 -07:00
mem Auto merge of #99174 - scottmcm:reoptimize-layout-array, r=joshtriplett 2022-08-10 23:50:18 +00:00
num Rename integer log* methods to ilog* 2022-08-09 10:20:49 -07:00
ops Add map_continue and continue_value combinators to ControlFlow 2022-07-20 16:32:09 -04:00
panic Update integer_atomics tracking issue 2022-07-08 17:52:04 -04:00
prelude Create 2024 edition 2022-04-02 02:45:49 -04:00
ptr Rollup merge of #100184 - Kixunil:stabilize_ptr_const_cast, r=m-ou-se 2022-08-11 22:46:58 +05:30
slice Add back Send and Sync impls on ChunksMut iterators 2022-08-01 10:32:45 -04:00
str ascii -> ASCII in code comment 2022-08-05 18:45:42 +02:00
sync miri: prune some atomic operation details from stacktrace 2022-07-20 16:34:24 -04:00
task stabilize core::task::ready! 2022-07-18 16:04:52 +02:00
unicode revert changes to unicode stability 2022-07-08 21:18:15 +00:00
any.rs core::any: replace some unstable generic types with impl Trait 2022-07-05 15:06:31 +01:00
ascii.rs Inline <EscapeDefault as Iterator>::next 2022-03-10 15:35:22 +01:00
asserting.rs [RFC 2011] Library code 2022-05-22 07:18:32 -03:00
bool.rs Stabilize bool::then_some 2022-05-04 13:22:08 +02:00
borrow.rs Make Borrow and BorrowMut impls const 2021-12-04 21:57:39 +09:00
cell.rs adjust UnsafeCell documentation 2022-07-22 14:25:41 -04:00
clone.rs update cfg(bootstrap)s 2022-07-01 15:48:23 +02:00
cmp.rs Add Self: ~const Trait to traits with #[const_trait] 2022-07-26 14:14:21 +00:00
default.rs Add documentation 2022-04-07 20:03:24 -04:00
hint.rs add miri-track-caller to some intrinsic-exposing methods 2022-07-24 14:49:33 -04:00
internal_macros.rs ignore a doctest for the non-exported macro 2022-05-03 18:33:56 +09:00
intrinsics.rs Rollup merge of #99511 - RalfJung:raw_eq, r=wesleywiser 2022-08-11 22:53:01 +02:00
lazy.rs Move/rename lazy::{OnceCell, Lazy} to cell::{OnceCell, LazyCell} 2022-06-16 19:53:59 +04:00
lib.rs Auto merge of #99182 - RalfJung:mitigate-uninit, r=scottmcm 2022-07-28 01:11:10 +00:00
marker.rs docs: show Clone and Copy on () doc pages 2022-06-07 12:12:49 -07:00
option.rs Fix links in std/core documentation 2022-07-05 21:33:39 +02:00
panic.rs resolve the conflict in compiler/rustc_session/src/parse.rs 2022-03-16 20:12:30 +08:00
panicking.rs trivial cfg(bootstrap) changes 2022-04-05 23:18:40 +02:00
pin.rs Fix the generator example for pin!() 2022-05-05 09:58:13 +10:00
primitive.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
primitive_docs.rs Improve the function pointer docs 2022-07-19 08:52:24 -07:00
result.rs add same warning to Result::expect as Result::unwrap 2022-07-21 18:15:24 -06:00
time.rs Rollup merge of #100353 - theli-ua:master, r=joshtriplett 2022-08-10 09:28:23 -07:00
tuple.rs rustdoc: extend #[doc(tuple_variadic)] to fn pointers 2022-07-17 16:32:06 -07:00
unit.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00