Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1b0230e
Update documentation for -Zdump-dep-graph
blyxyas Jul 14, 2026
9ad9fe0
Add `Default` implementation for `std::sync::Once`
tbu- Jul 29, 2026
a8d9636
fix
bb1yd Jun 16, 2026
15e32c5
Error on projection of dyn noncompat type in old trait solver
spirali Apr 8, 2026
953e278
Reduce number of error messages
spirali Jun 29, 2026
1c18ee4
Remove more redundant errors
spirali Aug 3, 2026
9ac7293
resolver diagnostics: don't swallow labels and point out similar ite…
mejrs Aug 10, 2026
0360271
imagine developing on windows
mejrs Aug 10, 2026
cf0a043
Use Rust ABI for __rust_panic_cleanup
bjorn3 Jul 28, 2026
8087334
Directly use Box in the PanicPayload trait and __rust_panic_cleanup
bjorn3 Jul 28, 2026
ae5215c
Mark PanicPayload and __rust_start_panic as safe
bjorn3 Jul 28, 2026
3ef33b7
Avoid allocation when using dummy panic_unwind impl
bjorn3 Jul 28, 2026
ffc65e5
Mark __rust_drop_panic and __rust_foreign_exception as safe
bjorn3 Aug 14, 2026
32999f2
Fix assumptions-on-binders outlives diagnostics
Dnreikronos Jun 29, 2026
2abc0f6
Generalize solver region constraint spans
Dnreikronos Jul 24, 2026
1c21b08
Clarify region constraint span documentation
Dnreikronos Jul 24, 2026
b3fb32a
Keep solver region constraints on the borrowck InferCtxt
Dnreikronos Aug 19, 2026
36597f7
Bless trailing blank line in alias_outlives stderr
Dnreikronos Aug 19, 2026
7bffce8
Split type-op constraint fix from diagnostics
Dnreikronos Aug 20, 2026
8b18fda
fix unrecognized link
lqd Aug 20, 2026
bbc9e66
Build rustc and codegen backends with -Zembed-metadata=no
bjorn3 Jan 13, 2026
fa87d61
add some documentation about shared abstraction layer
lqd Aug 21, 2026
3c55beb
core: implement float conversion methods
valentynkit Jul 25, 2026
5d347d7
Add myself to mailmap
AsakuraMizu Aug 21, 2026
373266b
Avoid arming the Windows TLS destructor guard in fibers
ohadravid Aug 21, 2026
13bf326
Remove leftover immediate creation
jdupak-ms Aug 21, 2026
8fe7ae5
Add safety comments in alloc::Wtf8, and update the link in core::Wtf8
yilin0518 Aug 21, 2026
3c43eb0
reflection: remove fields from TypeKind::Int and Float
yara-blue Aug 19, 2026
1d2a65f
reflection: remove field from TypeKind::Bool and Char
yara-blue Aug 19, 2026
4c68bd8
Add Arc/Rc::strong_count_from_raw
valentynkit Aug 21, 2026
823b923
Use bitset for locals_with_use_data
panstromek Aug 21, 2026
8978aee
bootstrap: build the offload/openmp runtimes with clang
ZuseZ4 Aug 20, 2026
10b5235
bootstrap: rename `Config::llvm_clang_dir` to `offload_clang_dir`
ZuseZ4 Aug 21, 2026
e8b1e4b
Warn about running ui-fulldeps tests in stage 1
Kobzol Aug 21, 2026
e2fcf35
Comment added
spirali Aug 22, 2026
6eeda7a
Rollup merge of #151061 - bjorn3:rustc_no_embed_metadata, r=Kobzol
JonathanBrouwer Aug 22, 2026
9c98028
Rollup merge of #154992 - spirali:fix-dyn-projection, r=lcnr
JonathanBrouwer Aug 22, 2026
010b6b1
Rollup merge of #157949 - bb1yd:allow-self-in-const-generics, r=BoxyUwU
JonathanBrouwer Aug 22, 2026
50d27e1
Rollup merge of #158588 - Dnreikronos:trait_selection/assumptions_bin…
JonathanBrouwer Aug 22, 2026
f5ca205
Rollup merge of #159954 - valentynkit:float-conversions, r=JohnTitor
JonathanBrouwer Aug 22, 2026
871c85e
Rollup merge of #160136 - tbu-:pr_once_default, r=clarfonthey
JonathanBrouwer Aug 22, 2026
6c55beb
Rollup merge of #160835 - mejrs:resolve_labels, r=JohnTitor
JonathanBrouwer Aug 22, 2026
b0359b2
Rollup merge of #161048 - bjorn3:refactor_unwind5, r=clarfonthey
JonathanBrouwer Aug 22, 2026
0d32bcb
Rollup merge of #161292 - yilin0518:fix_alloc_wtf8, r=clarfonthey
JonathanBrouwer Aug 22, 2026
98c9493
Rollup merge of #161444 - lqd:ir-comments, r=lcnr
JonathanBrouwer Aug 22, 2026
0ffd0ec
Rollup merge of #161465 - jdupak-ms:patch-1, r=wesleywiser
JonathanBrouwer Aug 22, 2026
1f4d76f
Rollup merge of #159098 - valentynkit:arc-rc-strong-count-from-raw, r…
JonathanBrouwer Aug 22, 2026
0105913
Rollup merge of #159282 - blyxyas:walk-items-creader, r=jackh726
JonathanBrouwer Aug 22, 2026
24e6a0e
Rollup merge of #161401 - yara-blue:remove-typekind-fields2, r=oli-obk
JonathanBrouwer Aug 22, 2026
6681267
Rollup merge of #161431 - ZuseZ4:offload-clang-compiler, r=Kobzol
JonathanBrouwer Aug 22, 2026
ddfd6dc
Rollup merge of #161451 - ohadravid:windows-tls-avoid-registering-dto…
JonathanBrouwer Aug 22, 2026
42f0c9f
Rollup merge of #161463 - AsakuraMizu:mailmap, r=jieyouxu
JonathanBrouwer Aug 22, 2026
7935c61
Rollup merge of #161476 - panstromek:use-bitset-locals-with-use-data,…
JonathanBrouwer Aug 22, 2026
45cb821
Rollup merge of #161483 - Kobzol:ui-fulldeps-stage-1-warning, r=jieyouxu
JonathanBrouwer Aug 22, 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
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -743,3 +743,4 @@ Zack Corr <zack@z0w0.me> <zackcorr95@gmail.com>
Zack Slayton <zack.slayton@gmail.com>
Zbigniew Siciarz <zbigniew@siciarz.net> Zbigniew Siciarz <antyqjon@gmail.com>
y21 <30553356+y21@users.noreply.github.com>
朝倉水希 <mizuk1@mzk1.dev> <asakuramizu111@gmail.com>
11 changes: 3 additions & 8 deletions compiler/rustc_borrowck/src/diagnostics/region_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,9 @@ impl<'diag, 'tcx> MirBorrowckCtxt<'_, 'diag, 'tcx> {
let errci = ErrorConstraintInfo { fr, outlived_fr, category, span };

