Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #122959

Closed
wants to merge 32 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d3299af
transmute: caution against int2ptr transmutation
RalfJung Mar 12, 2024
982918f
Handle str literals written with `'` lexed as lifetime
estebank Mar 9, 2024
4a10b01
Use shorter span for existing `'` -> `"` structured suggestion
estebank Mar 9, 2024
999a0dc
review comment: `str` -> string in messages
estebank Mar 13, 2024
6f388ef
Extend test to trigger on 2015, 2018 and 2021 editions
estebank Mar 14, 2024
ea1883d
Silence redundant error on char literal that was meant to be a string…
estebank Mar 14, 2024
f4d30b1
fix rustdoc test
estebank Mar 17, 2024
f4adb1e
add notes on how to store 'ptr or int'
RalfJung Mar 14, 2024
2624e91
Soft-destabilize `RustcEncodable`/`RustcDecodable`
jhpratt Sep 21, 2023
fbf21c5
Remove RustcEncodable/Decodable from 2024 prelude
jhpratt Sep 21, 2023
1fcf2ea
Uniquify ReError on input mode in canonicalizer
compiler-errors Mar 22, 2024
da8a39a
Failing test
compiler-errors Mar 8, 2024
78ebb93
Fix validation on substituted callee bodies in MIR inliner
compiler-errors Mar 19, 2024
12e3629
add test for #99945
matthiaskrgr Mar 23, 2024
2f9a240
add test for opaque type with non-universal region substs #101852
matthiaskrgr Mar 23, 2024
e54bff7
add test for #104779 opaque types, patterns and subtyping ICE: Index…
matthiaskrgr Mar 23, 2024
f1f287f
add test for ICE "raw ptr comparison should already be caught in the…
matthiaskrgr Mar 23, 2024
f8aeac8
add test for #106423
matthiaskrgr Mar 23, 2024
cc422ce
add test for ICE #106444
matthiaskrgr Mar 23, 2024
f2bc9c5
add test for #106874 ICE BoundUniversalRegionError
matthiaskrgr Mar 23, 2024
368bfb2
add test for #107228
matthiaskrgr Mar 23, 2024
9aea37d
address review feedback
matthiaskrgr Mar 23, 2024
246f746
Add test in `higher-ranked`
Luv-Ray Mar 23, 2024
188c46a
regression test for #103626
kadiwa4 Feb 19, 2024
d959730
Rollup merge of #116016 - jhpratt:kill-rustc-serialize, r=dtolnay
matthiaskrgr Mar 23, 2024
e07a5aa
Rollup merge of #121281 - kadiwa4:test_103626, r=estebank,lcnr
matthiaskrgr Mar 23, 2024
d0e27af
Rollup merge of #122168 - compiler-errors:inline-coroutine-body-valid…
matthiaskrgr Mar 23, 2024
08bb35e
Rollup merge of #122217 - estebank:issue-119685, r=fmease
matthiaskrgr Mar 23, 2024
f68a0f1
Rollup merge of #122379 - RalfJung:int2ptr-transmute, r=m-ou-se
matthiaskrgr Mar 23, 2024
88574e1
Rollup merge of #122907 - compiler-errors:uniquify-reerror, r=lcnr
matthiaskrgr Mar 23, 2024
35310b7
Rollup merge of #122942 - Luv-Ray:master, r=lcnr
matthiaskrgr Mar 23, 2024
5f5362d
Rollup merge of #122943 - matthiaskrgr:ice-tests-9xxxx-to-12xxxx, r=f…
matthiaskrgr Mar 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add notes on how to store 'ptr or int'
  • Loading branch information
RalfJung committed Mar 19, 2024
commit f4adb1e6bdaef12d8b5776f74dadab0ddc11694d
8 changes: 6 additions & 2 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ extern "rust-intrinsic" {
///
/// Transmuting *pointers to integers* in a `const` context is [undefined behavior][ub], unless
/// the pointer was originally created *from* an integer. (That includes this function
/// specifically, integer-to-pointer casts, and helpers like [`invalid`][crate::ptr::dangling],
/// specifically, integer-to-pointer casts, and helpers like [`dangling`][crate::ptr::dangling],
/// but also semantically-equivalent conversions such as punning through `repr(C)` union
/// fields.) Any attempt to use the resulting value for integer operations will abort
/// const-evaluation. (And even outside `const`, such transmutation is touching on many
Expand All @@ -1206,7 +1206,11 @@ extern "rust-intrinsic" {
/// In particular, doing a pointer-to-integer-to-pointer roundtrip via `transmute` is *not* a
/// lossless process. If you want to round-trip a pointer through an integer in a way that you
/// can get back the original pointer, you need to use `as` casts, or replace the integer type
/// by `MaybeUninit<$int>` (and never call `assume_init()`).
/// by `MaybeUninit<$int>` (and never call `assume_init()`). If you are looking for a way to
/// store data of arbitrary type, also use `MaybeUninit<T>` (that will also handle uninitialized
/// memory due to padding). If you specifically need to store something that is "either an
/// integer or a pointer", use `*mut ()`: integers can be converted to pointers and back without
/// any loss (via `as` casts or via `transmute`).
///
/// # Examples
///
Expand Down
Loading