Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
8e8b4de
impl Copy for FromBytesUntilNulError
Conaclos Feb 8, 2026
cff9a88
some changes in argument loading in intrinsic-test
sayantn Apr 29, 2026
af754dc
gen-arm: resolve outdated `big_endian_inverse` todo
davidtwco Apr 20, 2026
51f8123
gen-arm: use `neon-stable` anchor throughout
davidtwco Apr 20, 2026
3d5f588
gen-arm: skip `assert_instr` on big-endian
davidtwco May 1, 2026
ea71582
Merge pull request #2101 from sayantn/revert-passes
folkertdev May 6, 2026
75fb1cb
Merge pull request #2099 from sayantn/gen-arm-improvements
folkertdev May 6, 2026
1d556c4
gen-arm: port `vcopy_lane_{s,u,p,f}64` to generator
davidtwco Apr 20, 2026
cf3ac49
gen-arm: port `vcopy_laneq_{f,u,s,p}64` to generator
davidtwco Apr 20, 2026
54b56a3
gen-arm: port `vget_{high,low}_{p,f}64` to generator
davidtwco Apr 20, 2026
fe3e89d
gen-arm: port `vgetq_lane_f64` to generator
davidtwco Apr 20, 2026
4661e73
gen-arm: port `vcombine_f64` to generator
davidtwco Apr 20, 2026
1c2d423
core_arch: remove redundant tests
davidtwco May 1, 2026
11fd314
loongarch: Use `intrinsics::simd` for vbit{clr,rev,set}
heiher Apr 21, 2026
1e13d52
gen-arm: change defn of `vabdl_high_u{8,16,32}`
davidtwco Apr 20, 2026
a5073bc
gen-arm: write `vtbl{1,2,3,4}` in terms of `vqtbl`
davidtwco Apr 29, 2026
6218201
gen-arm: write `vtbx{1,2,3,4}` in terms of `vqtbx`
davidtwco Apr 30, 2026
55c9deb
Merge pull request #2105 from sayantn/gen-arm-improvements
folkertdev May 7, 2026
37473be
Merge pull request #2093 from heiher/vbit-clr-rev-set
folkertdev May 7, 2026
1964b04
Merge pull request #2100 from sayantn/gen-arm-ports
Amanieu May 8, 2026
c80d077
loongarch: Use `intrinsics::simd` for vs{add,sub}
heiher Apr 24, 2026
a023ebf
gen-arm: fix `vmlal`, `vmlsl` and `vmull`
sayantn Apr 30, 2026
aa37c1b
gen-arm: fix `vfmlal` and `vfmlsl`
sayantn Apr 30, 2026
0d76cbe
Merge pull request #2107 from sayantn/gen-arm-improvements
folkertdev May 8, 2026
a2e7797
replace uses of `simd_extract` with `vget_lane`
sayantn May 8, 2026
7050d69
gen-arm: use LLVM intrinsics for `f16` to `{i,u}16`
davidtwco Apr 20, 2026
7fb11ae
Use latest clang versions from kernel.org
sayantn Apr 30, 2026
229d480
Change implementation of `vext`
sayantn May 8, 2026
f603c7f
Change implementation of `vcopy{q}_lane{q}`
sayantn May 8, 2026
8d56c77
Change implementation of `vab{a,d}l_high`
sayantn May 8, 2026
4871c49
Change implementation of `vcvt{x}_f32_f64`
sayantn May 8, 2026
da1b202
Change implementation of `vml{a,s}{l}_lane`
sayantn May 8, 2026
ccb273a
Change implementation of `vmov{n,l}_high`
sayantn May 8, 2026
c02a41c
Change implementation of `vmull_{high,lane}`
sayantn May 8, 2026
401582d
Change implementation of `vmulx_lane`
sayantn May 8, 2026
63d8cef
Change implementation of `v{add,sub}{l,w}_high`
sayantn May 8, 2026
1404a1e
Change implementation of `vqdmull{_high}{_lane}` and `vqrdmulh_lane`
sayantn May 8, 2026
077f63f
Change implementation of `vqmov{u}n_high`
sayantn May 8, 2026
933aa5c
Change implementation of `vqrdml{a,s}h_lane`
sayantn May 8, 2026
d4bb7f4
Change implementation of `v{q}{r}shr{u}n_high_n`
sayantn May 9, 2026
3dd1690
Change implementation of `vr{add,sub}hn_high`
sayantn May 9, 2026
cee8ece
Change implementation of `vmul_lane`
sayantn May 9, 2026
0d1fd7f
Change implementation of `vld1_dup`
sayantn May 9, 2026
95e2c0f
Change implementation of `v{us,su,}dot_lane`
sayantn May 9, 2026
6338558
Split `vcopyq_lane{q}_p64` due to `vsetq_lane_p64` requiring `aes`
sayantn May 9, 2026
5187765
Merge pull request #2097 from heiher/vsadd-sub
sayantn May 9, 2026
494200b
loongarch: Use `intrinsics::simd` for vadda
heiher May 6, 2026
256c083
Merge pull request #2108 from sayantn/cleanup-gen-arm
folkertdev May 9, 2026
7012f65
gen-arm: split `vreinterpret` defn into multiple
davidtwco Apr 20, 2026
1d3d922
Remove the heuristic for big-endian reversal, reversing only if reque…
sayantn May 9, 2026
611b200
Revert "Change implementation of `vld1_dup`"
sayantn May 10, 2026
bee0bf6
Merge pull request #2103 from heiher/vadda
sayantn May 10, 2026
9de432f
Merge pull request #2112 from sayantn/revert-passes
folkertdev May 10, 2026
5b038a3
Merge pull request #2111 from sayantn/remove-heuristic
folkertdev May 10, 2026
46b8878
Add davidtwco and adamgemmell as maintainers
Amanieu May 10, 2026
f42d908
Merge pull request #2113 from Amanieu/stdarch-maintainers2
Amanieu May 11, 2026
1330bfb
Merge pull request #2106 from sayantn/cvtf16s16
folkertdev May 11, 2026
2f90236
Fix invalid suggestion for parenthesized break
el-ev May 11, 2026
98b0121
loongarch: Use `intrinsics::simd` for vabsd
heiher May 6, 2026
f0a72ad
stabilize `feature(cfg_target_has_atomic_equal_alignment)`
WaffleLapkin Apr 8, 2026
665ec41
rename `cfg(target_has_atomic_{equal=>primitive}_alignment)`
WaffleLapkin May 11, 2026
0e97ab3
Correct small typo in gen-arm
sayantn May 11, 2026
ffe6e2a
Implement `vcmla_lane` with ARM intrinsics
sayantn May 11, 2026
fc7d746
Merge pull request #2115 from sayantn/cleanup-gen-arm
folkertdev May 11, 2026
c477e71
Remove code for compiling and comparing C and Rust files, made the C …
sayantn Mar 9, 2026
a6c9e82
zeroall/zeroupper *are* supported by Miri
RalfJung May 12, 2026
3c7dee4
Update/add comments for miri-ignored tests
RalfJung May 12, 2026
e91ca04
explain ignore aarch64 tests
RalfJung May 12, 2026
fc8d4c4
Merge pull request #2116 from RalfJung/miri-tests
adamgemmell May 12, 2026
1458d88
Merge pull request #2114 from heiher/vabsd
folkertdev May 12, 2026
35d77fb
loongarch: Use `intrinsics::simd` for vpick{ev,od}
heiher May 7, 2026
ee0c016
Generate rust bindings and test code
sayantn Apr 30, 2026
0962db6
Use pointers for the C definitions to resolve ABI inconsistencies
sayantn Apr 24, 2026
a5179d0
Make floats static, as rounding is not a real concern here anymore
sayantn May 7, 2026
10f4190
Modify the CI scripts to work with the new design
sayantn Mar 16, 2026
f09bf0b
gen-arm: toggle `big_endian_inverse` where required
sayantn May 9, 2026
0415e2f
Disable some `assert_instr` tests in big-endian
sayantn May 10, 2026
b13eb77
Fix `_mm_sm3rnds2_epi32`
sayantn Apr 29, 2026
deaa509
Disable some tests in x86 due to CI failures
sayantn May 10, 2026
921b35b
Implement OsStr::split_at
ChrisDenton May 11, 2026
b24fe3e
Merge pull request #2118 from heiher/vpick-ev-od
sayantn May 15, 2026
53a4efa
disallow `target_has_atomic_primitive_alignment` with no value
WaffleLapkin May 15, 2026
2f69883
update list of cfgs in `src/doc/rustc`
WaffleLapkin May 15, 2026
638a775
Add pext/pdep as aliases for extract_bits/deposit_bits
niklasf May 15, 2026
4950a3c
updated map.rs .values() method to use assert instead of println!
BowLuckie May 16, 2026
20f68ae
Updated `map.rs` functions to all use asserts instread of `println!` …
BowLuckie May 16, 2026
760b3f4
fixed some bugs in hashmap documentation comments
BowLuckie May 16, 2026
3e3baaf
removed extra space after `///`
BowLuckie May 16, 2026
521b89a
Update `sysinfo` version to `0.39.2`
GuillaumeGomez May 17, 2026
62e5952
Remove `array::{try_,}from_trusted_iterator`
theemathas May 17, 2026
ea703e2
Remove `UncheckedIterator`
theemathas May 17, 2026
d913db7
Merge pull request #2063 from sayantn/intrinsic-test
Amanieu May 17, 2026
7905c8f
Add diagnostic items for IoBufReader and StdinLock
JaafarTanoukhi May 18, 2026
0a07235
Widen 'widening_mul' result; Remove 'widening_mul' from 'u128' and 'i…
bjoernager May 16, 2026
7450bf0
reduce usage of `box_patterns` in tests
cyrgani May 14, 2026
450cdb5
Allow `global_asm!` in statement positions
daxpedda May 14, 2026
0deac0f
Rollup merge of #156709 - sayantn:stdarch-sync-2026-05-18, r=sayantn
JonathanBrouwer May 18, 2026
33d6fe7
Rollup merge of #155006 - WaffleLapkin:stabilize_cfg_target_has_atomi…
JonathanBrouwer May 18, 2026
a6138ec
Rollup merge of #156444 - ChrisDenton:os_str_split_at, r=nia-e
JonathanBrouwer May 18, 2026
59eda84
Rollup merge of #156582 - daxpedda:global-asm-statement, r=petrochenkov
JonathanBrouwer May 18, 2026
43de103
Rollup merge of #156661 - theemathas:del-unchecked-iter, r=SimonSapin
JonathanBrouwer May 18, 2026
18bedf4
Rollup merge of #152367 - Conaclos:conaclos/FromBytesUntilNulError-im…
JonathanBrouwer May 18, 2026
e7d5c0a
Rollup merge of #156443 - el-ev:fix-break-sugg, r=ShoyuVanilla
JonathanBrouwer May 18, 2026
9333565
Rollup merge of #156606 - niklasf:alias-pext-pdep, r=SimonSapin
JonathanBrouwer May 18, 2026
a26a652
Rollup merge of #156630 - BowLuckie:main, r=clarfonthey
JonathanBrouwer May 18, 2026
3605c1f
Rollup merge of #156644 - bjoernager:widening-mul, r=clarfonthey
JonathanBrouwer May 18, 2026
1056a02
Rollup merge of #156653 - GuillaumeGomez:update-sysinfo, r=SimonSapin
JonathanBrouwer May 18, 2026
4cce353
Rollup merge of #156697 - JaafarTanoukhi:iobufreader-stdinlock-diag-i…
JonathanBrouwer May 18, 2026
7c3bc86
Rollup merge of #156704 - cyrgani:unbox-tests, r=mu001999
JonathanBrouwer May 18, 2026
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
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5430,9 +5430,9 @@ dependencies = [

[[package]]
name = "sysinfo"
version = "0.39.0"
version = "0.39.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd9f9fe3d2b7b75cf4f2805e5b9926e8ac47146667b16b86298c4a8bf08cc469"
checksum = "14311e7e9a03114cd4b65eedd54e8fed2945e17f08586ae97ef53bc0669f9581"
dependencies = [
"libc",
"objc2-core-foundation",
Expand Down
42 changes: 31 additions & 11 deletions compiler/rustc_builtin_macros/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_parse_format as parse;
use rustc_session::lint;
use rustc_span::{ErrorGuaranteed, InnerSpan, Span, Symbol, sym};
use rustc_target::asm::InlineAsmArch;
use smallvec::smallvec;
use smallvec::{SmallVec, smallvec};

use crate::errors;
use crate::util::{ExprToSpannedString, expr_to_spanned_string};
Expand All @@ -26,6 +26,24 @@ struct ValidatedAsmArgs {
pub options_spans: Vec<Span>,
}

struct MacGlobalAsm {
item: ast::Item,
}

impl MacResult for MacGlobalAsm {
fn make_items(self: Box<Self>) -> Option<SmallVec<[Box<ast::Item>; 1]>> {
Some(smallvec![Box::new(self.item)])
}

fn make_stmts(self: Box<Self>) -> Option<SmallVec<[ast::Stmt; 1]>> {
Some(smallvec![ast::Stmt {
id: ast::DUMMY_NODE_ID,
span: self.item.span,
kind: ast::StmtKind::Item(Box::new(self.item)),
}])
}
}

fn parse_args<'a>(
ecx: &ExtCtxt<'a>,
sp: Span,
Expand Down Expand Up @@ -650,18 +668,20 @@ pub(super) fn expand_global_asm<'cx>(
return ExpandResult::Retry(());
};
match mac {
Ok(inline_asm) => MacEager::items(smallvec![Box::new(ast::Item {
attrs: ast::AttrVec::new(),
id: ast::DUMMY_NODE_ID,
kind: ast::ItemKind::GlobalAsm(Box::new(inline_asm)),
vis: ast::Visibility {
span: sp.shrink_to_lo(),
kind: ast::VisibilityKind::Inherited,
Ok(inline_asm) => Box::new(MacGlobalAsm {
item: ast::Item {
attrs: ast::AttrVec::new(),
id: ast::DUMMY_NODE_ID,
kind: ast::ItemKind::GlobalAsm(Box::new(inline_asm)),
vis: ast::Visibility {
span: sp.shrink_to_lo(),
kind: ast::VisibilityKind::Inherited,
tokens: None,
},
span: sp,
tokens: None,
},
span: sp,
tokens: None,
})]),
}),
Err(guar) => DummyResult::any(sp, guar),
}
}
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ declare_features! (
(accepted, cfg_target_abi, "1.78.0", Some(80970)),
/// Allows `cfg(target_feature = "...")`.
(accepted, cfg_target_feature, "1.27.0", Some(29717)),
/// Allows `cfg(target_has_atomic_primitive_alignment = "...")`.
(accepted, cfg_target_has_atomic_equal_alignment, "CURRENT_RUSTC_VERSION", Some(93822)),
/// Allows `cfg(target_vendor = "...")`.
(accepted, cfg_target_vendor, "1.33.0", Some(29718)),
/// Allows implementing `Clone` for closures where possible (RFC 2132).
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ const GATED_CFGS: &[GatedCfg] = &[
(sym::ub_checks, sym::cfg_ub_checks, Features::cfg_ub_checks),
(sym::contract_checks, sym::cfg_contract_checks, Features::cfg_contract_checks),
(sym::target_thread_local, sym::cfg_target_thread_local, Features::cfg_target_thread_local),
(
sym::target_has_atomic_equal_alignment,
sym::cfg_target_has_atomic_equal_alignment,
Features::cfg_target_has_atomic_equal_alignment,
),
(
sym::target_has_atomic_load_store,
sym::cfg_target_has_atomic,
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ declare_features! (
(unstable, cfg_target_compact, "1.63.0", Some(96901)),
/// Allows `cfg(target_has_atomic_load_store = "...")`.
(unstable, cfg_target_has_atomic, "1.60.0", Some(94039)),
/// Allows `cfg(target_has_atomic_equal_alignment = "...")`.
(unstable, cfg_target_has_atomic_equal_alignment, "1.60.0", Some(93822)),
/// Allows `cfg(target_object_format = "...")`.
(unstable, cfg_target_object_format, "CURRENT_RUSTC_VERSION", Some(152586)),
/// Allows `cfg(target_thread_local)`.
Expand Down
8 changes: 7 additions & 1 deletion compiler/rustc_hir_typeck/src/loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,13 @@ impl<'hir> Visitor<'hir> for CheckLoopVisitor<'hir> {
}
}

let sp_lo = e.span.with_lo(e.span.lo() + BytePos("break".len() as u32));
let sp_lo = if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(e.span)
&& let Some(break_pos) = snippet.find("break")
{
e.span.with_lo(e.span.lo() + BytePos((break_pos + "break".len()) as u32))
} else {
e.span.with_lo(e.span.lo() + BytePos("break".len() as u32))
};
let label_sp = match break_destination.label {
Some(label) => sp_lo.with_hi(label.ident.span.hi()),
None => sp_lo.shrink_to_lo(),
Expand Down
11 changes: 4 additions & 7 deletions compiler/rustc_session/src/config/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub(crate) fn disallow_cfgs(sess: &Session, user_cfgs: &Cfg) {
| (sym::target_pointer_width, Some(_))
| (sym::target_vendor, None | Some(_))
| (sym::target_has_atomic, Some(_))
| (sym::target_has_atomic_equal_alignment, Some(_))
| (sym::target_has_atomic_primitive_alignment, Some(_))
| (sym::target_has_atomic_load_store, Some(_))
| (sym::target_has_reliable_f16, None | Some(_))
| (sym::target_has_reliable_f16_math, None | Some(_))
Expand Down Expand Up @@ -293,7 +293,7 @@ pub(crate) fn default_configuration(sess: &Session) -> Cfg {
ins_sym!(sym::target_has_atomic, sym);
}
if align.bits() == i {
ins_sym!(sym::target_has_atomic_equal_alignment, sym);
ins_sym!(sym::target_has_atomic_primitive_alignment, sym);
}
ins_sym!(sym::target_has_atomic_load_store, sym);
};
Expand Down Expand Up @@ -485,13 +485,10 @@ impl CheckCfg {
sym::integer(64usize),
sym::integer(128usize),
];
for sym in [
sym::target_has_atomic,
sym::target_has_atomic_equal_alignment,
sym::target_has_atomic_load_store,
] {
for sym in [sym::target_has_atomic, sym::target_has_atomic_load_store] {
ins!(sym, no_values).extend(atomic_values);
}
ins!(sym::target_has_atomic_primitive_alignment, empty_values).extend(atomic_values);

ins!(sym::target_thread_local, no_values);

Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ symbols! {
IntoFuture,
IntoIterator,
IntoIteratorItem,
IoBufReader,
IrTyKind,
Item,
ItemContext,
Expand Down Expand Up @@ -306,6 +307,7 @@ symbols! {
Some,
Source,
SpanCtxt,
StdinLock,
Str,
String,
Struct,
Expand Down Expand Up @@ -2023,8 +2025,8 @@ symbols! {
target_feature_11,
target_feature_inline_always,
target_has_atomic,
target_has_atomic_equal_alignment,
target_has_atomic_load_store,
target_has_atomic_primitive_alignment,
target_has_reliable_f16,
target_has_reliable_f16_math,
target_has_reliable_f128,
Expand Down
3 changes: 1 addition & 2 deletions library/core/src/array/drain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ impl<'l, 'f, T, U, F: FnMut(T) -> U> Drain<'l, 'f, T, F> {
/// This function returns a function that lets you index the given array in const.
/// As implemented it can optimize better than iterators, and can be constified.
/// It acts like a sort of guard (owns the array) and iterator combined, which can be implemented
/// as it is a struct that implements const fn;
/// in that regard it is somewhat similar to an array::Iter implementing `UncheckedIterator`.
/// as it is a struct that implements const fn.
/// The only method you're really allowed to call is `next()`,
/// anything else is more or less UB, hence this function being unsafe.
/// Moved elements will not be dropped.
Expand Down
50 changes: 14 additions & 36 deletions library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::convert::Infallible;
use crate::error::Error;
use crate::hash::{self, Hash};
use crate::intrinsics::transmute_unchecked;
use crate::iter::{TrustedLen, UncheckedIterator, repeat_n};
use crate::iter::{TrustedLen, repeat_n};
use crate::marker::Destruct;
use crate::mem::{self, ManuallyDrop, MaybeUninit};
use crate::ops::{
Expand Down Expand Up @@ -52,7 +52,10 @@ pub use iter::IntoIter;
#[must_use = "cloning is often expensive and is not expected to have side effects"]
#[stable(feature = "array_repeat", since = "1.91.0")]
pub fn repeat<T: Clone, const N: usize>(val: T) -> [T; N] {
from_trusted_iterator(repeat_n(val, N))
let mut iter = repeat_n(val, N);
// SAFETY: Unless a panic occurs, from_fn will call the closure N times,
// and repeat_n's next() will return Some for N times.
from_fn(move |_| unsafe { iter.next().unwrap_unchecked() })
}

/// Creates an array where each element is produced by calling `f` with
Expand Down Expand Up @@ -464,7 +467,15 @@ trait SpecArrayClone: Clone {
impl<T: Clone> SpecArrayClone for T {
#[inline]
default fn clone<const N: usize>(array: &[T; N]) -> [T; N] {
from_trusted_iterator(array.iter().cloned())
let mut ptr: *const T = array.as_ptr();
// SAFETY: Unless a panic occurs, from_fn will call the closure N times,
// so our pointer arithmetic will be in bounds for the N-element array.
// This works even for ZSTs, since in that case, add() is a no-op.
from_fn(move |_| unsafe {
let old = ptr;
ptr = ptr.add(1);
(&*old).clone()
})
}
}

Expand Down Expand Up @@ -877,39 +888,6 @@ impl<T, const N: usize> [T; N] {
}
}

/// Populate an array from the first `N` elements of `iter`
///
/// # Panics
///
/// If the iterator doesn't actually have enough items.
///
/// By depending on `TrustedLen`, however, we can do that check up-front (where
/// it easily optimizes away) so it doesn't impact the loop that fills the array.
#[inline]
fn from_trusted_iterator<T, const N: usize>(iter: impl UncheckedIterator<Item = T>) -> [T; N] {
try_from_trusted_iterator(iter.map(NeverShortCircuit)).0
}

#[inline]
fn try_from_trusted_iterator<T, R, const N: usize>(
iter: impl UncheckedIterator<Item = R>,
) -> ChangeOutputType<R, [T; N]>
where
R: Try<Output = T>,
R::Residual: Residual<[T; N]>,
{
assert!(iter.size_hint().0 >= N);
fn next<T>(mut iter: impl UncheckedIterator<Item = T>) -> impl FnMut(usize) -> T {
move |_| {
// SAFETY: We know that `from_fn` will call this at most N times,
// and we checked to ensure that we have at least that many items.
unsafe { iter.next_unchecked() }
}
}

try_from_fn(next(iter))
}

/// Version of [`try_from_fn`] using a passed-in slice in order to avoid
/// needing to monomorphize for every array length.
///
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl Error for FromBytesWithNulError {}
/// within the slice.
///
/// This error is created by the [`CStr::from_bytes_until_nul`] method.
#[derive(Clone, PartialEq, Eq, Debug)]
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
#[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
pub struct FromBytesUntilNulError(());

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ fn div_rem_1e16(n: u128) -> (u128, u64) {
const M_HIGH: u128 = 76624777043294442917917351357515459181;
const SH_POST: u8 = 51;

let quot = n.widening_mul(M_HIGH).1 >> SH_POST;
let quot = n.carrying_mul(M_HIGH, 0).1 >> SH_POST;
let rem = n - quot * D;
(quot, rem as u64)
}
15 changes: 1 addition & 14 deletions library/core/src/iter/adapters/cloned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::num::NonZero;

use crate::iter::adapters::zip::try_get_unchecked;
use crate::iter::adapters::{SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce};
use crate::iter::{FusedIterator, InPlaceIterable, TrustedLen, UncheckedIterator};
use crate::iter::{FusedIterator, InPlaceIterable, TrustedLen};
use crate::ops::Try;

/// An iterator that clones the elements of an underlying iterator.
Expand Down Expand Up @@ -142,19 +142,6 @@ where
{
}

impl<'a, I, T: 'a> UncheckedIterator for Cloned<I>
where
I: UncheckedIterator<Item = &'a T>,
T: Clone,
{
unsafe fn next_unchecked(&mut self) -> T {
// SAFETY: `Cloned` is 1:1 with the inner iterator, so if the caller promised
// that there's an element left, the inner iterator has one too.
let item = unsafe { self.it.next_unchecked() };
item.clone()
}
}

#[stable(feature = "default_iters", since = "1.70.0")]
impl<I: Default> Default for Cloned<I> {
/// Creates a `Cloned` iterator from the default value of `I`
Expand Down
15 changes: 1 addition & 14 deletions library/core/src/iter/adapters/map.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::fmt;
use crate::iter::adapters::zip::try_get_unchecked;
use crate::iter::adapters::{SourceIter, TrustedRandomAccess, TrustedRandomAccessNoCoerce};
use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused, TrustedLen, UncheckedIterator};
use crate::iter::{FusedIterator, InPlaceIterable, TrustedFused, TrustedLen};
use crate::num::NonZero;
use crate::ops::Try;

Expand Down Expand Up @@ -194,19 +194,6 @@ where
{
}

impl<B, I, F> UncheckedIterator for Map<I, F>
where
I: UncheckedIterator,
F: FnMut(I::Item) -> B,
{
unsafe fn next_unchecked(&mut self) -> B {
// SAFETY: `Map` is 1:1 with the inner iterator, so if the caller promised
// that there's an element left, the inner iterator has one too.
let item = unsafe { self.iter.next_unchecked() };
(self.f)(item)
}
}

#[doc(hidden)]
#[unstable(feature = "trusted_random_access", issue = "none")]
unsafe impl<I, F> TrustedRandomAccess for Map<I, F> where I: TrustedRandomAccess {}
Expand Down
11 changes: 1 addition & 10 deletions library/core/src/iter/adapters/zip.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::cmp;
use crate::fmt::{self, Debug};
use crate::iter::{
FusedIterator, InPlaceIterable, SourceIter, TrustedFused, TrustedLen, UncheckedIterator,
};
use crate::iter::{FusedIterator, InPlaceIterable, SourceIter, TrustedFused, TrustedLen};
use crate::num::NonZero;

/// An iterator that iterates two other iterators simultaneously.
Expand Down Expand Up @@ -456,13 +454,6 @@ where
{
}

impl<A, B> UncheckedIterator for Zip<A, B>
where
A: UncheckedIterator,
B: UncheckedIterator,
{
}

// Arbitrarily selects the left side of the zip iteration as extractable "source"
// it would require negative trait bounds to be able to try both
#[unstable(issue = "none", feature = "inplace_iteration")]
Expand Down
1 change: 0 additions & 1 deletion library/core/src/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ pub use self::traits::TrustedFused;
pub use self::traits::TrustedLen;
#[unstable(feature = "trusted_step", issue = "85731")]
pub use self::traits::TrustedStep;
pub(crate) use self::traits::UncheckedIterator;
#[stable(feature = "rust1", since = "1.0.0")]
pub use self::traits::{
DoubleEndedIterator, ExactSizeIterator, Extend, FromIterator, IntoIterator, Product, Sum,
Expand Down
4 changes: 1 addition & 3 deletions library/core/src/iter/sources/repeat_n.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::fmt;
use crate::iter::{FusedIterator, TrustedLen, UncheckedIterator};
use crate::iter::{FusedIterator, TrustedLen};
use crate::num::NonZero;
use crate::ops::Try;

Expand Down Expand Up @@ -211,5 +211,3 @@ impl<A: Clone> FusedIterator for RepeatN<A> {}

#[unstable(feature = "trusted_len", issue = "37572")]
unsafe impl<A: Clone> TrustedLen for RepeatN<A> {}
#[stable(feature = "iter_repeat_n", since = "1.82.0")]
impl<A: Clone> UncheckedIterator for RepeatN<A> {}
Loading
Loading