From c9145e1e58f9fddb8be884978f33d8859c3c5604 Mon Sep 17 00:00:00 2001 From: dianqk Date: Wed, 18 Jun 2025 22:04:48 +0800 Subject: [PATCH 01/11] codegen: Generate `dbg_value` for the ref statement --- src/debuginfo.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/debuginfo.rs b/src/debuginfo.rs index 4c8585192a1..0f015cc23f5 100644 --- a/src/debuginfo.rs +++ b/src/debuginfo.rs @@ -29,13 +29,24 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> { _variable_alloca: Self::Value, _direct_offset: Size, _indirect_offsets: &[Size], - _fragment: Option>, + _fragment: &Option>, ) { // FIXME(tempdragon): Not sure if this is correct, probably wrong but still keep it here. #[cfg(feature = "master")] _variable_alloca.set_location(_dbg_loc); } + fn dbg_var_value( + &mut self, + _dbg_var: Self::DIVariable, + _dbg_loc: Self::DILocation, + _value: Self::Value, + _direct_offset: Size, + _indirect_offsets: &[Size], + _fragment: &Option>, + ) { + } + fn insert_reference_to_gdb_debug_scripts_section_global(&mut self) { // TODO(antoyo): insert reference to gdb debug scripts section global. } From 7b71e5408d497d2121cb6a08f36dc31880963fa9 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Thu, 26 Jun 2025 13:44:01 +0000 Subject: [PATCH 02/11] Support #[alloc_error_handler] without the allocator shim Currently it is possible to avoid linking the allocator shim when __rust_no_alloc_shim_is_unstable_v2 is defined when linking rlibs directly as some build systems need. However this requires liballoc to be compiled with --cfg no_global_oom_handling, which places huge restrictions on what functions you can call and makes it impossible to use libstd. Or alternatively you have to define __rust_alloc_error_handler and (when using libstd) __rust_alloc_error_handler_should_panic using #[rustc_std_internal_symbol]. With this commit you can either use libstd and define __rust_alloc_error_handler_should_panic or not use libstd and use #[alloc_error_handler] instead. Both options are still unstable though. Eventually the alloc_error_handler may either be removed entirely (though the PR for that has been stale for years now) or we may start using weak symbols for it instead. For the latter case this commit is a prerequisite anyway. --- src/allocator.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/allocator.rs b/src/allocator.rs index 2a95a7368aa..3f99612fcdb 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -2,8 +2,8 @@ use gccjit::FnAttribute; use gccjit::{Context, FunctionType, RValue, ToRValue, Type}; use rustc_ast::expand::allocator::{ - ALLOCATOR_METHODS, AllocatorKind, AllocatorTy, NO_ALLOC_SHIM_IS_UNSTABLE, - alloc_error_handler_name, default_fn_name, global_fn_name, + ALLOC_ERROR_HANDLER, ALLOCATOR_METHODS, AllocatorKind, AllocatorTy, NO_ALLOC_SHIM_IS_UNSTABLE, + default_fn_name, global_fn_name, }; use rustc_middle::bug; use rustc_middle::ty::TyCtxt; @@ -61,15 +61,17 @@ pub(crate) unsafe fn codegen( } } - // FIXME(bjorn3): Add noreturn attribute - create_wrapper_function( - tcx, - context, - &mangle_internal_symbol(tcx, "__rust_alloc_error_handler"), - Some(&mangle_internal_symbol(tcx, alloc_error_handler_name(alloc_error_handler_kind))), - &[usize, usize], - None, - ); + if alloc_error_handler_kind == AllocatorKind::Default { + // FIXME(bjorn3): Add noreturn attribute + create_wrapper_function( + tcx, + context, + &mangle_internal_symbol(tcx, &global_fn_name(ALLOC_ERROR_HANDLER)), + Some(&mangle_internal_symbol(tcx, &default_fn_name(ALLOC_ERROR_HANDLER))), + &[usize, usize], + None, + ); + } create_const_value_function( tcx, From 5f0d88ffcf4c97c062746e2c4dc4e68d5eab9cbc Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Thu, 9 Oct 2025 14:08:55 +0000 Subject: [PATCH 03/11] Move computation of allocator shim contents to cg_ssa In the future this should make it easier to use weak symbols for the allocator shim on platforms that properly support weak symbols. And it would allow reusing the allocator shim code for handling default implementations of the upcoming externally implementable items feature on platforms that don't properly support weak symbols. --- src/allocator.rs | 64 +++++++++++++++++++----------------------------- src/lib.rs | 7 +++--- 2 files changed, 28 insertions(+), 43 deletions(-) diff --git a/src/allocator.rs b/src/allocator.rs index 3f99612fcdb..647569694b0 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -2,8 +2,7 @@ use gccjit::FnAttribute; use gccjit::{Context, FunctionType, RValue, ToRValue, Type}; use rustc_ast::expand::allocator::{ - ALLOC_ERROR_HANDLER, ALLOCATOR_METHODS, AllocatorKind, AllocatorTy, NO_ALLOC_SHIM_IS_UNSTABLE, - default_fn_name, global_fn_name, + AllocatorMethod, AllocatorTy, NO_ALLOC_SHIM_IS_UNSTABLE, default_fn_name, global_fn_name, }; use rustc_middle::bug; use rustc_middle::ty::TyCtxt; @@ -18,8 +17,7 @@ pub(crate) unsafe fn codegen( tcx: TyCtxt<'_>, mods: &mut GccContext, _module_name: &str, - kind: AllocatorKind, - alloc_error_handler_kind: AllocatorKind, + methods: &[AllocatorMethod], ) { let context = &mods.context; let usize = match tcx.sess.target.pointer_width { @@ -31,46 +29,34 @@ pub(crate) unsafe fn codegen( let i8 = context.new_type::(); let i8p = i8.make_pointer(); - if kind == AllocatorKind::Default { - for method in ALLOCATOR_METHODS { - let mut types = Vec::with_capacity(method.inputs.len()); - for input in method.inputs.iter() { - match input.ty { - AllocatorTy::Layout => { - types.push(usize); - types.push(usize); - } - AllocatorTy::Ptr => types.push(i8p), - AllocatorTy::Usize => types.push(usize), - - AllocatorTy::ResultPtr | AllocatorTy::Unit => panic!("invalid allocator arg"), + for method in methods { + let mut types = Vec::with_capacity(method.inputs.len()); + for input in method.inputs.iter() { + match input.ty { + AllocatorTy::Layout => { + types.push(usize); + types.push(usize); } - } - let output = match method.output { - AllocatorTy::ResultPtr => Some(i8p), - AllocatorTy::Unit => None, + AllocatorTy::Ptr => types.push(i8p), + AllocatorTy::Usize => types.push(usize), - AllocatorTy::Layout | AllocatorTy::Usize | AllocatorTy::Ptr => { - panic!("invalid allocator output") + AllocatorTy::Never | AllocatorTy::ResultPtr | AllocatorTy::Unit => { + panic!("invalid allocator arg") } - }; - let from_name = mangle_internal_symbol(tcx, &global_fn_name(method.name)); - let to_name = mangle_internal_symbol(tcx, &default_fn_name(method.name)); - - create_wrapper_function(tcx, context, &from_name, Some(&to_name), &types, output); + } } - } + let output = match method.output { + AllocatorTy::ResultPtr => Some(i8p), + AllocatorTy::Never | AllocatorTy::Unit => None, - if alloc_error_handler_kind == AllocatorKind::Default { - // FIXME(bjorn3): Add noreturn attribute - create_wrapper_function( - tcx, - context, - &mangle_internal_symbol(tcx, &global_fn_name(ALLOC_ERROR_HANDLER)), - Some(&mangle_internal_symbol(tcx, &default_fn_name(ALLOC_ERROR_HANDLER))), - &[usize, usize], - None, - ); + AllocatorTy::Layout | AllocatorTy::Usize | AllocatorTy::Ptr => { + panic!("invalid allocator output") + } + }; + let from_name = mangle_internal_symbol(tcx, &global_fn_name(method.name)); + let to_name = mangle_internal_symbol(tcx, &default_fn_name(method.name)); + + create_wrapper_function(tcx, context, &from_name, Some(&to_name), &types, output); } create_const_value_function( diff --git a/src/lib.rs b/src/lib.rs index ec7eab8489a..c85ed0ebb33 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -92,7 +92,7 @@ use back::lto::{ThinBuffer, ThinData}; use gccjit::{CType, Context, OptimizationLevel}; #[cfg(feature = "master")] use gccjit::{TargetInfo, Version}; -use rustc_ast::expand::allocator::AllocatorKind; +use rustc_ast::expand::allocator::AllocatorMethod; use rustc_codegen_ssa::back::lto::{SerializedModule, ThinModule}; use rustc_codegen_ssa::back::write::{ CodegenContext, FatLtoInput, ModuleConfig, TargetMachineFactoryFn, @@ -284,8 +284,7 @@ impl ExtraBackendMethods for GccCodegenBackend { &self, tcx: TyCtxt<'_>, module_name: &str, - kind: AllocatorKind, - alloc_error_handler_kind: AllocatorKind, + methods: &[AllocatorMethod], ) -> Self::Module { let mut mods = GccContext { context: Arc::new(SyncContext::new(new_context(tcx))), @@ -295,7 +294,7 @@ impl ExtraBackendMethods for GccCodegenBackend { }; unsafe { - allocator::codegen(tcx, &mut mods, module_name, kind, alloc_error_handler_kind); + allocator::codegen(tcx, &mut mods, module_name, methods); } mods } From 2064793089c2d8656deda40dfee8e8d10b709f21 Mon Sep 17 00:00:00 2001 From: Paul Murphy Date: Fri, 19 Sep 2025 11:15:04 -0500 Subject: [PATCH 04/11] Allow vector-scalar (vs) registers in ppc inline assembly Where supported, VSX is a 64x128b register set which encompasses both the floating point and vector registers. In the type tests, xvsqrtdp is used as it is the only two-argument vsx opcode supported by all targets on llvm. If you need to copy a vsx register, the preferred way is "xxlor xt, xa, xa". --- src/asm.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/asm.rs b/src/asm.rs index a14881c502c..81cdfc68737 100644 --- a/src/asm.rs +++ b/src/asm.rs @@ -698,6 +698,7 @@ fn reg_class_to_gcc(reg_class: InlineAsmRegClass) -> &'static str { InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::reg_nonzero) => "b", InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::freg) => "f", InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::vreg) => "v", + InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::vsreg) => "wa", InlineAsmRegClass::PowerPC( PowerPCInlineAsmRegClass::cr | PowerPCInlineAsmRegClass::ctr @@ -778,9 +779,9 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::reg) => cx.type_i32(), InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::reg_nonzero) => cx.type_i32(), InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::freg) => cx.type_f64(), - InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::vreg) => { - cx.type_vector(cx.type_i32(), 4) - } + InlineAsmRegClass::PowerPC( + PowerPCInlineAsmRegClass::vreg | PowerPCInlineAsmRegClass::vsreg, + ) => cx.type_vector(cx.type_i32(), 4), InlineAsmRegClass::PowerPC( PowerPCInlineAsmRegClass::cr | PowerPCInlineAsmRegClass::ctr @@ -957,6 +958,13 @@ fn modifier_to_gcc( InlineAsmRegClass::LoongArch(_) => None, InlineAsmRegClass::Mips(_) => None, InlineAsmRegClass::Nvptx(_) => None, + InlineAsmRegClass::PowerPC(PowerPCInlineAsmRegClass::vsreg) => { + if modifier.is_none() { + Some('x') + } else { + modifier + } + } InlineAsmRegClass::PowerPC(_) => None, InlineAsmRegClass::RiscV(RiscVInlineAsmRegClass::reg) | InlineAsmRegClass::RiscV(RiscVInlineAsmRegClass::freg) => None, From d96167fc9a3e8e412b9933f423ab993336e7ee85 Mon Sep 17 00:00:00 2001 From: Paul Murphy Date: Mon, 22 Sep 2025 09:28:21 -0500 Subject: [PATCH 05/11] Implement ppc/ppc64 preserves_flags option for inline asm Implemented preserves_flags on powerpc by making it do nothing. This prevents having two different ways to mark `cr0` as clobbered. clang and gcc alias `cr0` to `cc`. The gcc inline documentation does not state what this does on powerpc* targets, but inspection of the source shows it is equivalent to condition register field `cr0`, so it should not be added. --- src/asm.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/asm.rs b/src/asm.rs index 81cdfc68737..f237861b159 100644 --- a/src/asm.rs +++ b/src/asm.rs @@ -546,9 +546,16 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> { } if !options.contains(InlineAsmOptions::PRESERVES_FLAGS) { - // TODO(@Commeownist): I'm not 100% sure this one clobber is sufficient - // on all architectures. For instance, what about FP stack? - extended_asm.add_clobber("cc"); + match asm_arch { + InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => { + // "cc" is cr0 on powerpc. + } + // TODO(@Commeownist): I'm not 100% sure this one clobber is sufficient + // on all architectures. For instance, what about FP stack? + _ => { + extended_asm.add_clobber("cc"); + } + } } if !options.contains(InlineAsmOptions::NOMEM) { extended_asm.add_clobber("memory"); From c5d02bbaf3715156f99d71248aa5925d7d2867b9 Mon Sep 17 00:00:00 2001 From: Diggory Blake Date: Sun, 6 Jul 2025 20:58:14 +0100 Subject: [PATCH 06/11] Restrict sysroot crate imports to those defined in this repo. It's common to import dependencies from the sysroot via `extern crate` rather than use an explicit cargo dependency, when it's necessary to use the same dependency version as used by rustc itself. However, this is dangerous for crates.io crates, since rustc may not pull in the dependency on some targets, or may pull in multiple versions. In both cases, the `extern crate` fails to resolve. To address this, re-export all such dependencies from the appropriate `rustc_*` crates, and use this alias from crates which would otherwise need to use `extern crate`. --- src/back/lto.rs | 1 + src/back/write.rs | 1 + src/consts.rs | 1 + src/gcc_util.rs | 2 +- src/lib.rs | 7 +------ 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/back/lto.rs b/src/back/lto.rs index d29bba2570f..598bbe74007 100644 --- a/src/back/lto.rs +++ b/src/back/lto.rs @@ -30,6 +30,7 @@ use rustc_codegen_ssa::traits::*; use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, looks_like_rust_object_file}; use rustc_data_structures::memmap::Mmap; use rustc_errors::DiagCtxtHandle; +use rustc_log::tracing::info; use rustc_middle::bug; use rustc_middle::dep_graph::WorkProduct; use rustc_session::config::Lto; diff --git a/src/back/write.rs b/src/back/write.rs index 84bc7016271..8ba730e3250 100644 --- a/src/back/write.rs +++ b/src/back/write.rs @@ -5,6 +5,7 @@ use rustc_codegen_ssa::back::link::ensure_removed; use rustc_codegen_ssa::back::write::{BitcodeSection, CodegenContext, EmitObj, ModuleConfig}; use rustc_codegen_ssa::{CompiledModule, ModuleCodegen}; use rustc_fs_util::link_or_copy; +use rustc_log::tracing::debug; use rustc_session::config::OutputType; use rustc_target::spec::SplitDebuginfo; diff --git a/src/consts.rs b/src/consts.rs index 7fe8fc122b3..ec7d4b285a3 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -8,6 +8,7 @@ use rustc_codegen_ssa::traits::{ use rustc_hir::attrs::Linkage; use rustc_hir::def::DefKind; use rustc_hir::def_id::LOCAL_CRATE; +use rustc_log::tracing::trace; use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; use rustc_middle::mir::interpret::{ self, ConstAllocation, ErrorHandled, Scalar as InterpScalar, read_target_uint, diff --git a/src/gcc_util.rs b/src/gcc_util.rs index 42ba40692b7..702704ddf13 100644 --- a/src/gcc_util.rs +++ b/src/gcc_util.rs @@ -1,8 +1,8 @@ #[cfg(feature = "master")] use gccjit::Context; use rustc_codegen_ssa::target_features; +use rustc_data_structures::smallvec::{SmallVec, smallvec}; use rustc_session::Session; -use smallvec::{SmallVec, smallvec}; fn gcc_features_by_flags(sess: &Session, features: &mut Vec) { target_features::retpoline_features_by_flags(sess, features); diff --git a/src/lib.rs b/src/lib.rs index ec7eab8489a..e6d1dcccd44 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,12 +25,6 @@ #![deny(clippy::pattern_type_mismatch)] #![allow(clippy::needless_lifetimes, clippy::uninlined_format_args)] -// These crates are pulled from the sysroot because they are part of -// rustc's public API, so we need to ensure version compatibility. -extern crate smallvec; -#[macro_use] -extern crate tracing; - // The rustc crates we need extern crate rustc_abi; extern crate rustc_apfloat; @@ -44,6 +38,7 @@ extern crate rustc_hir; extern crate rustc_index; #[cfg(feature = "master")] extern crate rustc_interface; +extern crate rustc_log; extern crate rustc_macros; extern crate rustc_middle; extern crate rustc_session; From 936805e3dbb33fa424d7a9f4a456401b196674b1 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 10 Oct 2025 21:29:29 -0400 Subject: [PATCH 07/11] Fix ICE on offsetted ZST pointer A grep for `const_usize.*align` found the same code copied to rustc_codegen_gcc but I don't see other cases where we get this wrong. --- src/common.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common.rs b/src/common.rs index 28848ca6184..7c2969e5871 100644 --- a/src/common.rs +++ b/src/common.rs @@ -5,7 +5,7 @@ use rustc_codegen_ssa::traits::{ BaseTypeCodegenMethods, ConstCodegenMethods, MiscCodegenMethods, StaticCodegenMethods, }; use rustc_middle::mir::Mutability; -use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, Scalar}; +use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, PointerArithmetic, Scalar}; use rustc_middle::ty::layout::LayoutOf; use crate::context::CodegenCx; @@ -247,8 +247,8 @@ impl<'gcc, 'tcx> ConstCodegenMethods for CodegenCx<'gcc, 'tcx> { // This avoids generating a zero-sized constant value and actually needing a // real address at runtime. if alloc.inner().len() == 0 { - assert_eq!(offset.bytes(), 0); - let val = self.const_usize(alloc.inner().align.bytes()); + let val = alloc.inner().align.bytes().wrapping_add(offset.bytes()); + let val = self.const_usize(self.tcx.truncate_to_target_usize(val)); return if matches!(layout.primitive(), Pointer(_)) { self.context.new_cast(None, val, ty) } else { From 0f5c80a560ed77790ccfc5b06e488ff5e0403cab Mon Sep 17 00:00:00 2001 From: Kivooeo Date: Mon, 20 Oct 2025 20:36:55 +0000 Subject: [PATCH 08/11] remove broken link --- src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1f342061ec5..71500ded020 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,5 @@ /* * TODO(antoyo): implement equality in libgccjit based on https://zpz.github.io/blog/overloading-equality-operator-in-cpp-class-hierarchy/ (for type equality?) - * TODO(antoyo): support #[inline] attributes. - * TODO(antoyo): support LTO (gcc's equivalent to Full LTO is -flto -flto-partition=one — https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html). * For Thin LTO, this might be helpful: // cspell:disable-next-line * In gcc 4.6 -fwhopr was removed and became default with -flto. The non-whopr path can still be executed via -flto-partition=none. From 02608ff7b568dadcc844a6a687f168a21c5d48b5 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sat, 1 Nov 2025 11:21:17 -0400 Subject: [PATCH 09/11] Update to nightly-2025-11-01 --- rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain b/rust-toolchain index ec625481add..b7765a0d591 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-09-30" +channel = "nightly-2025-11-01" components = ["rust-src", "rustc-dev", "llvm-tools-preview"] From cd5a50d5088c4a86610f3a1bbde15c536b26b12f Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sat, 1 Nov 2025 11:31:16 -0400 Subject: [PATCH 10/11] Fix mini_core tests --- example/mini_core.rs | 24 +++++++++++++++++++++--- example/mini_core_hello_world.rs | 10 +++++----- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/example/mini_core.rs b/example/mini_core.rs index 5afedf9d401..64a5b431bd0 100644 --- a/example/mini_core.rs +++ b/example/mini_core.rs @@ -603,7 +603,7 @@ impl, U: ?Sized, A: Allocator> CoerceUnsized> fo impl Box { pub fn new(val: T) -> Box { unsafe { - let size = intrinsics::size_of::(); + let size = size_of::(); let ptr = libc::malloc(size); intrinsics::copy(&val as *const T as *const u8, ptr, size); Box(Unique { pointer: NonNull(ptr as *const T), _marker: PhantomData }, Global) @@ -657,11 +657,11 @@ pub mod intrinsics { #[rustc_intrinsic] pub fn abort() -> !; #[rustc_intrinsic] - pub fn size_of() -> usize; + pub const fn size_of() -> usize; #[rustc_intrinsic] pub unsafe fn size_of_val(val: *const T) -> usize; #[rustc_intrinsic] - pub fn align_of() -> usize; + pub const fn align_of() -> usize; #[rustc_intrinsic] pub unsafe fn align_of_val(val: *const T) -> usize; #[rustc_intrinsic] @@ -699,6 +699,24 @@ pub mod libc { } } +pub const fn size_of() -> usize { + ::SIZE +} + +pub const fn align_of() -> usize { + ::ALIGN +} + +trait SizedTypeProperties: Sized { + #[lang = "mem_size_const"] + const SIZE: usize = intrinsics::size_of::(); + + #[lang = "mem_align_const"] + const ALIGN: usize = intrinsics::align_of::(); +} + +impl SizedTypeProperties for T {} + #[lang = "index"] pub trait Index { type Output: ?Sized; diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs index 1e601d42413..45154ff072f 100644 --- a/example/mini_core_hello_world.rs +++ b/example/mini_core_hello_world.rs @@ -90,8 +90,8 @@ fn start( ) -> isize { if argc == 3 { unsafe { puts(*argv); } - unsafe { puts(*((argv as usize + intrinsics::size_of::<*const u8>()) as *const *const u8)); } - unsafe { puts(*((argv as usize + 2 * intrinsics::size_of::<*const u8>()) as *const *const u8)); } + unsafe { puts(*((argv as usize + size_of::<*const u8>()) as *const *const u8)); } + unsafe { puts(*((argv as usize + 2 * size_of::<*const u8>()) as *const *const u8)); } } main().report(); @@ -154,7 +154,7 @@ fn main() { let slice = &[0, 1] as &[i32]; let slice_ptr = slice as *const [i32] as *const i32; - let align = intrinsics::align_of::<*const i32>(); + let align = align_of::<*const i32>(); assert_eq!(slice_ptr as usize % align, 0); //return; @@ -195,8 +195,8 @@ fn main() { assert_eq!(intrinsics::size_of_val(a) as u8, 8); assert_eq!(intrinsics::size_of_val(&0u32) as u8, 4); - assert_eq!(intrinsics::align_of::() as u8, 2); - assert_eq!(intrinsics::align_of_val(&a) as u8, intrinsics::align_of::<&str>() as u8); + assert_eq!(align_of::() as u8, 2); + assert_eq!(intrinsics::align_of_val(&a) as u8, align_of::<&str>() as u8); let u8_needs_drop = const { intrinsics::needs_drop::() }; assert!(!u8_needs_drop); From 76a7e795f2545f82a8c3e91d16e4acc10724c308 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Tue, 4 Nov 2025 08:51:47 -0500 Subject: [PATCH 11/11] Update to nightly-2025-11-04 --- rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain b/rust-toolchain index b7765a0d591..9813bbea00c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-11-01" +channel = "nightly-2025-11-04" components = ["rust-src", "rustc-dev", "llvm-tools-preview"]