Skip to content
Closed
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
10000 commits
Select commit Hold shift + click to select a range
14c399c
Auto merge of #141739 - GuillaumeGomez:rollup-ivboqwd, r=GuillaumeGomez
bors May 29, 2025
5000d3f
Rollup merge of #141507 - RalfJung:atomic-intrinsics, r=bjorn3
matthiaskrgr May 30, 2025
c7ac933
Rollup merge of #141669 - tgross35:float-test-cleanup, r=RalfJung
matthiaskrgr May 30, 2025
6457f4d
Address review comments.
orlp May 30, 2025
3160063
chore: release
github-actions[bot] May 29, 2025
98b2c3b
Update `compiler-builtins` to 0.1.160
tgross35 May 6, 2025
2dd64b3
`slice.get(i)` should use a slice projection in MIR, like `slice[i]` …
scottmcm Mar 29, 2025
7c34f44
Rollup merge of #140825 - rs-sac:ext, r=workingjubilee
workingjubilee May 30, 2025
5410daa
Rollup merge of #141237 - Qelxiros:139911-exact-div, r=workingjubilee
workingjubilee May 30, 2025
01b9130
Rollup merge of #141609 - lolbinarycat:core-dedup-ptr-docs-139190, r=…
workingjubilee May 30, 2025
c74beb7
std: clarify Clone trait documentation about duplication semantics
xizheyin May 18, 2025
11b7a2c
Merge from rustc
May 31, 2025
837884a
Auto merge of #141678 - Kobzol:revert-141516, r=workingjubilee
bors May 31, 2025
561cbc4
std: note that `std::str::from_utf8*` functions are aliases to `std::…
xizheyin May 17, 2025
e5b54e6
Auto merge of #141685 - orlp:inplace-tls-drop, r=joboet
bors May 31, 2025
451801b
Rollup merge of #141112 - xizheyin:issue-141079, r=Mark-Simulacrum
matthiaskrgr May 31, 2025
91b5394
Rollup merge of #141805 - tgross35:update-builtins, r=tgross35
matthiaskrgr May 31, 2025
999a8cc
Auto merge of #141824 - matthiaskrgr:rollup-7nffwd0, r=matthiaskrgr
bors May 31, 2025
0da4f84
Add const support for float rounding methods
ruancomelli May 19, 2025
f2b17b4
terminology: allocated object → allocation
RalfJung May 18, 2025
35a99da
library: explain TOCTOU races in `fs::remove_dir_all`
workingjubilee May 2, 2025
d89e96d
Auto merge of #139118 - scottmcm:slice-get-unchecked-intrinsic, r=wor…
bors May 31, 2025
a336f8d
Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=…
jhpratt May 31, 2025
d65c6a8
Rollup merge of #141215 - xizheyin:issue-141138, r=workingjubilee
jhpratt May 31, 2025
541e9d7
Rollup merge of #141521 - ruancomelli:const-float-rounding, r=RalfJung
jhpratt May 31, 2025
e1a3925
Rollup merge of #141832 - workingjubilee:explain-what-toctou-races-ar…
jhpratt May 31, 2025
60374c4
Auto merge of #141842 - jhpratt:rollup-r7ldrl2, r=jhpratt
bors Jun 1, 2025
256ab94
Merge from rustc
Jun 1, 2025
93a44f9
Fix typo in `StructuralPartialEq` docs
zacryol Jun 1, 2025
36d2c9c
Rollup merge of #141224 - RalfJung:no-objects, r=traviscross
GuillaumeGomez Jun 1, 2025
513fc8f
Auto merge of #141869 - GuillaumeGomez:rollup-vicg807, r=GuillaumeGomez
bors Jun 1, 2025
14752de
Fix new `dead_code` warnings from recent nightlies
tgross35 Jun 1, 2025
c82f619
Upgrade all dependencies to the latest available version
tgross35 Jun 1, 2025
70dc6d7
Fixed a typo in `ManuallyDrop`'s doc
neeko-cat Jun 1, 2025
c61f171
add f16_epsilon and f128_epsilon
usamoi Jun 1, 2025
d262951
remove f16: From<u16>
usamoi Jun 2, 2025
9e7b1ee
Rollup merge of #141858 - zacryol:spe-docs-typo, r=aDotInTheVoid
Kobzol Jun 2, 2025
018adbd
Rollup merge of #141874 - usamoi:eps, r=tgross35
Kobzol Jun 2, 2025
8778d6d
Disable f64 minimum/maximum tests for arm 32
ehuss Jun 2, 2025
603d104
cleanup: Use `x.biteq(y)` rather than `x.to_bits() == y.to_bits()`
tgross35 Jun 2, 2025
b4757bb
Lightly tweak docs for BTree{Map,Set}::extract_if
rs-sac Jun 2, 2025
82c7fbd
Remove bootstrap cfgs from library/
cuviper Jun 2, 2025
3c5bf7f
ci: Refactor benchmark regression checks
tgross35 Jun 1, 2025
1762a01
Remove more library bootstrap
cuviper Jun 2, 2025
fdf3225
libm-test: Fix unintentional skips in `binop_common`
tgross35 Jun 2, 2025
9c8b1f8
compiler-builtins: Eliminate symlinks
tgross35 May 20, 2025
6e59317
add tests
Qelxiros Jun 3, 2025
e286c0f
Rollup merge of #140715 - lukaslueg:oncecellsyncdocs, r=tgross35
matthiaskrgr Jun 3, 2025
468d93f
Rollup merge of #141873 - neeko-cat:patch-1, r=tgross35
matthiaskrgr Jun 3, 2025
18c317f
Update ABI compatibility docs about null-pointer-optimized enums.
zachs18 Jun 3, 2025
882e318
move `test-float-parse` tool into `src/tools` dir
onur-ozkan Jun 3, 2025
9f4b3be
Rollup merge of #141921 - ehuss:arm-min-max, r=tgross35
matthiaskrgr Jun 3, 2025
f1a72ed
Rollup merge of #141949 - onur-ozkan:move-test-float-parse, r=Kobzol
matthiaskrgr Jun 3, 2025
504f596
Auto merge of #141954 - matthiaskrgr:rollup-zptd6t9, r=matthiaskrgr
bors Jun 3, 2025
04d824c
Update stdarch submodule
sayantn Jun 3, 2025
b80cbe0
std: simplify `NonNull` variance documentation
xizheyin Jun 3, 2025
981c068
Enable Float non-determinism in miri. Update and add tests and change
LorrensP-2158466 Mar 5, 2025
5e88ffc
Add `iter` macro
oli-obk Feb 27, 2025
8208a40
Auto merge of #141229 - tgross35:builtins-josh-subtree, r=Kobzol
bors Jun 3, 2025
8eb4c70
Rollup merge of #141455 - joboet:tls_exhaustion_abort, r=tgross35
matthiaskrgr Jun 3, 2025
b8e3663
Rollup merge of #141925 - cuviper:vestigial-bootstrap, r=workingjubilee
matthiaskrgr Jun 3, 2025
6dabd9d
Improve the documentation of `Display` and `FromStr`, and their inter…
joshtriplett Feb 7, 2025
7eaaf82
Add some more description of interactions between `Display` and `From…
joshtriplett Feb 7, 2025
ef19ada
`FromStr`: Rework explanation of `FromStr`/`Display` round-tripping
joshtriplett Jun 3, 2025
ce7858a
`Display`: Rework explanation of `FromStr`/`Display` round-tripping
joshtriplett Jun 3, 2025
7e12d1a
Auto merge of #141984 - matthiaskrgr:rollup-wy6j9ca, r=matthiaskrgr
bors Jun 3, 2025
0698f1f
add tests for negative numbers
Qelxiros Jun 4, 2025
c09a80a
Rollup merge of #136687 - joshtriplett:improve-display-and-fromstr-do…
matthiaskrgr Jun 4, 2025
150f20c
Rollup merge of #137306 - tgross35:remove-i128-u128-improper-ctypes, …
matthiaskrgr Jun 4, 2025
8c92e32
Rollup merge of #141467 - cyrgani:const-empty-stringlikes, r=Amanieu
matthiaskrgr Jun 4, 2025
aff96b8
Rollup merge of #141893 - usamoi:lossless, r=tgross35
matthiaskrgr Jun 4, 2025
3c0a3d0
Rollup merge of #141924 - rs-sac:extr-doc, r=jhpratt
matthiaskrgr Jun 4, 2025
8b51863
Rollup merge of #141939 - Qelxiros:139911-exact-div-tests, r=workingj…
matthiaskrgr Jun 4, 2025
1f1de69
coretests: move float tests from num to floats module and use a more …
RalfJung Jun 1, 2025
059bc64
Add Location::file_with_nul
cramertj Jan 3, 2025
b24c5a2
Replace the musl submodule with a download script
tgross35 Jun 4, 2025
69d88e1
Add an empty rust-version file
tgross35 May 28, 2025
79dabe2
Add tooling for `josh` syncs
tgross35 May 18, 2025
8ce226b
Update the upstream Rust version
tgross35 Jun 4, 2025
be240a6
Merge ref 'df8102fe5f24:/library/compiler-builtins' from https://gith…
tgross35 Jun 4, 2025
babb68e
`panic-handler`: Remove the `no_core` feature
tgross35 Jun 4, 2025
da05950
add Vec::peek_mut
Qelxiros Jun 4, 2025
93708b1
Merge from rustc
Jun 5, 2025
cd8fb17
Stabilize `const_eq_ignore_ascii_case`
paolobarbolini Jun 5, 2025
3518e93
Auto merge of #135054 - cramertj:file-cstr, r=m-ou-se
bors Jun 5, 2025
11bd78c
Rollup merge of #140638 - RalfJung:unsafe-pinned-shared-aliased, r=wo…
matthiaskrgr Jun 5, 2025
40ff118
Auto merge of #142070 - matthiaskrgr:rollup-e7lxtuo, r=matthiaskrgr
bors Jun 5, 2025
5afbe57
Rollup merge of #142036 - tgross35:update-builtins, r=tgross35
matthiaskrgr Jun 5, 2025
ed9ab8b
change tests to use fixed constants to let them pass with miri
LorrensP-2158466 May 30, 2025
d821c2f
Optimize `Seek::stream_len` impl for `File`
tbu- May 13, 2024
4fee7a6
Clarify description of `Seek::stream_len`
tbu- Jan 9, 2025
33a82d6
Auto merge of #142081 - matthiaskrgr:rollup-secpezz, r=matthiaskrgr
bors Jun 5, 2025
d187519
Fix AIX build
thaliaarchi Jun 5, 2025
65b5431
Rollup merge of #125087 - tbu-:pr_file_stream_len, r=ChrisDenton
matthiaskrgr Jun 5, 2025
d70aec0
Rollup merge of #142091 - thaliaarchi:aix-getenv, r=workingjubilee
matthiaskrgr Jun 5, 2025
6a5a696
Add new Tier-3 targets: `loongarch32-unknown-none*`
heiher Jan 9, 2025
e475f4b
remove extraneous text
tshepang Jun 6, 2025
c21a43f
Merge from rustc
Jun 6, 2025
029c9a8
Compute number of digits instead of relying on constant value for u12…
GuillaumeGomez Jun 6, 2025
e98e967
Stabilised `os_string_pathbuf_leak`
its-the-shrimp Mar 4, 2025
72a49b2
unsafe keyword docs: emphasize that an unsafe fn in a trait does not …
RalfJung May 23, 2025
c7729b7
Rollup merge of #140418 - tgross35:std-c-size_t, r=workingjubilee
GuillaumeGomez Jun 6, 2025
74684e5
Rollup merge of #141471 - RalfJung:unsafe-fn-in-trait, r=traviscross
GuillaumeGomez Jun 6, 2025
fe8371b
Rollup merge of #142105 - tshepang:basic-usage, r=workingjubilee
GuillaumeGomez Jun 6, 2025
c3dfc2e
Rollup merge of #142114 - GuillaumeGomez:u128-const, r=Urgau
GuillaumeGomez Jun 6, 2025
c6bfd75
fix tests
Qelxiros Jun 6, 2025
43b9d5f
Merge from rustc
Jun 7, 2025
3f72751
Rollup merge of #137992 - its-the-shrimp:stabilise_os_string_pathbuf_…
jhpratt Jun 7, 2025
2321e08
Rollup merge of #141857 - RalfJung:coretests-floats, r=tgross35
jhpratt Jun 7, 2025
f67bef7
get rid of spurious cfg(bootstrap)
RalfJung Jun 7, 2025
f0efc37
Make NonZero<char> possible
hkBst May 14, 2025
748541d
Auto merge of #141964 - sayantn:update-stdarch, r=Amanieu
bors Jun 7, 2025
8d63b19
UnsafePinned: update get() docs and signature to allow shared mutation
RalfJung Jun 7, 2025
ec39f5d
Fix usage of `bootstrap` in core
Urgau Jun 7, 2025
971cea4
Stabilize the `keylocker_x86` flag, and the `kl` and `widekl` target …
sayantn May 7, 2025
d67f911
Stabilize `sha512_sm_x86`, and the `sha512`, `sm3` and `sm4` target f…
sayantn May 7, 2025
cf11887
intrinsics: use const generic to set atomic ordering
RalfJung May 28, 2025
ad3fcae
centralize aliasing rules discussion in UnsafeCell docs
RalfJung Jun 7, 2025
158612f
Rollup merge of #141447 - y86-dev:option-layout-docs, r=RalfJung
GuillaumeGomez Jun 7, 2025
6f727b2
Rollup merge of #142065 - paolobarbolini:stabilize-const_eq_ignore_as…
GuillaumeGomez Jun 7, 2025
fdce0ba
Rollup merge of #142154 - RalfJung:no-more-cfg-bootstrap, r=oli-obk
GuillaumeGomez Jun 7, 2025
b0007df
Use the in-tree `compiler-builtins`
tgross35 Jun 4, 2025
b0f5443
compiler-builtins: Fix a `rustdoc::bare-urls` error
tgross35 Jun 5, 2025
f7c7cb7
Merge from rustc
Jun 8, 2025
1945b28
De-duplicate f16 & f128 doctest attributes
Urgau Jun 8, 2025
798baa5
Auto merge of #141700 - RalfJung:atomic-intrinsics-part2, r=bjorn3
bors Jun 8, 2025
521041a
Remove rustc's notion of "preferred" alignment AKA `__alignof`
workingjubilee Feb 12, 2025
1a2fa63
Rollup merge of #142053 - heiher:loong32-none, r=wesleywiser
workingjubilee Jun 9, 2025
a672cc2
Rollup merge of #142162 - RalfJung:unsafe-pinned-get, r=workingjubile…
workingjubilee Jun 9, 2025
9328f9e
Avoid a gratuitous 10s wait in a stress test
joshtriplett Jun 9, 2025
4e78d21
compiler-builtins: Resolve `unsafe_op_in_unsafe_fn` on Arm32 Android
tgross35 Jun 8, 2025
1a3f83b
compiler-builtins: Specify `:r` registers for `usize`
tgross35 Jun 8, 2025
89ef949
compiler-builtins: Emit `rustc-check-cfg` earlier
tgross35 Jun 9, 2025
c1c8c16
Merge from rustc
Jun 9, 2025
df64a7f
Rollup merge of #142160 - Urgau:check-cfg-bootstrap-only-rustc, r=Kobzol
matthiaskrgr Jun 9, 2025
3746ce7
Rollup merge of #142224 - joshtriplett:remove-gratuitous-wait-in-stre…
matthiaskrgr Jun 9, 2025
df03c09
stabilize nonnull_provenance
RalfJung Jun 9, 2025
49a81b8
Rollup merge of #129121 - devnexen:stabilize_ext_linux_tcp_layer, r=t…
matthiaskrgr Jun 9, 2025
078b06a
Rollup merge of #142192 - Urgau:dedup-f16-f128-test-attrs, r=tgross35
matthiaskrgr Jun 9, 2025
78367f4
float tests: use assert_biteq in more places
RalfJung Jun 9, 2025
b73f6d1
Auto merge of #142242 - matthiaskrgr:rollup-1sgx0ji, r=matthiaskrgr
bors Jun 9, 2025
42d5214
float tests: deduplicate min, max, and rounding tests
RalfJung Jun 9, 2025
4794332
make the default float comparison tolerance type-dependent
RalfJung Jun 9, 2025
b734b89
float midpoint tests: add missing NAN cases
RalfJung Jun 9, 2025
f60cb58
Rollup merge of #140767 - sayantn:stabilize-sha512, r=traviscross,tgr…
tgross35 Jun 9, 2025
742e4ab
Rollup merge of #141001 - hkBst:nonzero-char, r=dtolnay
tgross35 Jun 9, 2025
eec8fe2
Rollup merge of #141993 - tgross35:use-in-tree-builtins, r=bjorn3
tgross35 Jun 9, 2025
0d85a67
Rollup merge of #142238 - RalfJung:nonnull_provenance, r=workingjubilee
tgross35 Jun 9, 2025
af58ded
core::ptr: deduplicate more method docs
lolbinarycat Jun 6, 2025
09e9d4c
Mark `core::slice::memchr` as `#[doc(hidden)]`
aDotInTheVoid Jun 9, 2025
0a2d5f4
Specify the behavior of `file!`
epage Dec 17, 2024
ec817e5
Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=…
bors Jun 9, 2025
17fa0e2
Merge from rustc
Jun 10, 2025
e07de5e
docs: Small clarification on the usage of read_to_string and read_to_…
Jun 7, 2025
d232aa2
compiler-builtins: Remove unused `lints.rust` table
tgross35 Jun 10, 2025
3e892fc
ci: Fix a typo that was causing a command failure
tgross35 Jun 10, 2025
b572f5d
add a fixme to use `extern_custom` when available
folkertdev Jun 9, 2025
fc4fc8f
use `#[naked]` for `__rust_probestack`
folkertdev Jun 3, 2025
6b8c25e
merge the sgx/fortanix `__rust_probestack` into the general `x86_64` one
folkertdev Jun 3, 2025
d783a41
indent the probestack inline assembly
folkertdev Jun 3, 2025
2254a83
Rollup merge of #134442 - epage:change, r=workingjubilee
fmease Jun 10, 2025
4ff4998
Rollup merge of #140766 - sayantn:stabilize-keylocker, r=traviscross,…
fmease Jun 10, 2025
0dbf497
Rollup merge of #141992 - folkertdev:probestack-naked-function, r=tgr…
fmease Jun 10, 2025
ba9f624
Rollup merge of #142101 - lolbinarycat:core-dedup-ptr-docs-139190-pt2…
fmease Jun 10, 2025
4982f2e
Rollup merge of #142102 - kiseitai3:141714_stdin_read_to_string_docs,…
fmease Jun 10, 2025
9fbece5
Rollup merge of #142262 - aDotInTheVoid:nomemchr, r=Noratrieb
fmease Jun 10, 2025
cdfe508
core docs: improve clarity of considerations about atomic CAS operations
fu5ha Jun 10, 2025
ba53e94
format integer tests regrouped, min/max coverage and 128-bit coverage
pascaldekloe Feb 5, 2025
ca23f47
Auto merge of #142292 - RalfJung:miri-sync, r=RalfJung
bors Jun 10, 2025
e9d4d10
feat: Add `bit_width` for unsigned integer types
sorairolake Jun 7, 2025
9fb930a
faster fmt::Display of 128-bit integers, without unsafe pointer
pascaldekloe Feb 5, 2025
2b61cdc
Fix Debug for Location.
m-ou-se Jun 11, 2025
c842466
Update dependencies in `library/Cargo.lock`
tgross35 Jun 10, 2025
743d005
Upgrade the standard library `object` version
tgross35 Jun 10, 2025
b8e0586
Upgrade the standard library `addr2line` version
tgross35 Jun 10, 2025
9901c63
Upgrade the standard library `unwinding` version
tgross35 Jun 11, 2025
1a90510
Auto merge of #136594 - pascaldekloe:fmt-int128, r=tgross35
bors Jun 12, 2025
6f40289
cargo update
invalid-email-address Jun 8, 2025
fcb45d0
update docs, test
Qelxiros Jun 12, 2025
8c8ed8f
Allow `unpredictable_function_pointer_comparisons` lint in more places
Urgau Dec 19, 2024
7e06ea4
Auto merge of #141205 - rust-lang:cargo_update, r=Mark-Simulacrum
bors Jun 12, 2025
fd45ff2
chore(doctest): Remove redundant blank lines
sorairolake Jun 12, 2025
e51e83b
Update the stdarch submodule
tgross35 Jun 10, 2025
05269b7
Tracking the old name of renamed unstable library attribute
xizheyin Jun 7, 2025
0cc8ed7
intrinsics: rename min_align_of to align_of
RalfJung Jun 12, 2025
d304405
Delegate `<CStr as Debug>` to `ByteStr`
tamird Apr 18, 2025
3e87680
Rollup merge of #138016 - nwoods-cimpress:slice_chunkby_clone, r=dtolnay
matthiaskrgr Jun 12, 2025
f0c3afe
Rollup merge of #141947 - zachs18:patch-4, r=workingjubilee,traviscross
matthiaskrgr Jun 12, 2025
058c23d
Rollup merge of #142252 - fu5ha:doc-cas-ops, r=ibraheemdev
matthiaskrgr Jun 12, 2025
250a301
Rollup merge of #134536 - Urgau:fn-ptr-option, r=compiler-errors,trav…
matthiaskrgr Jun 12, 2025
a78ed82
Rollup merge of #142402 - sorairolake:remove-blank-line, r=workingjub…
matthiaskrgr Jun 12, 2025
83376b4
Delegate `<SocketAddr as Debug>` to `ByteStr`
tamird May 24, 2025
1b28bd0
Unimplement unsized_locals
mejrs Jun 12, 2025
5c3c860
Rollup merge of #141491 - tamird:cstr-debug-bstr, r=joshtriplett
matthiaskrgr Jun 13, 2025
d430461
Rollup merge of #142158 - xizheyin:141617, r=jdonszelmann
matthiaskrgr Jun 13, 2025
2d34b82
Rollup merge of #142410 - RalfJung:align_of, r=WaffleLapkin,workingju…
matthiaskrgr Jun 13, 2025
9298508
Rollup merge of #142274 - tgross35:update-stdarch, r=Amanieu
matthiaskrgr Jun 13, 2025
5442843
Rollup merge of #142276 - tgross35:update-library-lockfile, r=Mark-Si…
matthiaskrgr Jun 13, 2025
7cbbd14
Rollup merge of #142308 - tgross35:upgrade-library-object, r=Mark-Sim…
matthiaskrgr Jun 13, 2025
eadae1c
Auto merge of #142432 - matthiaskrgr:rollup-ziuls9y, r=matthiaskrgr
bors Jun 13, 2025
34cc200
Eliminate `build.rs`-generated Aarch64 atomic macros (#951)
qinghon Jun 13, 2025
3ab6f9e
tweak runtime/const macro management
RalfJung Jun 13, 2025
f3f8717
Remove "intermittent" wording from `ReadDir`
ChrisDenton Jun 13, 2025
0c78395
Auto merge of #142442 - matthiaskrgr:rollup-6yodjfx, r=matthiaskrgr
bors Jun 13, 2025
cd55106
doc: mention that intrinsics should not be called in user code
scrabsha Jun 13, 2025
654284e
fmaximum,fminimum: Fix incorrect result and add tests
tgross35 Jun 2, 2025
25c15fc
Clean up and sort manifest keys
tgross35 Jun 13, 2025
8a585bf
Auto merge of #142443 - matthiaskrgr:rollup-l1l6d0v, r=matthiaskrgr
bors Jun 13, 2025
c8e789e
Mark compiler-builtins as `publish = false`
tgross35 Jun 13, 2025
3aeeea5
Remove unneeded lifetimes from signature of BTreeSet::extract_if
dtolnay Jun 14, 2025
3a28dcf
Delete `.release-plz.toml`
tgross35 Jun 14, 2025
9fc5828
Rollup merge of #142046 - Qelxiros:122742-vec_peek_mut, r=cuviper
workingjubilee Jun 14, 2025
ad9a9a5
Rollup merge of #142439 - scrabsha:rust/sasha/uwkqrkztvqry, r=RalfJung
workingjubilee Jun 14, 2025
4115287
Rollup merge of #142452 - ChrisDenton:intermittent, r=Noratrieb
workingjubilee Jun 14, 2025
2beeeab
Update the upstream Rust version
tgross35 Jun 14, 2025
ab08040
Merge ref 'd087f112b7d1:/library/compiler-builtins' from https://gith…
tgross35 Jun 14, 2025
7f084e8
Work around out-of-tree testing with a shim crate
tgross35 Jun 14, 2025
2506df3
Rollup merge of #141493 - tamird:addreskind-bytestr, r=joshtriplett
matthiaskrgr Jun 14, 2025
a19aee9
Rollup merge of #141811 - mejrs:bye_locals, r=compiler-errors
matthiaskrgr Jun 14, 2025
d4119db
Rollup merge of #142243 - RalfJung:float-test-dedup, r=tgross35
matthiaskrgr Jun 14, 2025
1ac4f86
Rollup merge of #142484 - dtolnay:bsetextract, r=m-ou-se
matthiaskrgr Jun 14, 2025
8ef42ec
Rollup merge of #142489 - tgross35:update-builtins, r=tgross35
matthiaskrgr Jun 14, 2025
7204ad4
Remove all support for wasm's legacy ABI
bjorn3 Dec 6, 2024
4136fda
Stabilize "file_lock" feature
cberner May 29, 2025
871de6e
Rollup merge of #133952 - bjorn3:remove_wasm_legacy_abi, r=alexcrichton
fmease Jun 15, 2025
2037fc5
Test Debug for Location.
m-ou-se Jun 11, 2025
d91ee16
Update the `backtrace` submodule
tgross35 Jun 16, 2025
1ac5cf0
Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls
yotamofek Jun 9, 2025
febe645
Rollup merge of #142125 - cberner:file_lock_stable, r=ChrisDenton
Kobzol Jun 16, 2025
ea6401f
Rollup merge of #142236 - yotamofek:pr/std/pathbuf-extend-docs, r=tgr…
Kobzol Jun 16, 2025
1befb80
Rollup merge of #142373 - m-ou-se:debug-for-location, r=tgross35
Kobzol Jun 16, 2025
60b8c70
trait_sel: `{Meta,Pointee}Sized` on `Sized` types
davidtwco Jan 16, 2025
309e197
Two changes: Have BorrowError & BorrowMutError derive Debug and add
nealsid Jun 14, 2025
d4b0526
Rename BorrowFlag type to BorrowCounter
nealsid Jun 14, 2025
3b96c9b
Rollup merge of #142562 - tgross35:update-backtrace, r=workingjubilee
Kobzol Jun 16, 2025
42b764e
library/compiler: add `PointeeSized` bounds
davidtwco Feb 10, 2025
4fddff0
lint: don't consider sizedness in upcastable lint
davidtwco Apr 9, 2025
077891e
Make performance of String::insert_str more precise
hkBst Mar 15, 2025
769273d
Rollup merge of #138538 - hkBst:patch-4, r=tgross35
workingjubilee Jun 17, 2025
e76ae1c
Rollup merge of #141946 - xizheyin:141933, r=jhpratt
workingjubilee Jun 17, 2025
7e2f21a
Rollup merge of #142216 - nealsid:refcell-logging, r=tgross35
workingjubilee Jun 17, 2025
c0dc1e7
Auto merge of #137944 - davidtwco:sized-hierarchy, r=oli-obk
bors Jun 17, 2025
a46ec5c
Auto merge of #142613 - workingjubilee:rollup-yuod2hg, r=workingjubilee
bors Jun 17, 2025
baabcaa
Merge from f3db63916e541ff039ac3cd7364c2d612749b61b with conflicts
Jun 27, 2025
147e397
Update toolchain to 2025-06-18
Jun 27, 2025
3526125
Update Kani version to 0024103719917fa097b0beaab089671eb83572e8
Jun 27, 2025
9290c79
Resolve conflicts
tautschnig Jun 27, 2025
df478ec
Disable contracts that are incompatible with Sized hierarchy
tautschnig Jul 3, 2025
94afd99
Disable contract that requires Kani fix
tautschnig Jul 3, 2025
4ea1d27
Whitespace fixes
tautschnig Jul 3, 2025
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
25 changes: 16 additions & 9 deletions library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1489,10 +1489,11 @@ impl String {
Some(ch)
}

/// Removes a [`char`] from this `String` at a byte position and returns it.
/// Removes a [`char`] from this `String` at byte position `idx` and returns it.
///
/// This is an *O*(*n*) operation, as it requires copying every element in the
/// buffer.
/// Copies all bytes after the removed char to new positions.
///
/// Note that calling this in a loop can result in quadratic behavior.
///
/// # Panics
///
Expand Down Expand Up @@ -1678,10 +1679,13 @@ impl String {
drop(guard);
}

/// Inserts a character into this `String` at a byte position.
/// Inserts a character into this `String` at byte position `idx`.
///
/// Reallocates if `self.capacity()` is insufficient, which may involve copying all
/// `self.capacity()` bytes. Makes space for the insertion by copying all bytes of
/// `&self[idx..]` to new positions.
///
/// This is an *O*(*n*) operation as it requires copying every element in the
/// buffer.
/// Note that calling this in a loop can result in quadratic behavior.
///
/// # Panics
///
Expand Down Expand Up @@ -1733,10 +1737,13 @@ impl String {
}
}

