Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2d434e2
Add regression test for unconstrained const param ICE in next solver
machinedramon Oct 18, 2026
48d9db2
Add regression test for higher-ranked outlives normalization ICE
machinedramon Oct 18, 2026
d71302a
Delay getting of `alias_def_id`
nnethercote Nov 11, 2026
78585c8
Remove unnecessary `record_impl_args` call
nnethercote Nov 11, 2026
874024d
Factor out duplicated code
nnethercote Nov 11, 2026
0459009
Remove the 'eq' and 'eq_trace' methods from 'At' and migrate to 'eq_r…
fallible-algebra Nov 2, 2026
0bd26b0
Fix search index generation: if crate content didn't change, it shoul…
GuillaumeGomez Nov 23, 2026
00c21f2
Add regression test for delegated Iterator impl
clarfonthey Nov 24, 2026
a9ed451
Revert "implement const Iterator for Range"
clarfonthey Nov 22, 2026
5c3ae94
Unnormalized migration: supertraits yields Unnormalized
bit-aloo Nov 6, 2026
27aae54
Unnormalized migration: match_normalize_trait_ref takes Unnormalized
bit-aloo Nov 6, 2026
b1d600e
Introduce compute_abi helper and ComputeCallConv trait
bjorn3 Nov 13, 2026
81b2632
Deduplicate ZST arg/ret handling
bjorn3 Nov 13, 2026
c4c1ae8
Only use CanonAbi in adjust_for_foreign_abi
bjorn3 Nov 13, 2026
01f3193
add `scalbn` and `ilogb` methods
folkertdev Sep 3, 2026
696aebd
use `scalbn` instead of `ldexp` in `coretests`
folkertdev Nov 21, 2026
b0f4a48
Move `rustdoc-ui` tests in the right folder
GuillaumeGomez Nov 21, 2026
4e3ecc1
Allow passing `--exact-match` to `x perf`
Kobzol Nov 24, 2026
1f57fdb
Allow passing `--purge` to `x perf`
Kobzol Nov 24, 2026
c382967
fix: avoid inference constraints from opaque blanket impls
amirHdev Aug 8, 2026
409e2b9
test: cover opaque blanket assoc-type guidance
amirHdev Sep 8, 2026
e537e5c
check all trait arguments for opaque blanket impl candidates
amirHdev Oct 13, 2026
29f1b28
Rollup merge of #166340 - clarfonthey:revert-iter-range, r=JohnTitor,…
JonathanBrouwer Nov 24, 2026
e89b900
Rollup merge of #165345 - fallible-algebra:at-removal/remove-eq-and-e…
JonathanBrouwer Nov 24, 2026
4b59bb2
Rollup merge of #165538 - bit-aloo:2026-11-06-supertraits-unnormalize…
JonathanBrouwer Nov 24, 2026
d4fe90a
Rollup merge of #165794 - nnethercote:consider_impl_candidate, r=jdon…
JonathanBrouwer Nov 24, 2026
92bb0e6
Rollup merge of #160752 - amirHdev:fix-opaque-blanket-guidance, r=lcnr
JonathanBrouwer Nov 24, 2026
452d8c1
Rollup merge of #163187 - folkertdev:scalbn, r=tgross35,RalfJung
JonathanBrouwer Nov 24, 2026
cd2e44b
Rollup merge of #164541 - machinedramon:regression-test-152415, r=lcnr
JonathanBrouwer Nov 24, 2026
0adf978
Rollup merge of #164543 - machinedramon:regression-test-151316, r=lcnr
JonathanBrouwer Nov 24, 2026
5174666
Rollup merge of #165920 - bjorn3:callconv_refactor, r=beetrees
JonathanBrouwer Nov 24, 2026
af2b976
Rollup merge of #166313 - GuillaumeGomez:rustdoc-ui-cleanup, r=fmease
JonathanBrouwer Nov 24, 2026
64c058c
Rollup merge of #166420 - GuillaumeGomez:search-index-regen, r=notriddle
JonathanBrouwer Nov 24, 2026
f4944a1
Rollup merge of #166485 - Kobzol:x-perf-improvements, r=JonathanBrouwer
JonathanBrouwer Nov 24, 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 compiler/rustc_codegen_gcc/src/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use gccjit::{
BinaryOp, CType, ComparisonOp, FunctionType, Location, RValue, ToRValue, Type, UnaryOp,
};
use rustc_abi::{CanonAbi, Endian, ExternAbi, Float};
use rustc_abi::{CanonAbi, Endian, Float};
use rustc_codegen_ssa::common::IntPredicate;
use rustc_codegen_ssa::traits::{BackendTypes, BaseTypeCodegenMethods, BuilderMethods, OverflowOp};
use rustc_middle::ty::Ty;
Expand Down Expand Up @@ -426,7 +426,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
conv: CanonAbi::C,
can_unwind: false,
};
fn_abi.adjust_for_foreign_abi(self.cx, ExternAbi::C { unwind: false });
fn_abi.adjust_for_foreign_abi(self.cx);

