Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
decdb95
symcheck: Store the section name in `SymInfo` if available
tgross35 Aug 7, 2025
ab0def2
symcheck: Ignore symbols in `.debug_gdb_scripts`
tgross35 Aug 7, 2025
36ec648
Remove instances of `allow(improper_ctypes)`
tgross35 Aug 7, 2025
9a81b2a
Start runnning tests for aarch64-pc-windows-msvc
tgross35 Aug 7, 2025
3fb62b9
Prepare for merging from rust-lang/rust
invalid-email-address Aug 9, 2025
bf84878
Merge ref 'ffb9d94dcf4a' from rust-lang/rust
invalid-email-address Aug 9, 2025
531d5aa
symcheck: Skip `__ymm@` symbols on Windows
tgross35 Aug 9, 2025
ba5def8
Add __addhf3, __subhf3, __mulhf3, __{eq,ge,gt,le,lt,ne,unord}hf2
tgross35 Aug 9, 2025
b951b5d
stabilize strict provenance atomic ptr
Kivooeo Aug 15, 2025
ca7a0af
Fix some typos
dns2utf8 Aug 19, 2025
e42c1b1
Stabilize `round_char_boundary` feature
okaneco Aug 22, 2025
202eb0b
Prepare for merging from rust-lang/rust
invalid-email-address Aug 28, 2025
e36d827
Merge ref 'd36f96412516' from rust-lang/rust
invalid-email-address Aug 28, 2025
4edfeb2
compiler: Include span of too huge enum with -Cdebuginfo=2
Enselic Aug 28, 2025
2d0668d
Mark pipe2 supported in Android
maurer Aug 28, 2025
6fd0e50
autoderef final ty is already resolved
lcnr Aug 29, 2025
e3f1e94
std: haiku: fix `B_FIND_PATH_IMAGE_PATH`
GrigorenkoPV Aug 29, 2025
85cefab
std: use a TAIT to define `SplitPaths` on UNIX
joboet Aug 11, 2025
638a52c
Improve librustdoc error when a file creation/modification failed
GuillaumeGomez Aug 29, 2025
19ae976
Rollup merge of #145242 - joboet:tait-split-paths, r=Mark-Simulacrum
tgross35 Aug 30, 2025
ed9e767
Rollup merge of #145467 - Kivooeo:stabilize-strict_provenance_atomic_…
tgross35 Aug 30, 2025
751a9ad
Rollup merge of #145756 - okaneco:stabilize_char_boundary, r=scottmcm
tgross35 Aug 30, 2025
65a846a
Rollup merge of #145967 - Enselic:big-enum-debuginfo-span, r=wesleywiser
tgross35 Aug 30, 2025
4d5ca4c
Rollup merge of #145990 - lcnr:final-ty-no-resolve, r=davidtwco
tgross35 Aug 30, 2025
a7fd14f
Rollup merge of #145991 - GrigorenkoPV:haiku, r=tgross35
tgross35 Aug 30, 2025
b722da9
Rollup merge of #146000 - GuillaumeGomez:rustdoc-error-improvement, r…
tgross35 Aug 30, 2025
98806c8
Rollup merge of #146017 - maurer:pipe2, r=Mark-Simulacrum
tgross35 Aug 30, 2025
319d554
Rollup merge of #146022 - tgross35:update-builtins, r=tgross35
tgross35 Aug 30, 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
14 changes: 12 additions & 2 deletions compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ use rustc_middle::ty::{
self, AdtKind, CoroutineArgsExt, ExistentialTraitRef, Instance, Ty, TyCtxt, Visibility,
};
use rustc_session::config::{self, DebugInfo, Lto};
use rustc_span::{DUMMY_SP, FileName, FileNameDisplayPreference, SourceFile, Symbol, hygiene};
use rustc_span::{
DUMMY_SP, FileName, FileNameDisplayPreference, SourceFile, Span, Symbol, hygiene,
};
use rustc_symbol_mangling::typeid_for_trait_ref;
use rustc_target::spec::DebuginfoKind;
use smallvec::smallvec;
Expand Down Expand Up @@ -423,6 +425,14 @@ fn build_slice_type_di_node<'ll, 'tcx>(
/// This function will look up the debuginfo node in the TypeMap. If it can't find it, it
/// will create the node by dispatching to the corresponding `build_*_di_node()` function.
pub(crate) fn type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll DIType {
spanned_type_di_node(cx, t, DUMMY_SP)
}

pub(crate) fn spanned_type_di_node<'ll, 'tcx>(
cx: &CodegenCx<'ll, 'tcx>,
t: Ty<'tcx>,
span: Span,
) -> &'ll DIType {
let unique_type_id = UniqueTypeId::for_ty(cx.tcx, t);

if let Some(existing_di_node) = debug_context(cx).type_map.di_node_for_unique_id(unique_type_id)
Expand Down Expand Up @@ -460,7 +470,7 @@ pub(crate) fn type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) ->
ty::Adt(def, ..) => match def.adt_kind() {
AdtKind::Struct => build_struct_type_di_node(cx, unique_type_id),
AdtKind::Union => build_union_type_di_node(cx, unique_type_id),
AdtKind::Enum => enums::build_enum_type_di_node(cx, unique_type_id),
AdtKind::Enum => enums::build_enum_type_di_node(cx, unique_type_id, span),
},
ty::Tuple(_) => build_tuple_type_di_node(cx, unique_type_id),
_ => bug!("debuginfo: unexpected type in type_di_node(): {:?}", t),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_middle::bug;
use rustc_middle::mir::CoroutineLayout;
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
use rustc_middle::ty::{self, AdtDef, CoroutineArgs, CoroutineArgsExt, Ty, VariantDef};
use rustc_span::Symbol;
use rustc_span::{Span, Symbol};

