Skip to content

Rollup of 16 pull requests #143951

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

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f1b5a56
wrapping shift: remove first bitmask and table
hkBst Jul 3, 2025
cfb66e5
Consolidate infinity tests
rocurley Jul 10, 2025
c5e67b4
Consolidate test_num tests
rocurley Jul 10, 2025
c2e6b39
Consolidate neg_infinity tests
rocurley Jul 10, 2025
0c01322
Consolidate zero tests
rocurley Jul 10, 2025
fc01eed
Consolidate negative zero tests
rocurley Jul 10, 2025
868020e
Consolidate one tests
rocurley Jul 10, 2025
1b8904c
Consolidate is_nan
rocurley Jul 10, 2025
e3d8367
Consolidate is_infinite tests
rocurley Jul 10, 2025
7dd2811
Consolidate is_finite tests
rocurley Jul 10, 2025
d2c1900
Consolidate is_normal tests
rocurley Jul 10, 2025
79769f2
Consolidate classify tests
rocurley Jul 10, 2025
5d7db7e
Fixed a core crate compilation failure when enabling the `optimize_fo…
nazo6 Jul 12, 2025
afeed50
Adjust `run_make_support::symbols` helpers
jieyouxu Jul 12, 2025
1d0cbc6
Update `run-make` tests to use adjusted `symbols` helpers
jieyouxu Jul 12, 2025
6760cd2
core: make `str::split_at_unchecked()` inline
Kijewski Jul 13, 2025
9fd3886
Add experimental backtrace-trace-only std feature
ChrisDenton Jul 13, 2025
000e67a
Preserve constness in trait objects up to hir ty lowering
oli-obk Jul 9, 2025
1b8d65e
rustc_type_ir/walk: move docstring to `TypeWalker` itself
ada4a Jul 14, 2025
ae1b1b4
tests: Fix duplicated-path-in-error fail with musl
Gelbpunkt Jun 10, 2025
904273c
Register change tracker warning for removal of `./x suggest`
jieyouxu Jul 8, 2025
91d064b
Remove current implementation of `./x suggest`
jieyouxu Jul 8, 2025
647c051
Regenerate completions after removing `./x suggest`
jieyouxu Jul 8, 2025
186afbb
Remove mentions of `./x suggest` and `suggest-tests` in rustc-dev-guide
jieyouxu Jul 8, 2025
0a899e0
Update triagebot autolabel
jieyouxu Jul 8, 2025
1669ba0
Update books
rustbot Jul 14, 2025
89a5a10
rustdoc-json: Structured attributes
aDotInTheVoid Jun 20, 2025
9bdd3b0
Don't always panic if WASI_SDK_PATH is not set when detecting compilers
Jul 10, 2025
d0153f5
update `cfg_select!` documentation
folkertdev Jul 14, 2025
f0d0afa
Port `#[pointee]` to the new attribute parsing infrastructure
JonathanBrouwer Jul 13, 2025
02dc14b
Update mdbook to 0.4.52
ehuss Jul 14, 2025
c79d2d5
Rollup merge of #142301 - Gelbpunkt:duplicated-path-in-error-musl, r=…
jhpratt Jul 15, 2025
bd66814
Rollup merge of #142936 - aDotInTheVoid:rdj-shatts-forrealthistime, r…
jhpratt Jul 15, 2025
f5dfd57
Rollup merge of #143355 - hkBst:cleanup-shift-double-bitmask, r=Mark-…
jhpratt Jul 15, 2025
6c96a13
Rollup merge of #143630 - jieyouxu:drop-suggest, r=Mark-Simulacrum
jhpratt Jul 15, 2025
74fd816
Rollup merge of #143738 - rocurley:float_tests_refactor_2, r=tgross35
jhpratt Jul 15, 2025
7748d1c
Rollup merge of #143752 - pmur:murp/no-panic-detect-wasi-cc, r=Kobzol
jhpratt Jul 15, 2025
f0376a9
Rollup merge of #143820 - nazo6:fix-optimize-for-size, r=Mark-Simulacrum
jhpratt Jul 15, 2025
1685e7e
Rollup merge of #143837 - jieyouxu:symbol-apis, r=ChrisDenton
jhpratt Jul 15, 2025
033e429
Rollup merge of #143878 - JonathanBrouwer:pointee_parser, r=jdonszelmann
jhpratt Jul 15, 2025
f9e32e1
Rollup merge of #143907 - Kijewski:pr-inline-split_at_unchecked, r=Ma…
jhpratt Jul 15, 2025
f4b6668
Rollup merge of #143910 - ChrisDenton:no-symbolization, r=tgross35
jhpratt Jul 15, 2025
a147f49
Rollup merge of #143927 - oli-obk:const-dyn-trait-hir-ty, r=fmease
jhpratt Jul 15, 2025
b096796
Rollup merge of #143935 - ada4a:walk-docstring, r=compiler-errors
jhpratt Jul 15, 2025
4d017e8
Rollup merge of #143938 - rustbot:docs-update, r=ehuss
jhpratt Jul 15, 2025
e52a780
Rollup merge of #143941 - folkertdev:cfg-select-docs, r=traviscross
jhpratt Jul 15, 2025
bd93aa9
Rollup merge of #143948 - ehuss:update-mdbook, r=Mark-Simulacrum
jhpratt Jul 15, 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
8 changes: 0 additions & 8 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5069,14 +5069,6 @@ dependencies = [
"syn 1.0.109",
]