let ret_indirect = matches!(fn_abi.ret.mode, PassMode::Indirect { .. });

Expand Down
20 changes: 20 additions & 0 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,26 @@ impl<'ll, 'tcx> Builder<'_, 'll, 'tcx> {
)
}

sym::scalbn => {
let ty = args[0].layout.ty;
let ty::Float(f) = ty.kind() else {
span_bug!(
span,
"the `{}` intrinsic requires a floating-point argument, got {:?}",
name,
ty
);
};
let llty = self.type_float_from_ty(*f);

// For our floats (that use a radix of 2), scalbn corresponds to ldexp.
self.call_intrinsic(
"llvm.ldexp",
&[llty, self.type_i32()],
&args.iter().map(|arg| arg.immediate()).collect::<Vec<_>>(),
)
}

sym::raw_eq => {
use BackendRepr::*;
let tp_ty = fn_args.type_at(0);
Expand Down
82 changes: 81 additions & 1 deletion compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,47 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
}
}

sym::scalbn => {
let arg = self.read_immediate(&args[0])?;
let exp = self.read_immediate(&args[1])?;

let ty::Float(float_ty) = arg.layout.ty.kind() else {
span_bug!(
self.cur_span(),
"non-float type for float intrinsic: {}",
arg.layout.ty,
);
};

let res = match float_ty {
FloatTy::F16 => self.scalbn_intrinsic::<Half>(arg, exp)?,
FloatTy::F32 => self.scalbn_intrinsic::<Single>(arg, exp)?,
FloatTy::F64 => self.scalbn_intrinsic::<Double>(arg, exp)?,
FloatTy::F128 => self.scalbn_intrinsic::<Quad>(arg, exp)?,
};
self.write_scalar(res, dest)?;
}

sym::ilogb => {
let arg = self.read_immediate(&args[0])?;

let ty::Float(float_ty) = arg.layout.ty.kind() else {
span_bug!(
self.cur_span(),
"non-float type for float intrinsic: {}",
arg.layout.ty,
);
};

let res = match float_ty {
FloatTy::F16 => self.ilogb_intrinsic::<Half>(arg)?,
FloatTy::F32 => self.ilogb_intrinsic::<Single>(arg)?,
FloatTy::F64 => self.ilogb_intrinsic::<Double>(arg)?,
FloatTy::F128 => self.ilogb_intrinsic::<Quad>(arg)?,
};
self.write_scalar(res, dest)?;
}

sym::va_copy => {
let va_list = self.deref_pointer(&args[0])?;

Expand Down Expand Up @@ -1190,7 +1231,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
{
let x: F = arg.to_scalar().to_float()?;
match name {
// bitwise, no NaN adjustments
// fabs is bitwise, no NaN adjustments.
sym::fabs => interp_ok(x.abs().into()),

sym::floor => self.float_round(x, rustc_apfloat::Round::TowardNegative),
Expand All @@ -1203,6 +1244,45 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
}
}

fn scalbn_intrinsic<F>(
&self,
arg: ImmTy<'tcx, M::Provenance>,
exp: ImmTy<'tcx, M::Provenance>,
) -> InterpResult<'tcx, Scalar<M::Provenance>>
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
let arg: F = arg.to_scalar().to_float()?;
let exp: i32 = exp.to_scalar().to_i32()?;

let res = arg.scalbn(exp);
let res = self.adjust_nan(res, &[arg]);
interp_ok(res.into())
}