use super::type_map::{DINodeCreationResult, UniqueTypeId};
use super::{SmallVec, size_and_align_of};
Expand All @@ -30,13 +30,14 @@ mod native;
pub(super) fn build_enum_type_di_node<'ll, 'tcx>(
cx: &CodegenCx<'ll, 'tcx>,
unique_type_id: UniqueTypeId<'tcx>,
span: Span,
) -> DINodeCreationResult<'ll> {
let enum_type = unique_type_id.expect_ty();
let &ty::Adt(enum_adt_def, _) = enum_type.kind() else {
bug!("build_enum_type_di_node() called with non-enum type: `{:?}`", enum_type)
};

let enum_type_and_layout = cx.layout_of(enum_type);
let enum_type_and_layout = cx.spanned_layout_of(enum_type, span);

if wants_c_like_enum_debuginfo(cx.tcx, enum_type_and_layout) {
return build_c_style_enum_di_node(cx, enum_adt_def, enum_type_and_layout);
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_codegen_llvm/src/debuginfo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ use rustc_target::spec::DebuginfoKind;
use smallvec::SmallVec;
use tracing::debug;

use self::metadata::{UNKNOWN_COLUMN_NUMBER, UNKNOWN_LINE_NUMBER, file_metadata, type_di_node};
use self::metadata::{
UNKNOWN_COLUMN_NUMBER, UNKNOWN_LINE_NUMBER, file_metadata, spanned_type_di_node, type_di_node,
};
use self::namespace::mangled_name_of_instance;
use self::utils::{DIB, create_DIArray, is_node_local_to_unit};
use crate::builder::Builder;
Expand Down Expand Up @@ -626,7 +628,7 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
let loc = self.lookup_debug_loc(span.lo());
let file_metadata = file_metadata(self, &loc.file);

let type_metadata = type_di_node(self, variable_type);
let type_metadata = spanned_type_di_node(self, variable_type, span);

let (argument_index, dwarf_tag) = match variable_kind {
ArgumentVariable(index) => (index as c_uint, DW_TAG_arg_variable),
Expand Down
12 changes: 4 additions & 8 deletions compiler/rustc_hir_analysis/src/autoderef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,10 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
Some((normalized_ty, ocx.into_pending_obligations()))
}

/// Returns the final type we ended up with, which may be an inference
/// variable (we will resolve it first, if we want).
pub fn final_ty(&self, resolve: bool) -> Ty<'tcx> {
if resolve {
self.infcx.resolve_vars_if_possible(self.state.cur_ty)
} else {
self.state.cur_ty
}
/// Returns the final type we ended up with, which may be an unresolved
/// inference variable.
pub fn final_ty(&self) -> Ty<'tcx> {
self.state.cur_ty
}