/// Inserts a string slice into this `String` at a byte position.
/// Inserts a string slice into this `String` at byte position `idx`.
///
/// Reallocates if `self.capacity()` is insufficient, which may involve copying all
/// `self.capacity()` bytes. Makes space for the insertion by copying all bytes of
/// `&self[idx..]` to new positions.
///
/// This is an *O*(*n*) operation as it requires copying every element in the
/// buffer.
/// Note that calling this in a loop can result in quadratic behavior.
///
/// # Panics
///
Expand Down
66 changes: 30 additions & 36 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ impl<T, const N: usize> Cell<[T; N]> {
#[rustc_diagnostic_item = "RefCell"]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct RefCell<T: ?Sized> {
borrow: Cell<BorrowFlag>,
borrow: Cell<BorrowCounter>,
// Stores the location of the earliest currently active borrow.
// This gets updated whenever we go from having zero borrows
// to having a single borrow. When a borrow occurs, this gets included
Expand All @@ -732,54 +732,48 @@ pub struct RefCell<T: ?Sized> {
/// An error returned by [`RefCell::try_borrow`].
#[stable(feature = "try_borrow", since = "1.13.0")]
#[non_exhaustive]
#[derive(Debug)]
pub struct BorrowError {
#[cfg(feature = "debug_refcell")]
location: &'static crate::panic::Location<'static>,
}

#[stable(feature = "try_borrow", since = "1.13.0")]
impl Debug for BorrowError {
impl Display for BorrowError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut builder = f.debug_struct("BorrowError");

#[cfg(feature = "debug_refcell")]
builder.field("location", self.location);
let res = write!(
f,
"RefCell already mutably borrowed; a previous borrow was at {}",
self.location
);

builder.finish()
}
}
#[cfg(not(feature = "debug_refcell"))]
let res = Display::fmt("RefCell already mutably borrowed", f);

#[stable(feature = "try_borrow", since = "1.13.0")]
impl Display for BorrowError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Display::fmt("already mutably borrowed", f)
res
}
}