fn ilogb_intrinsic<F>(
&mut self,
arg: ImmTy<'tcx, M::Provenance>,
) -> InterpResult<'tcx, Scalar<M::Provenance>>
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
let x: F = arg.to_scalar().to_float()?;

// We handle the special values manually, according to the intrinsic docs:
// 0 and NaN are UB, infinity returns i32::MAX.

if x.is_zero() {
throw_ub_format!("`ilogb` called on zero");
}

if x.is_nan() {
throw_ub_format!("`ilogb` called on NaN");
}

interp_ok(Scalar::from_i32(if x.is_infinite() { i32::MAX } else { x.ilogb() }))
}

fn binop_float_intrinsic<F>(
&self,
name: Symbol,
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_hir_analysis/src/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
| sym::rustc_peek
| sym::saturating_add
| sym::saturating_sub
| sym::scalbn
| sym::select_unpredictable
| sym::sin
| sym::size_of
Expand Down Expand Up @@ -475,6 +476,9 @@ pub(crate) fn check_intrinsic_type(
| sym::minimum_number_nsz
| sym::maximum_number_nsz => (1, 0, vec![param(0), param(0)], param(0)),

sym::scalbn => (1, 0, vec![param(0), tcx.types.i32], param(0)),
sym::ilogb => (1, 0, vec![param(0)], tcx.types.i32),

sym::powf => (1, 0, vec![param(0), param(0)], param(0)),

sym::volatile_load | sym::unaligned_volatile_load => {
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_hir_analysis/src/coherence/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ fn orphan_check<'tcx>(
for (arg, id_arg) in
std::iter::zip(args, ty::GenericArgs::identity_for_item(tcx, impl_def_id))
{
let _ = infcx.at(&cause, ty::ParamEnv::empty()).eq(
let _ = infcx.eq_raw(
&cause,
ty::ParamEnv::empty(),
DefineOpaqueTypes::No,
arg,
id_arg,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
// Otherwise, we have to walk through the supertraits to find
// one that does define it.
self.probe_single_bound_for_assoc_item(
|| traits::supertraits(tcx, trait_ref),
|| traits::supertraits(tcx, trait_ref).map(ty::Unnormalized::skip_norm_wip),
AssocItemQSelf::Trait(trait_ref.def_id()),
assoc_tag,
constraint.ident,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|| {
let trait_ref =
ty::Binder::dummy(trait_ref.instantiate_identity().skip_norm_wip());
traits::supertraits(tcx, trait_ref)
traits::supertraits(tcx, trait_ref).map(Unnormalized::skip_norm_wip)
},
AssocItemQSelf::SelfTyAlias,
assoc_tag,
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_hir_typeck/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
// This is `fcx.demand_eqtype`, but inlined to give a better error.
let cause = fcx.misc(self.span);
if fcx
.at(&cause, fcx.param_env)
.eq(DefineOpaqueTypes::Yes, src_obj, dst_obj)
.eq_raw(&cause, fcx.param_env, DefineOpaqueTypes::Yes, src_obj, dst_obj)
.map(|infer_ok| fcx.register_infer_ok_obligations(infer_ok))
.is_err()
{
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_hir_typeck/src/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
) {
// Check that E' = S'.
let cause = self.misc(hir_ty.span);
let InferOk { value: (), obligations } = self.at(&cause, self.param_env).eq(
let InferOk { value: (), obligations } = self.eq_raw(
&cause,
self.param_env,
DefineOpaqueTypes::Yes,
*expected_ty,
supplied_ty,
Expand All @@ -842,7 +844,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

let supplied_output_ty = supplied_sig.output();
let cause = &self.misc(decl.output.span());
let InferOk { value: (), obligations } = self.at(cause, self.param_env).eq(
let InferOk { value: (), obligations } = self.eq_raw(
cause,
self.param_env,
DefineOpaqueTypes::Yes,
expected_sigs.liberated_sig.output(),
supplied_output_ty,
Expand Down
23 changes: 12 additions & 11 deletions compiler/rustc_hir_typeck/src/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1777,17 +1777,18 @@ impl<'tcx> CoerceMany<'tcx> {
//
// Another example is `break` with no argument expression.
assert!(expression_ty.is_unit(), "if let hack without unit type");
fcx.at(cause, fcx.param_env)
.eq(
// needed for tests/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs
DefineOpaqueTypes::Yes,
expected,
found,
)
.map(|infer_ok| {
fcx.register_infer_ok_obligations(infer_ok);
expression_ty
})
fcx.eq_raw(
cause,
fcx.param_env,
// needed for tests/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs
DefineOpaqueTypes::Yes,
expected,
found,
)
.map(|infer_ok| {
fcx.register_infer_ok_obligations(infer_ok);
expression_ty
})
};

debug!(?result);
Expand Down
21 changes: 15 additions & 6 deletions compiler/rustc_hir_typeck/src/demand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
expected: Ty<'tcx>,
actual: Ty<'tcx>,
) -> Result<(), Diag<'a>> {
self.at(cause, self.param_env)
.eq(DefineOpaqueTypes::Yes, expected, actual)
self.eq_raw(cause, self.param_env, DefineOpaqueTypes::Yes, expected, actual)
.map(|infer_ok| self.register_infer_ok_obligations(infer_ok))
.map_err(|e| {
self.err_ctxt().report_mismatched_types(cause, self.param_env, expected, actual, e)
Expand Down Expand Up @@ -415,8 +414,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
};
let _ = self
.at(&ObligationCause::dummy(), self.param_env)
.eq(DefineOpaqueTypes::Yes, *input_arg, arg_ty)
.eq_raw(
&ObligationCause::dummy(),
self.param_env,
DefineOpaqueTypes::Yes,
*input_arg,
arg_ty,
)
.ok()?;
self.select_obligations_where_possible(|errs| {
// Yeet the errors, we're already reporting errors.
Expand Down Expand Up @@ -497,8 +501,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
.ok()
.and_then(|method| {
let _ = self
.at(&ObligationCause::dummy(), self.param_env)
.eq(DefineOpaqueTypes::Yes, ideal_rcvr_ty, expected_ty)
.eq_raw(
&ObligationCause::dummy(),
self.param_env,
DefineOpaqueTypes::Yes,
ideal_rcvr_ty,
expected_ty,
)
.ok()?;
Some(method)
});
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// This also occurs for an enum variant on a type alias.
let impl_ty = self.normalize(span, tcx.type_of(impl_def_id).instantiate(tcx, args));
let self_ty = self.normalize(span, Unnormalized::new_wip(self_ty));
match self.at(&self.misc(span), self.param_env).eq(
match self.eq_raw(
&self.misc(span),
self.param_env,
DefineOpaqueTypes::Yes,
impl_ty,
self_ty,
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

// 3. Check if the formal type is actually equal to the checked one
// and register any such obligations for future type checks.
let formal_ty_error = self.at(&self.misc(provided_arg.span), self.param_env).eq(
let formal_ty_error = self.eq_raw(
&self.misc(provided_arg.span),
self.param_env,
DefineOpaqueTypes::Yes,
formal_input_ty,
coerced_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 @@ -1046,7 +1046,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
// a `&self` method will wind up with an argument type like `&dyn Trait`.
let trait_ref = principal.with_self_ty(self.tcx, self_ty);
self.assemble_candidates_for_bounds(
traits::supertraits(self.tcx, trait_ref),
traits::supertraits(self.tcx, trait_ref).map(Unnormalized::skip_norm_wip),
|this, new_trait_ref, item| {
this.push_candidate(
Candidate { item, kind: ObjectCandidate(new_trait_ref), import_ids: &[] },
Expand Down
Loading
Loading