pub fn step_count(&self) -> usize {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/autoderef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

let mut obligations = PredicateObligations::new();
let targets =
steps.iter().skip(1).map(|&(ty, _)| ty).chain(iter::once(autoderef.final_ty(false)));
steps.iter().skip(1).map(|&(ty, _)| ty).chain(iter::once(autoderef.final_ty()));
let steps: Vec<_> = steps
.iter()
.map(|&(source, kind)| {
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_hir_typeck/src/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
result = self.try_overloaded_call_step(call_expr, callee_expr, arg_exprs, &autoderef);
}

match autoderef.final_ty(false).kind() {
match autoderef.final_ty().kind() {
ty::FnDef(def_id, _) => {
let abi = self.tcx.fn_sig(def_id).skip_binder().skip_binder().abi;
self.check_call_abi(abi, call_expr.span);
Expand Down Expand Up @@ -200,8 +200,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
arg_exprs: &'tcx [hir::Expr<'tcx>],
autoderef: &Autoderef<'a, 'tcx>,
) -> Option<CallStep<'tcx>> {
let adjusted_ty =
self.structurally_resolve_type(autoderef.span(), autoderef.final_ty(false));
let adjusted_ty = self.structurally_resolve_type(autoderef.span(), autoderef.final_ty());

// If the callee is a function pointer or a closure, then we're all set.
match *adjusted_ty.kind() {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2918,7 +2918,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// Emits an error if we deref an infer variable, like calling `.field` on a base type
// of `&_`. We can also use this to suppress unnecessary "missing field" errors that
// will follow ambiguity errors.
let final_ty = self.structurally_resolve_type(autoderef.span(), autoderef.final_ty(false));
let final_ty = self.structurally_resolve_type(autoderef.span(), autoderef.final_ty());
if let ty::Error(_) = final_ty.kind() {
return final_ty;
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ pub(crate) fn method_autoderef_steps<'tcx>(
.collect();
(steps, autoderef_via_deref.reached_recursion_limit())
};
let final_ty = autoderef_via_deref.final_ty(true);
let final_ty = autoderef_via_deref.final_ty();
let opt_bad_ty = match final_ty.kind() {
ty::Infer(ty::TyVar(_)) | ty::Error(_) => Some(MethodAutoderefBadTy {
reached_raw_pointer,
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_hir_typeck/src/place_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
index_ty: Ty<'tcx>,
index_expr: &hir::Expr<'_>,
) -> Option<(/*index type*/ Ty<'tcx>, /*element type*/ Ty<'tcx>)> {
let adjusted_ty =
self.structurally_resolve_type(autoderef.span(), autoderef.final_ty(false));
let adjusted_ty = self.structurally_resolve_type(autoderef.span(), autoderef.final_ty());
debug!(
"try_index_step(expr={:?}, base_expr={:?}, adjusted_ty={:?}, \
index_ty={:?})",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(bootstrap, feature(round_char_boundary))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![feature(allocator_api)]
Expand All @@ -51,7 +52,6 @@
#![feature(negative_impls)]
#![feature(never_type)]
#![feature(ptr_alignment_type)]
#![feature(round_char_boundary)]
#![feature(rustc_attrs)]
#![feature(rustdoc_internals)]
#![feature(sized_hierarchy)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(round_char_boundary))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![feature(array_windows)]
Expand All @@ -26,7 +27,6 @@
#![feature(map_try_insert)]
#![feature(negative_impls)]
#![feature(read_buf)]
#![feature(round_char_boundary)]
#![feature(rustc_attrs)]
#![feature(rustdoc_internals)]
// tidy-alphabetical-end
Expand Down
1 change: 0 additions & 1 deletion library/alloctests/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#![feature(inplace_iteration)]
#![feature(iter_advance_by)]
#![feature(iter_next_chunk)]
#![feature(round_char_boundary)]
#![feature(slice_partition_dedup)]
#![feature(string_from_utf8_lossy_owned)]
#![feature(string_remove_matches)]
Expand Down
3 changes: 1 addition & 2 deletions library/compiler-builtins/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ jobs:
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- target: aarch64-pc-windows-msvc
os: windows-2025
build_only: 1
os: windows-11-arm
- target: arm-unknown-linux-gnueabi
os: ubuntu-24.04
- target: arm-unknown-linux-gnueabihf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(improper_ctypes)]
#![cfg_attr(f128_enabled, feature(f128))]

use builtins_test::float_bench;
Expand Down
24 changes: 11 additions & 13 deletions library/compiler-builtins/builtins-test/tests/addsub.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![allow(unused_macros)]
#![cfg_attr(f16_enabled, feature(f16))]
#![cfg_attr(f128_enabled, feature(f128))]

use builtins_test::*;
Expand Down Expand Up @@ -115,28 +116,25 @@ macro_rules! float_sum {
mod float_addsub {
use super::*;

#[cfg(f16_enabled)]
float_sum! {
f16, __addhf3, __subhf3, Half, all();
}

float_sum! {
f32, __addsf3, __subsf3, Single, all();
f64, __adddf3, __subdf3, Double, all();
}
}

#[cfg(f128_enabled)]
#[cfg(not(x86_no_sse))]
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
mod float_addsub_f128 {
use super::*;

#[cfg(f128_enabled)]
#[cfg(not(x86_no_sse))]
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
float_sum! {
f128, __addtf3, __subtf3, Quad, not(feature = "no-sys-f128");
}
}

#[cfg(f128_enabled)]
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
mod float_addsub_f128_ppc {
use super::*;

#[cfg(f128_enabled)]
#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
float_sum! {
f128, __addkf3, __subkf3, Quad, not(feature = "no-sys-f128");
}
Expand Down
21 changes: 21 additions & 0 deletions library/compiler-builtins/builtins-test/tests/cmp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(unused_macros)]
#![allow(unreachable_code)]
#![cfg_attr(f16_enabled, feature(f16))]
#![cfg_attr(f128_enabled, feature(f128))]

use builtins_test::*;
Expand Down Expand Up @@ -51,6 +52,26 @@ mod float_comparisons {
};
}

#[test]
#[cfg(f16_enabled)]
fn cmp_f16() {
use compiler_builtins::float::cmp::{
__eqhf2, __gehf2, __gthf2, __lehf2, __lthf2, __nehf2, __unordhf2,
};

fuzz_float_2(N, |x: f16, y: f16| {
assert_eq!(__unordhf2(x, y) != 0, x.is_nan() || y.is_nan());
cmp!(f16, x, y, Half, all(),
1, __lthf2;
1, __lehf2;
1, __eqhf2;
-1, __gehf2;
-1, __gthf2;
1, __nehf2;
);
});
}

#[test]
fn cmp_f32() {
use compiler_builtins::float::cmp::{
Expand Down
8 changes: 7 additions & 1 deletion library/compiler-builtins/builtins-test/tests/mul.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(unused_macros)]
#![cfg_attr(f16_enabled, feature(f16))]
#![cfg_attr(f128_enabled, feature(f128))]
#![allow(unused_macros)]

use builtins_test::*;

Expand Down Expand Up @@ -117,6 +118,11 @@ macro_rules! float_mul {
mod float_mul {
use super::*;

#[cfg(f16_enabled)]
float_mul! {
f16, __mulhf3, Half, all();
}

// FIXME(#616): Stop ignoring arches that don't have native support once fix for builtins is in
// nightly.
float_mul! {
Expand Down
7 changes: 6 additions & 1 deletion library/compiler-builtins/compiler-builtins/src/float/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ where
return F::from_bits(MinInt::ZERO);
}

// If partial cancellation occured, we need to left-shift the result
// If partial cancellation occurred, we need to left-shift the result
// and adjust the exponent:
if a_significand < implicit_bit << 3 {
let shift = a_significand.leading_zeros() as i32
Expand Down Expand Up @@ -191,6 +191,11 @@ where
}

intrinsics! {
#[cfg(f16_enabled)]
pub extern "C" fn __addhf3(a: f16, b: f16) -> f16 {
add(a, b)
}

#[aapcs_on_arm]
#[arm_aeabi_alias = __aeabi_fadd]
pub extern "C" fn __addsf3(a: f32, b: f32) -> f32 {
Expand Down
31 changes: 31 additions & 0 deletions library/compiler-builtins/compiler-builtins/src/float/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,37 @@ fn unord<F: Float>(a: F, b: F) -> bool {
a_abs > inf_rep || b_abs > inf_rep
}

#[cfg(f16_enabled)]
intrinsics! {
pub extern "C" fn __lehf2(a: f16, b: f16) -> crate::float::cmp::CmpResult {
cmp(a, b).to_le_abi()
}

pub extern "C" fn __gehf2(a: f16, b: f16) -> crate::float::cmp::CmpResult {
cmp(a, b).to_ge_abi()
}

pub extern "C" fn __unordhf2(a: f16, b: f16) -> crate::float::cmp::CmpResult {
unord(a, b) as crate::float::cmp::CmpResult
}

pub extern "C" fn __eqhf2(a: f16, b: f16) -> crate::float::cmp::CmpResult {
cmp(a, b).to_le_abi()
}

pub extern "C" fn __lthf2(a: f16, b: f16) -> crate::float::cmp::CmpResult {
cmp(a, b).to_le_abi()
}

pub extern "C" fn __nehf2(a: f16, b: f16) -> crate::float::cmp::CmpResult {
cmp(a, b).to_le_abi()
}

pub extern "C" fn __gthf2(a: f16, b: f16) -> crate::float::cmp::CmpResult {
cmp(a, b).to_ge_abi()
}
}

intrinsics! {
pub extern "C" fn __lesf2(a: f32, b: f32) -> crate::float::cmp::CmpResult {
cmp(a, b).to_le_abi()
Expand Down
5 changes: 5 additions & 0 deletions library/compiler-builtins/compiler-builtins/src/float/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ where
}

intrinsics! {
#[cfg(f16_enabled)]
pub extern "C" fn __mulhf3(a: f16, b: f16) -> f16 {
mul(a, b)
}

#[aapcs_on_arm]
#[arm_aeabi_alias = __aeabi_fmul]
pub extern "C" fn __mulsf3(a: f32, b: f32) -> f32 {
Expand Down
5 changes: 5 additions & 0 deletions library/compiler-builtins/compiler-builtins/src/float/sub.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use crate::float::Float;

intrinsics! {
#[cfg(f16_enabled)]
pub extern "C" fn __subhf3(a: f16, b: f16) -> f16 {
crate::float::add::__addhf3(a, f16::from_bits(b.to_bits() ^ f16::SIGN_MASK))
}

#[arm_aeabi_alias = __aeabi_fsub]
pub extern "C" fn __subsf3(a: f32, b: f32) -> f32 {
crate::float::add::__addsf3(a, f32::from_bits(b.to_bits() ^ f32::SIGN_MASK))
Expand Down
Loading
Loading