[[package]]
name = "suggest-tests"
version = "0.1.0"
dependencies = [
"build_helper",
"glob",
]

[[package]]
name = "syn"
version = "1.0.109"
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ members = [
"src/tools/rustdoc-gui-test",
"src/tools/rustdoc-themes",
"src/tools/rustfmt",
"src/tools/suggest-tests",
"src/tools/test-float-parse",
"src/tools/tidy",
"src/tools/tier-check",
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_attr_data_structures/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ pub enum AttributeKind {
/// Represents `#[path]`
Path(Symbol, Span),

/// Represents `#[pointee]`
Pointee(Span),

/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
PubTransparent(Span),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl AttributeKind {
ParenSugar(..) => No,
PassByValue(..) => Yes,
Path(..) => No,
Pointee(..) => No,
PubTransparent(..) => Yes,
Repr { .. } => No,
RustcLayoutScalarValidRangeEnd(..) => Yes,
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,10 @@ impl<S: Stage> NoArgsAttributeParser<S> for FundamentalParser {
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::Fundamental;
}

pub(crate) struct PointeeParser;
impl<S: Stage> NoArgsAttributeParser<S> for PointeeParser {
const PATH: &[Symbol] = &[sym::pointee];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::Pointee;
}
5 changes: 3 additions & 2 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ use crate::attributes::test_attrs::IgnoreParser;
use crate::attributes::traits::{
AllowIncoherentImplParser, CoherenceIsCoreParser, CoinductiveParser, ConstTraitParser,
DenyExplicitImplParser, DoNotImplementViaObjectParser, FundamentalParser, MarkerParser,
ParenSugarParser, SkipDuringMethodDispatchParser, SpecializationTraitParser, TypeConstParser,
UnsafeSpecializationMarkerParser,
ParenSugarParser, PointeeParser, SkipDuringMethodDispatchParser, SpecializationTraitParser,
TypeConstParser, UnsafeSpecializationMarkerParser,
};
use crate::attributes::transparency::TransparencyParser;
use crate::attributes::{AttributeParser as _, Combine, Single, WithoutArgs};
Expand Down Expand Up @@ -178,6 +178,7 @@ attribute_parsers!(
Single<WithoutArgs<OmitGdbPrettyPrinterSectionParser>>,
Single<WithoutArgs<ParenSugarParser>>,
Single<WithoutArgs<PassByValueParser>>,
Single<WithoutArgs<PointeeParser>>,
Single<WithoutArgs<PubTransparentParser>>,
Single<WithoutArgs<SpecializationTraitParser>>,
Single<WithoutArgs<StdInternalSymbolParser>>,
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_builtin_macros/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ builtin_macros_cfg_accessible_literal_path = `cfg_accessible` path cannot be a l
builtin_macros_cfg_accessible_multiple_paths = multiple `cfg_accessible` paths are specified
builtin_macros_cfg_accessible_unspecified_path = `cfg_accessible` path is not specified
builtin_macros_cfg_select_no_matches = none of the rules in this `cfg_select` evaluated to true
builtin_macros_cfg_select_no_matches = none of the predicates in this `cfg_select` evaluated to true
builtin_macros_cfg_select_unreachable = unreachable rule
builtin_macros_cfg_select_unreachable = unreachable predicate
.label = always matches
.label2 = this rules is never reached
.label2 = this predicate is never reached
builtin_macros_coerce_pointee_requires_maybe_sized = `derive(CoercePointee)` requires `{$name}` to be marked `?Sized`
Expand Down
16 changes: 8 additions & 8 deletions compiler/rustc_builtin_macros/src/cfg_select.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use rustc_ast::tokenstream::TokenStream;
use rustc_attr_parsing as attr;
use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacroExpanderResult};
use rustc_parse::parser::cfg_select::{CfgSelectBranches, CfgSelectRule, parse_cfg_select};
use rustc_parse::parser::cfg_select::{CfgSelectBranches, CfgSelectPredicate, parse_cfg_select};
use rustc_span::{Ident, Span, sym};

use crate::errors::{CfgSelectNoMatches, CfgSelectUnreachable};

/// Selects the first arm whose rule evaluates to true.
/// Selects the first arm whose predicate evaluates to true.
fn select_arm(ecx: &ExtCtxt<'_>, branches: CfgSelectBranches) -> Option<(TokenStream, Span)> {
for (cfg, tt, arm_span) in branches.reachable {
if attr::cfg_matches(
Expand All @@ -30,11 +30,11 @@ pub(super) fn expand_cfg_select<'cx>(
ExpandResult::Ready(match parse_cfg_select(&mut ecx.new_parser_from_tts(tts)) {
Ok(branches) => {
if let Some((underscore, _, _)) = branches.wildcard {
// Warn for every unreachable rule. We store the fully parsed branch for rustfmt.
for (rule, _, _) in &branches.unreachable {
let span = match rule {
CfgSelectRule::Wildcard(underscore) => underscore.span,
CfgSelectRule::Cfg(cfg) => cfg.span(),
// Warn for every unreachable predicate. We store the fully parsed branch for rustfmt.
for (predicate, _, _) in &branches.unreachable {
let span = match predicate {
CfgSelectPredicate::Wildcard(underscore) => underscore.span,
CfgSelectPredicate::Cfg(cfg) => cfg.span(),
};
let err = CfgSelectUnreachable { span, wildcard_span: underscore.span };
ecx.dcx().emit_warn(err);
Expand All @@ -50,7 +50,7 @@ pub(super) fn expand_cfg_select<'cx>(
Ident::with_dummy_span(sym::cfg_select),
);
} else {
// Emit a compiler error when none of the rules matched.
// Emit a compiler error when none of the predicates matched.
let guar = ecx.dcx().emit_err(CfgSelectNoMatches { span: sp });
DummyResult::any(sp, guar)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
} = self.lower_poly_trait_ref(
&trait_bound.trait_ref,
trait_bound.span,
hir::BoundConstness::Never,
trait_bound.modifiers.constness,
hir::BoundPolarity::Positive,
dummy_self,
&mut user_written_bounds,
Expand Down
10 changes: 6 additions & 4 deletions compiler/rustc_parse/src/parser/cfg_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc_span::Span;
use crate::exp;
use crate::parser::Parser;

pub enum CfgSelectRule {
pub enum CfgSelectPredicate {
Cfg(MetaItemInner),
Wildcard(Token),
}
Expand All @@ -20,7 +20,7 @@ pub struct CfgSelectBranches {
pub wildcard: Option<(Token, TokenStream, Span)>,
/// All branches after the first wildcard, including further wildcards.
/// These branches are kept for formatting.
pub unreachable: Vec<(CfgSelectRule, TokenStream, Span)>,
pub unreachable: Vec<(CfgSelectPredicate, TokenStream, Span)>,
}

/// Parses a `TokenTree` that must be of the form `{ /* ... */ }`, and returns a `TokenStream` where
Expand Down Expand Up @@ -52,7 +52,7 @@ pub fn parse_cfg_select<'a>(p: &mut Parser<'a>) -> PResult<'a, CfgSelectBranches
match branches.wildcard {
None => branches.wildcard = Some((underscore, tts, span)),
Some(_) => {
branches.unreachable.push((CfgSelectRule::Wildcard(underscore), tts, span))
branches.unreachable.push((CfgSelectPredicate::Wildcard(underscore), tts, span))
}
}
} else {
Expand All @@ -64,7 +64,9 @@ pub fn parse_cfg_select<'a>(p: &mut Parser<'a>) -> PResult<'a, CfgSelectBranches

match branches.wildcard {
None => branches.reachable.push((meta_item, tts, span)),
Some(_) => branches.unreachable.push((CfgSelectRule::Cfg(meta_item), tts, span)),
Some(_) => {
branches.unreachable.push((CfgSelectPredicate::Cfg(meta_item), tts, span))
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_parse/src/validate_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ pub fn check_builtin_meta_item(
| sym::align
| sym::deprecated
| sym::optimize
| sym::pointee
| sym::cold
| sym::target_feature
| sym::rustc_allow_const_fn_unstable
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
AttributeKind::BodyStability { .. }
| AttributeKind::ConstStabilityIndirect
| AttributeKind::MacroTransparency(_)
| AttributeKind::Pointee(..)
| AttributeKind::Dummy
| AttributeKind::OmitGdbPrettyPrinterSection,
) => { /* do nothing */ }
Expand Down Expand Up @@ -381,7 +382,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
| sym::cfg_attr_trace
// need to be fixed
| sym::cfi_encoding // FIXME(cfi_encoding)
| sym::pointee // FIXME(derive_coerce_pointee)
| sym::instruction_set // broken on stable!!!
| sym::windows_subsystem // broken on stable!!!
| sym::patchable_function_entry // FIXME(patchable_function_entry)
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_type_ir/src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ use crate::{self as ty, Interner};
// avoid heap allocations.
type TypeWalkerStack<I> = SmallVec<[<I as Interner>::GenericArg; 8]>;

pub struct TypeWalker<I: Interner> {
stack: TypeWalkerStack<I>,
last_subtree: usize,
pub visited: SsoHashSet<I::GenericArg>,
}

/// An iterator for walking the type tree.
///
/// It's very easy to produce a deeply
Expand All @@ -26,6 +20,12 @@ pub struct TypeWalker<I: Interner> {
/// in this situation walker only visits each type once.
/// It maintains a set of visited types and
/// skips any types that are already there.
pub struct TypeWalker<I: Interner> {
stack: TypeWalkerStack<I>,
last_subtree: usize,
pub visited: SsoHashSet<I::GenericArg>,
}

impl<I: Interner> TypeWalker<I> {
pub fn new(root: I::GenericArg) -> Self {
Self { stack: smallvec![root], last_subtree: 1, visited: SsoHashSet::new() }
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ macro_rules! impl_Display {
}
#[cfg(feature = "optimize_for_size")]
{
offset = _inner_slow_integer_to_str(self.unsigned_abs().$conv_fn(), &mut buf.buf);
offset = ${concat(_inner_slow_integer_to_str, $gen_name)}(self.unsigned_abs().$conv_fn(), &mut buf.buf);
}
// Only difference between signed and unsigned are these 4 lines.
if self < 0 {
Expand Down Expand Up @@ -401,7 +401,7 @@ macro_rules! impl_Display {
}
#[cfg(feature = "optimize_for_size")]
{
offset = _inner_slow_integer_to_str(self.$conv_fn(), &mut buf.buf);
offset = ${concat(_inner_slow_integer_to_str, $gen_name)}(self.$conv_fn(), &mut buf.buf);
}
// SAFETY: Starting from `offset`, all elements of the slice have been set.
unsafe { slice_buffer_to_str(&buf.buf, offset) }
Expand All @@ -412,7 +412,7 @@ macro_rules! impl_Display {
)*

#[cfg(feature = "optimize_for_size")]
fn _inner_slow_integer_to_str(mut n: $u, buf: &mut [MaybeUninit::<u8>]) -> usize {
fn ${concat(_inner_slow_integer_to_str, $gen_name)}(mut n: $u, buf: &mut [MaybeUninit::<u8>]) -> usize {
let mut curr = buf.len();

// SAFETY: To show that it's OK to copy into `buf_ptr`, notice that at the beginning
Expand All @@ -437,7 +437,7 @@ macro_rules! impl_Display {
const MAX_DEC_N: usize = $u::MAX.ilog(10) as usize + 1;
let mut buf = [MaybeUninit::<u8>::uninit(); MAX_DEC_N];

let offset = _inner_slow_integer_to_str(n, &mut buf);
let offset = ${concat(_inner_slow_integer_to_str, $gen_name)}(n, &mut buf);
// SAFETY: Starting from `offset`, all elements of the slice have been set.
let buf_slice = unsafe { slice_buffer_to_str(&buf, offset) };
f.pad_integral(is_nonnegative, "", buf_slice)
Expand Down
1 change: 1 addition & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
#![feature(lang_items)]
#![feature(link_llvm_intrinsics)]
#![feature(macro_metavar_expr)]
#![feature(macro_metavar_expr_concat)]
#![feature(marker_trait_attr)]
#![feature(min_specialization)]
#![feature(multiple_supertrait_upcastable)]
Expand Down
16 changes: 7 additions & 9 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,14 @@ pub macro assert_matches {
},
}

/// A macro for defining `#[cfg]` match-like statements.
/// Selects code at compile-time based on `cfg` predicates.
///
/// It is similar to the `if/elif` C preprocessor macro by allowing definition of a cascade of
/// `#[cfg]` cases, emitting the implementation which matches first.
/// This macro evaluates, at compile-time, a series of `cfg` predicates,
/// selects the first that is true, and emits the code guarded by that
/// predicate. The code guarded by other predicates is not emitted.
///
/// This allows you to conveniently provide a long list `#[cfg]`'d blocks of code
/// without having to rewrite each clause multiple times.
///
/// Trailing `_` wildcard match arms are **optional** and they indicate a fallback branch when
/// all previous declarations do not evaluate to true.
/// An optional trailing `_` wildcard can be used to specify a fallback. If
/// none of the predicates are true, a [`compile_error`] is emitted.
///
/// # Example
///
Expand All @@ -225,7 +223,7 @@ pub macro assert_matches {
/// }
/// ```
///
/// If desired, it is possible to return expressions through the use of surrounding braces:
/// The `cfg_select!` macro can also be used in expression position:
///
/// ```
/// #![feature(cfg_select)]
Expand Down
48 changes: 6 additions & 42 deletions library/core/src/num/wrapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ macro_rules! sh_impl_signed {
#[inline]
fn shl(self, other: $f) -> Wrapping<$t> {
if other < 0 {
Wrapping(self.0.wrapping_shr((-other & self::shift_max::$t as $f) as u32))
Wrapping(self.0.wrapping_shr(-other as u32))
} else {
Wrapping(self.0.wrapping_shl((other & self::shift_max::$t as $f) as u32))
Wrapping(self.0.wrapping_shl(other as u32))
}
}
}
Expand All @@ -119,9 +119,9 @@ macro_rules! sh_impl_signed {
#[inline]
fn shr(self, other: $f) -> Wrapping<$t> {
if other < 0 {
Wrapping(self.0.wrapping_shl((-other & self::shift_max::$t as $f) as u32))
Wrapping(self.0.wrapping_shl(-other as u32))
} else {
Wrapping(self.0.wrapping_shr((other & self::shift_max::$t as $f) as u32))
Wrapping(self.0.wrapping_shr(other as u32))
}
}
}
Expand All @@ -147,7 +147,7 @@ macro_rules! sh_impl_unsigned {

#[inline]
fn shl(self, other: $f) -> Wrapping<$t> {
Wrapping(self.0.wrapping_shl((other & self::shift_max::$t as $f) as u32))
Wrapping(self.0.wrapping_shl(other as u32))
}
}
forward_ref_binop! { impl Shl, shl for Wrapping<$t>, $f,
Expand All @@ -168,7 +168,7 @@ macro_rules! sh_impl_unsigned {

#[inline]
fn shr(self, other: $f) -> Wrapping<$t> {
Wrapping(self.0.wrapping_shr((other & self::shift_max::$t as $f) as u32))
Wrapping(self.0.wrapping_shr(other as u32))
}
}
forward_ref_binop! { impl Shr, shr for Wrapping<$t>, $f,
Expand Down Expand Up @@ -1052,39 +1052,3 @@ macro_rules! wrapping_int_impl_unsigned {
}

wrapping_int_impl_unsigned! { usize u8 u16 u32 u64 u128 }

mod shift_max {
#![allow(non_upper_case_globals)]

#[cfg(target_pointer_width = "16")]
mod platform {
pub(crate) const usize: u32 = super::u16;
pub(crate) const isize: u32 = super::i16;
}

#[cfg(target_pointer_width = "32")]
mod platform {
pub(crate) const usize: u32 = super::u32;
pub(crate) const isize: u32 = super::i32;
}

#[cfg(target_pointer_width = "64")]
mod platform {
pub(crate) const usize: u32 = super::u64;
pub(crate) const isize: u32 = super::i64;
}

pub(super) const i8: u32 = (1 << 3) - 1;
pub(super) const i16: u32 = (1 << 4) - 1;
pub(super) const i32: u32 = (1 << 5) - 1;
pub(super) const i64: u32 = (1 << 6) - 1;
pub(super) const i128: u32 = (1 << 7) - 1;
pub(super) use self::platform::isize;

pub(super) const u8: u32 = i8;
pub(super) const u16: u32 = i16;
pub(super) const u32: u32 = i32;
pub(super) const u64: u32 = i64;
pub(super) const u128: u32 = i128;
pub(super) use self::platform::usize;
}
1 change: 1 addition & 0 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ impl str {
///
/// The caller must ensure that `mid` is a valid byte offset from the start
/// of the string and falls on the boundary of a UTF-8 code point.
#[inline]
const unsafe fn split_at_unchecked(&self, mid: usize) -> (&str, &str) {
let len = self.len();
let ptr = self.as_ptr();
Expand Down
Loading
Loading