let mut diag = match (category, fr_is_local, outlived_fr_is_local) {
(ConstraintCategory::SolverRegionConstraint(span), _, _) => {
let mut d = self.dcx().struct_span_err(
span,
"unsatisfied lifetime constraint from -Zassumptions-on-binders :3",
);
d.note("meoow :c");
d
}
(ConstraintCategory::SolverRegionConstraint(span), _, _) => self
.dcx()
.struct_span_err(span, "higher-ranked lifetime bound could not be satisfied"),
(ConstraintCategory::Return(kind), true, false)
if self.regioncx.is_closure_fn_mut(fr) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
GenericArgKind::Lifetime(r1) => {
let r1_vid = self.to_region_vid(r1);
let r2_vid = self.to_region_vid(r2);
self.add_outlives(r1_vid, r2_vid, constraint_category);
self.add_outlives(r1_vid, r2_vid, constraint_category, self.span);
}

GenericArgKind::Type(mut t1) => {
Expand Down Expand Up @@ -221,6 +221,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
sup: ty::RegionVid,
sub: ty::RegionVid,
category: ConstraintCategory<'tcx>,
span: Span,
) {
let category = match self.category {
ConstraintCategory::Boring | ConstraintCategory::BoringNoLocation => category,
Expand All @@ -229,7 +230,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
self.constraints.outlives_constraints.push(OutlivesConstraint {
locations: self.locations,
category,
span: self.span,
span,
sub,
sup,
variance_info: ty::VarianceDiagInfo::default(),
Expand All @@ -246,14 +247,14 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
impl<'a, 'b, 'tcx> TypeOutlivesDelegate<'tcx> for &'a mut ConstraintConversion<'b, 'tcx> {
fn push_sub_region_constraint(
&mut self,
_origin: SubregionOrigin<'tcx>,
origin: SubregionOrigin<'tcx>,
a: ty::Region<'tcx>,
b: ty::Region<'tcx>,
constraint_category: ConstraintCategory<'tcx>,
) {
let b = self.to_region_vid(b);
let a = self.to_region_vid(a);
self.add_outlives(b, a, constraint_category);
self.add_outlives(b, a, constraint_category, origin.span());
}

fn push_verify(
Expand Down
13 changes: 8 additions & 5 deletions compiler/rustc_borrowck/src/type_check/liveness/local_use_map.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use rustc_index::IndexVec;
use rustc_index::bit_set::DenseBitSet;
use rustc_middle::mir::visit::{PlaceContext, Visitor};
use rustc_middle::mir::{Body, Local, Location};
use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex};
Expand Down Expand Up @@ -97,9 +98,11 @@ impl LocalUseMap {
return local_use_map;
}

let mut locals_with_use_data: IndexVec<Local, bool> =
IndexVec::from_elem(false, &body.local_decls);
live_locals.iter().for_each(|&local| locals_with_use_data[local] = true);
let mut locals_with_use_data: DenseBitSet<Local> =
DenseBitSet::new_empty(body.local_decls.len());
live_locals.iter().for_each(|&local| {
locals_with_use_data.insert(local);
});

LocalUseMapBuild { local_use_map: &mut local_use_map, location_map, locals_with_use_data }
.visit_body(body);
Expand Down Expand Up @@ -134,12 +137,12 @@ struct LocalUseMapBuild<'me> {
// obtained the same information from `live_locals` but we want to
// avoid repeatedly calling `Vec::contains()` (see `LocalUseMap` for
// the rationale on the time-memory trade-off we're favoring here).
locals_with_use_data: IndexVec<Local, bool>,
locals_with_use_data: DenseBitSet<Local>,
}

impl Visitor<'_> for LocalUseMapBuild<'_> {
fn visit_local(&mut self, local: Local, context: PlaceContext, location: Location) {
if self.locals_with_use_data[local]
if self.locals_with_use_data.contains(local)
&& let Some(def_use) = def_use::categorize(context)
{
let first_appearance = match def_use {
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ pub(crate) fn type_check<'tcx>(
&mut converter,
typeck.known_type_outlives_obligations,
universal_region_relations.outlives.clone(),
infcx.tcx.def_span(infcx.root_def_id),
);
}

Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
parse_atomic_ordering(fail_ordering),
weak,
);
let val = bx.from_immediate(val);
let success = bx.from_immediate(success);

let mut builder = OperandRefBuilder::new(result_layout);
builder.insert_imm(FieldIdx::from_u32(0), val);
Expand Down
69 changes: 6 additions & 63 deletions compiler/rustc_const_eval/src/const_eval/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
// Fill all fields of the `TypeInfo` struct.
for (idx, field) in ty_struct.fields.iter_enumerated() {
let field_dest = self.project_field(dest, idx)?;
let ptr_bit_width = || self.tcx.data_layout.pointer_size().bits();
match field.name {
sym::kind => {
let variant_index = match ty.kind() {
Expand Down Expand Up @@ -115,33 +114,19 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
self.project_downcast_named(&field_dest, sym::Char)?;
variant
}
ty::Int(int_ty) => {
let (variant, variant_place) =
ty::Int(_) => {
let (variant, _variant_place) =
self.project_downcast_named(&field_dest, sym::Int)?;
let place = self.project_field(&variant_place, FieldIdx::ZERO)?;
self.write_int_type_info(
place,
int_ty.bit_width().unwrap_or_else(/* isize */ ptr_bit_width),
true,
)?;
variant
}
ty::Uint(uint_ty) => {
let (variant, variant_place) =
ty::Uint(_) => {
let (variant, _variant_place) =
self.project_downcast_named(&field_dest, sym::Int)?;
let place = self.project_field(&variant_place, FieldIdx::ZERO)?;
self.write_int_type_info(
place,
uint_ty.bit_width().unwrap_or_else(/* usize */ ptr_bit_width),
false,
)?;
variant
}
ty::Float(float_ty) => {
let (variant, variant_place) =
ty::Float(_) => {
let (variant, _variant_place) =
self.project_downcast_named(&field_dest, sym::Float)?;
let place = self.project_field(&variant_place, FieldIdx::ZERO)?;
self.write_float_type_info(place, float_ty.bit_width())?;
variant
}
ty::Str => {
Expand Down Expand Up @@ -316,48 +301,6 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
interp_ok(())
}

fn write_int_type_info(
&mut self,
place: impl Writeable<'tcx, CtfeProvenance>,
bit_width: u64,
signed: bool,
) -> InterpResult<'tcx> {
for (field_idx, field) in
place.layout().ty.ty_adt_def().unwrap().non_enum_variant().fields.iter_enumerated()
{
let field_place = self.project_field(&place, field_idx)?;
match field.name {
sym::bits => self.write_scalar(
Scalar::from_u32(bit_width.try_into().expect("bit_width overflowed")),
&field_place,
)?,
sym::signed => self.write_scalar(Scalar::from_bool(signed), &field_place)?,
other => span_bug!(self.tcx.def_span(field.did), "unimplemented field {other}"),
}
}
interp_ok(())
}

fn write_float_type_info(
&mut self,
place: impl Writeable<'tcx, CtfeProvenance>,
bit_width: u64,
) -> InterpResult<'tcx> {
for (field_idx, field) in
place.layout().ty.ty_adt_def().unwrap().non_enum_variant().fields.iter_enumerated()
{
let field_place = self.project_field(&place, field_idx)?;
match field.name {
sym::bits => self.write_scalar(
Scalar::from_u32(bit_width.try_into().expect("bit_width overflowed")),
&field_place,
)?,
other => span_bug!(self.tcx.def_span(field.did), "unimplemented field {other}"),
}
}
interp_ok(())
}

pub(crate) fn write_reference_type_info(
&mut self,
place: impl Writeable<'tcx, CtfeProvenance>,
Expand Down
16 changes: 14 additions & 2 deletions compiler/rustc_hir_analysis/src/collect/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use tracing::instrument;

use super::{HirPlaceholderCollector, ItemCtxt, bad_placeholder};
use crate::check::wfcheck::check_static_item;
use crate::diagnostics::ParamInTyOfConstParam;
use crate::hir_ty_lowering::HirTyLowerer;

mod opaque;
Expand Down Expand Up @@ -239,8 +240,19 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_
}

Node::GenericParam(param) => match &param.kind {
GenericParamKind::Type { default: Some(ty), .. }
| GenericParamKind::Const { ty, .. } => icx.lower_ty(ty),
GenericParamKind::Type { default: Some(ty), .. } => icx.lower_ty(ty),
GenericParamKind::Const { ty, .. } => {
let lowered_ty = icx.lower_ty(ty);
if !tcx.features().generic_const_parameter_types() && lowered_ty.has_param() {
let guar = tcx
.dcx()
.create_err(ParamInTyOfConstParam { span: ty.span, ty: lowered_ty })
.emit();
Ty::new_error(tcx, guar)
} else {
lowered_ty
}
}
x => bug!("unexpected non-type Node::GenericParam: {:?}", x),
},

Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_hir_analysis/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2144,3 +2144,12 @@ pub(crate) struct OnlyStructsCanBeViewedAdt<'tcx> {
pub article: &'static str,
pub kind: &'static str,
}

#[derive(Diagnostic)]
#[diag("the type of const parameters must not depend on other generic parameters", code = E0770)]
pub(crate) struct ParamInTyOfConstParam<'tcx> {
#[primary_span]
#[label("the type `{$ty}` must not depend on other generic parameter")]
pub(crate) span: Span,
pub(crate) ty: Ty<'tcx>,
}
8 changes: 5 additions & 3 deletions compiler/rustc_infer/src/infer/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,21 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
fn get_solver_region_constraint(
&self,
) -> rustc_type_ir::region_constraint::RegionConstraint<TyCtxt<'tcx>> {
self.inner.borrow().solver_region_constraint_storage.get_constraint()
self.inner.borrow().solver_region_constraint_storage.get_unspanned_constraint()
}

fn overwrite_solver_region_constraint(
&self,
constraint: rustc_type_ir::region_constraint::RegionConstraint<TyCtxt<'tcx>>,
span: Span,
) {
let mut inner = self.inner.borrow_mut();
use rustc_data_structures::undo_log::UndoLogs;

use crate::infer::UndoLog;
let old_constraint = inner.solver_region_constraint_storage.get_constraint();
inner.undo_log.push(UndoLog::OverwriteSolverRegionConstraint { old_constraint });
inner.solver_region_constraint_storage.overwrite_solver_region_constraint(constraint);
inner.solver_region_constraint_storage.overwrite(constraint, span);
}

fn universe_of_ty(&self, vid: ty::TyVid) -> Option<ty::UniverseIndex> {
Expand Down Expand Up @@ -331,14 +332,15 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
fn register_solver_region_constraint(
&self,
c: rustc_type_ir::region_constraint::RegionConstraint<TyCtxt<'tcx>>,
span: Span,
) {
let mut inner = self.inner.borrow_mut();
use rustc_data_structures::undo_log::UndoLogs;

use crate::infer::UndoLog;
let previous_was_and = inner.solver_region_constraint_storage.is_and();
inner.undo_log.push(UndoLog::PushSolverRegionConstraint { previous_was_and });
inner.solver_region_constraint_storage.push(c);
inner.solver_region_constraint_storage.push(c, span);
}

fn register_ty_outlives(&self, ty: Ty<'tcx>, r: ty::Region<'tcx>, span: Span) {
Expand Down
60 changes: 4 additions & 56 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ pub mod region_constraints;
pub mod relate;
pub mod resolve;
pub(crate) mod snapshot;
mod solver_region_constraints;
mod type_variable;
mod unify_key;

pub(crate) use solver_region_constraints::SolverRegionConstraint;
use solver_region_constraints::SolverRegionConstraintStorage;

/// `InferOk<'tcx, ()>` is used a lot. It may seem like a useless wrapper
/// around `PredicateObligations<'tcx>`, but it has one important property:
/// because `InferOk` is marked with `#[must_use]`, if you have a method
Expand Down Expand Up @@ -1809,62 +1813,6 @@ impl<'tcx> InferCtxt<'tcx> {
}
}

type SolverRegionConstraint<'tcx> =
rustc_type_ir::region_constraint::RegionConstraint<TyCtxt<'tcx>>;

#[derive(Clone, Debug)]
struct SolverRegionConstraintStorage<'tcx>(SolverRegionConstraint<'tcx>);

impl<'tcx> SolverRegionConstraintStorage<'tcx> {
fn new() -> Self {
SolverRegionConstraintStorage(SolverRegionConstraint::And(Box::new([])))
}

fn get_constraint(&self) -> SolverRegionConstraint<'tcx> {
self.0.clone()
}

fn is_and(&self) -> bool {
self.0.is_and()
}

fn pop(&mut self, previous_was_and: bool) -> Option<SolverRegionConstraint<'tcx>> {
match &mut self.0 {
SolverRegionConstraint::And(and) => {
let mut and = core::mem::take(and).into_iter().collect::<Vec<_>>();
let popped = and.pop()?;
if previous_was_and {
self.0 = SolverRegionConstraint::And(and.into_boxed_slice());
} else {
assert_eq!(and.len(), 1);
self.0 = and.pop().unwrap();
}
Some(popped)
}
_ => unreachable!(),
}
}

#[instrument(level = "debug")]
fn push(&mut self, constraint: SolverRegionConstraint<'tcx>) {
match core::mem::replace(&mut self.0, SolverRegionConstraint::new_true()) {
SolverRegionConstraint::And(and) => {
let and =
and.into_iter().chain([constraint]).collect::<Vec<_>>().into_boxed_slice();
self.0 = SolverRegionConstraint::And(and);
}
previous => {
self.0 = SolverRegionConstraint::And(Box::new([previous, constraint]));
}
}
}

#[instrument(level = "debug", skip(self))]
fn overwrite_solver_region_constraint(&mut self, constraint: SolverRegionConstraint<'tcx>) {
self.0 = constraint;
}
}

/// Returns unresolved root variables from `table`, according to `is_unresolved`.
fn unresolved_root_variables_of<V: UnifyKey>(
mut table: UnificationTable<'_, '_, V>,
Expand Down
Loading
Loading