/// An error returned by [`RefCell::try_borrow_mut`].
#[stable(feature = "try_borrow", since = "1.13.0")]
#[non_exhaustive]
#[derive(Debug)]
pub struct BorrowMutError {
#[cfg(feature = "debug_refcell")]
location: &'static crate::panic::Location<'static>,
}

#[stable(feature = "try_borrow", since = "1.13.0")]
impl Debug for BorrowMutError {
impl Display for BorrowMutError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut builder = f.debug_struct("BorrowMutError");

#[cfg(feature = "debug_refcell")]
builder.field("location", self.location);
let res = write!(f, "RefCell already borrowed; a previous borrow was at {}", self.location);

builder.finish()
}
}
#[cfg(not(feature = "debug_refcell"))]
let res = Display::fmt("RefCell already borrowed", f);

#[stable(feature = "try_borrow", since = "1.13.0")]
impl Display for BorrowMutError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Display::fmt("already borrowed", f)
res
}
}

Expand All @@ -788,15 +782,15 @@ impl Display for BorrowMutError {
#[track_caller]
#[cold]
fn panic_already_borrowed(err: BorrowMutError) -> ! {
panic!("already borrowed: {:?}", err)
panic!("{err}")
}

// This ensures the panicking code is outlined from `borrow` for `RefCell`.
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
#[track_caller]
#[cold]
fn panic_already_mutably_borrowed(err: BorrowError) -> ! {
panic!("already mutably borrowed: {:?}", err)
panic!("{err}")
}

// Positive values represent the number of `Ref` active. Negative values
Expand All @@ -806,22 +800,22 @@ fn panic_already_mutably_borrowed(err: BorrowError) -> ! {
//
// `Ref` and `RefMut` are both two words in size, and so there will likely never
// be enough `Ref`s or `RefMut`s in existence to overflow half of the `usize`
// range. Thus, a `BorrowFlag` will probably never overflow or underflow.
// range. Thus, a `BorrowCounter` will probably never overflow or underflow.
// However, this is not a guarantee, as a pathological program could repeatedly
// create and then mem::forget `Ref`s or `RefMut`s. Thus, all code must
// explicitly check for overflow and underflow in order to avoid unsafety, or at
// least behave correctly in the event that overflow or underflow happens (e.g.,
// see BorrowRef::new).
type BorrowFlag = isize;
const UNUSED: BorrowFlag = 0;
type BorrowCounter = isize;
const UNUSED: BorrowCounter = 0;

#[inline(always)]
fn is_writing(x: BorrowFlag) -> bool {
fn is_writing(x: BorrowCounter) -> bool {
x < UNUSED
}

#[inline(always)]
fn is_reading(x: BorrowFlag) -> bool {
fn is_reading(x: BorrowCounter) -> bool {
x > UNUSED
}

Expand Down Expand Up @@ -1401,12 +1395,12 @@ impl<T> From<T> for RefCell<T> {
impl<T: CoerceUnsized<U>, U> CoerceUnsized<RefCell<U>> for RefCell<T> {}

struct BorrowRef<'b> {
borrow: &'b Cell<BorrowFlag>,
borrow: &'b Cell<BorrowCounter>,
}

impl<'b> BorrowRef<'b> {
#[inline]
fn new(borrow: &'b Cell<BorrowFlag>) -> Option<BorrowRef<'b>> {
fn new(borrow: &'b Cell<BorrowCounter>) -> Option<BorrowRef<'b>> {
let b = borrow.get().wrapping_add(1);
if !is_reading(b) {
// Incrementing borrow can result in a non-reading value (<= 0) in these cases:
Expand Down Expand Up @@ -1447,7 +1441,7 @@ impl Clone for BorrowRef<'_> {
debug_assert!(is_reading(borrow));
// Prevent the borrow counter from overflowing into
// a writing borrow.
assert!(borrow != BorrowFlag::MAX);
assert!(borrow != BorrowCounter::MAX);
self.borrow.set(borrow + 1);
BorrowRef { borrow: self.borrow }
}
Expand Down Expand Up @@ -1795,7 +1789,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
}

struct BorrowRefMut<'b> {
borrow: &'b Cell<BorrowFlag>,
borrow: &'b Cell<BorrowCounter>,
}

impl Drop for BorrowRefMut<'_> {
Expand All @@ -1809,7 +1803,7 @@ impl Drop for BorrowRefMut<'_> {

impl<'b> BorrowRefMut<'b> {
#[inline]
fn new(borrow: &'b Cell<BorrowFlag>) -> Option<BorrowRefMut<'b>> {
fn new(borrow: &'b Cell<BorrowCounter>) -> Option<BorrowRefMut<'b>> {
// NOTE: Unlike BorrowRefMut::clone, new is called to create the initial
// mutable reference, and so there must currently be no existing
// references. Thus, while clone increments the mutable refcount, here
Expand All @@ -1833,7 +1827,7 @@ impl<'b> BorrowRefMut<'b> {
let borrow = self.borrow.get();
debug_assert!(is_writing(borrow));
// Prevent the borrow counter from underflowing.
assert!(borrow != BorrowFlag::MIN);
assert!(borrow != BorrowCounter::MIN);
self.borrow.set(borrow - 1);
BorrowRefMut { borrow: self.borrow }
}
Expand Down
16 changes: 10 additions & 6 deletions library/core/src/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#![stable(feature = "rust1", since = "1.0.0")]

use crate::marker::PointeeSized;

mod uninit;

/// A common trait that allows explicit creation of a duplicate value.
Expand Down Expand Up @@ -283,7 +285,7 @@ impl_use_cloned! {
reason = "deriving hack, should not be public",
issue = "none"
)]
pub struct AssertParamIsClone<T: Clone + ?Sized> {
pub struct AssertParamIsClone<T: Clone + PointeeSized> {
_field: crate::marker::PhantomData<T>,
}
#[doc(hidden)]
Expand All @@ -293,7 +295,7 @@ pub struct AssertParamIsClone<T: Clone + ?Sized> {
reason = "deriving hack, should not be public",
issue = "none"
)]
pub struct AssertParamIsCopy<T: Copy + ?Sized> {
pub struct AssertParamIsCopy<T: Copy + PointeeSized> {
_field: crate::marker::PhantomData<T>,
}

Expand Down Expand Up @@ -530,6 +532,8 @@ unsafe impl CloneToUninit for crate::bstr::ByteStr {
/// are implemented in `traits::SelectionContext::copy_clone_conditions()`
/// in `rustc_trait_selection`.
mod impls {
use crate::marker::PointeeSized;

macro_rules! impl_clone {
($($t:ty)*) => {
$(
Expand Down Expand Up @@ -560,15 +564,15 @@ mod impls {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> Clone for *const T {
impl<T: PointeeSized> Clone for *const T {
#[inline(always)]
fn clone(&self) -> Self {
*self
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> Clone for *mut T {
impl<T: PointeeSized> Clone for *mut T {
#[inline(always)]
fn clone(&self) -> Self {
*self
Expand All @@ -577,7 +581,7 @@ mod impls {

/// Shared references can be cloned, but mutable references *cannot*!
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> Clone for &T {
impl<T: PointeeSized> Clone for &T {
#[inline(always)]
#[rustc_diagnostic_item = "noop_method_clone"]
fn clone(&self) -> Self {
Expand All @@ -587,5 +591,5 @@ mod impls {

/// Shared references can be cloned, but mutable references *cannot*!
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> !Clone for &mut T {}
impl<T: PointeeSized> !Clone for &mut T {}
}
Loading