Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5885baa
Don't suggest replacing foreign format specifiers in `concat!` output
hina-kura49 Sep 26, 2026
e99838b
Fix the floating point clobbers of RISC-V `clobber_abi`
beetrees Oct 5, 2026
15b7f92
omit unconditionally invoking crate level limits query
mejrs Oct 8, 2026
d3a4f96
Point at prior token on `let` when expression is expected
estebank Oct 25, 2026
79bcc9d
Remove GenericArgRef
jdonszelmann Oct 27, 2026
d2cbecf
fixup clippy and rustdoc
jdonszelmann Oct 28, 2026
68e8bdf
fixup gcc
jdonszelmann Oct 28, 2026
101dc61
fixup miri
jdonszelmann Oct 28, 2026
23d352a
Use getrandom instead of /scheme/rand on Redox OS
bjorn3 Oct 28, 2026
e33a98d
Use a fixed-length encoding for hash disambiguators in v0 symbols
saethlin Oct 27, 2026
119529b
Add behavior tests for `Arc` and `Rc`
EFanZh Oct 29, 2026
1ddda91
fix RegionEq direction in canonical query responses
amirHdev Oct 28, 2026
558c1ec
remove unnecessary fast path from borrowck
dianne Oct 29, 2026
5dbf24c
use native interpreter impl for funnel shifts intrinsics
RalfJung Oct 29, 2026
2b154bd
fix MaybeDangling validity logic for ZST at usize::MAX
RalfJung Oct 29, 2026
ae72ce3
use adt_async_drop_tys for nested ADTs in needs_async_drop
Web4everyone32 Oct 29, 2026
b6997cd
reflection: doc attributes from adts, fields, and variants
Tess4552 Oct 26, 2026
b1b7ce4
Fix ICE in prelude edition lint
oli-obk Oct 29, 2026
3c39a8a
Rollup merge of #164851 - EFanZh:add-rc-behavior-tests, r=tgross35
JonathanBrouwer Oct 29, 2026
2501568
Rollup merge of #165079 - jdonszelmann:remove-generic-arg-ref, r=khyp…
JonathanBrouwer Oct 29, 2026
a78de8f
Rollup merge of #163839 - beetrees:fix-riscv-clobber-abi-fd, r=Amanieu
JonathanBrouwer Oct 29, 2026
d4b8028
Rollup merge of #165104 - bjorn3:redox_getrandom, r=workingjubilee
JonathanBrouwer Oct 29, 2026
dc7b845
Rollup merge of #163371 - h-kurashina:fix-format-foreign-concat, r=we…
JonathanBrouwer Oct 29, 2026
622d36b
Rollup merge of #163802 - amirHdev:solver-fixpoint-region-order, r=ad…
JonathanBrouwer Oct 29, 2026
c6f84ea
Rollup merge of #163986 - mejrs:limit_query, r=wesleywiser
JonathanBrouwer Oct 29, 2026
32738a1
Rollup merge of #164920 - estebank:issue-87291, r=wesleywiser
JonathanBrouwer Oct 29, 2026
262ec2c
Rollup merge of #164987 - Web4everyone32:async-drop-nested-sync-drop,…
JonathanBrouwer Oct 29, 2026
443cd45
Rollup merge of #165061 - saethlin:v0-mangling-fixed-len-disabiguator…
JonathanBrouwer Oct 29, 2026
98d648a
Rollup merge of #165094 - Tess4552:reflection-type-id-docs, r=oli-obk
JonathanBrouwer Oct 29, 2026
ed915d4
Rollup merge of #165114 - RalfJung:funnel-shift-intrinsics, r=oli-obk
JonathanBrouwer Oct 29, 2026
4641c09
Rollup merge of #165119 - dianne:remove-borrowck-fast-path, r=oli-obk
JonathanBrouwer Oct 29, 2026
1e89578
Rollup merge of #165122 - RalfJung:maybe-dangling-zst, r=oli-obk
JonathanBrouwer Oct 29, 2026
019aec1
Rollup merge of #165129 - oli-obk:prelude-edition-ice-use-tree, r=jie…
JonathanBrouwer Oct 29, 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
8 changes: 4 additions & 4 deletions compiler/rustc_borrowck/src/borrow_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@ impl<'a, 'tcx> GatherBorrows<'a, 'tcx> {
kind: mir::BorrowKind,
location: Location,
target_adt: ty::AdtDef<'tcx>,
target_args: &'tcx ty::List<ty::GenericArg<'tcx>>,
target_args: ty::GenericArgs<'tcx>,
target_place: mir::Place<'tcx>,
source_adt: ty::AdtDef<'tcx>,
source_args: &'tcx ty::List<ty::GenericArg<'tcx>>,
source_args: ty::GenericArgs<'tcx>,
source_place: mir::Place<'tcx>,
) {
let mut did_reborrow = false;
Expand Down Expand Up @@ -384,10 +384,10 @@ impl<'a, 'tcx> GatherBorrows<'a, 'tcx> {
kind,
location,
*target_field_adt,
target_field_args,
*target_field_args,
target_field_place,
*source_field_adt,
source_field_args,
*source_field_args,
source_field_place,
);
}
Expand Down
10 changes: 0 additions & 10 deletions compiler/rustc_borrowck/src/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,16 +448,6 @@ impl<'a, 'tcx> Borrows<'a, 'tcx> {
.map(|bs| bs.iter().copied())
.into_flat_iter();

// If the borrowed place is a local with no projections, all other borrows of this
// local must conflict. This is purely an optimization so we don't have to call
// `places_conflict::borrow_conflicts_with_place` for every borrow.
if place.projection.is_empty() {
if !self.body.local_decls[place.local].is_ref_to_static() {
state.kill_all(other_borrows_of_local);
}
return;
}

// By passing `PlaceConflictBias::NoOverlap`, we conservatively assume that any given
// pair of array indices are not equal, so that when `places_conflict` returns true, we
// will be assured that two places being compared definitely denotes the same sets of
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ impl<'diag, 'tcx> MirBorrowckCtxt<'_, 'diag, 'tcx> {
// In practice unless there are more than one field with the same type, we'll be
// suggesting a single field at a type, because we don't aggregate multiple borrow
// checker errors involving the functional record update syntax into a single one.
let field_ty = field.ty(self.infcx.tcx, args).skip_norm_wip();
let field_ty = field.ty(self.infcx.tcx, *args).skip_norm_wip();
let ident = field.ident(self.infcx.tcx);
if field_ty == ty && fields.iter().all(|field| field.ident.name != ident.name) {
// Suggest adding field and cloning it.
Expand Down Expand Up @@ -1371,7 +1371,7 @@ impl<'diag, 'tcx> MirBorrowckCtxt<'_, 'diag, 'tcx> {
&& let Some(local_did) = def.did().as_local()
&& def.variants().iter().all(|variant| {
variant.fields.iter().all(|field| {
self.implements_clone(field.ty(self.infcx.tcx, args).skip_norm_wip())
self.implements_clone(field.ty(self.infcx.tcx, *args).skip_norm_wip())
})
})
{
Expand Down
59 changes: 29 additions & 30 deletions compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {

err.span_label(closure_span, "in this closure");
let closure_arg_has_fn_trait_bound =
|callee_def_id, input_index, generic_args: ty::GenericArgsRef<'tcx>| {
|callee_def_id, input_index, generic_args: ty::GenericArgs<'tcx>| {
let sig = tcx.fn_sig(callee_def_id).instantiate(tcx, generic_args).skip_binder();
let Some(input_ty): Option<Ty<'tcx>> = sig.inputs().get(input_index).copied()
else {
Expand All @@ -1247,40 +1247,39 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {

// If the HIR node is a function or method call, get the DefId
// of the callee function or method, the span, and argument info for the call expr.
let get_call_details =
|| -> Option<(DefId, Span, usize, usize, ty::GenericArgsRef<'tcx>)> {
let hir::Node::Expr(hir::Expr { hir_id, kind, .. }) = node else {
return None;
};
let get_call_details = || -> Option<(DefId, Span, usize, usize, ty::GenericArgs<'tcx>)> {
let hir::Node::Expr(hir::Expr { hir_id, kind, .. }) = node else {
return None;
};

let typeck_results = tcx.typeck(def_id);
let typeck_results = tcx.typeck(def_id);

match kind {
hir::ExprKind::Call(expr, args) => {
if let Some(ty::FnDef(def_id, generic_args)) =
typeck_results.node_type_opt(expr.hir_id).as_ref().map(|ty| ty.kind())
{
let arg_pos = args.iter().position(|arg| arg.hir_id == closure_id)?;
Some((
*def_id,
expr.span,
arg_pos,
arg_pos,
generic_args.no_bound_vars().unwrap(),
))
} else {
None
}
}
hir::ExprKind::MethodCall(_, _, args, span) => {
match kind {
hir::ExprKind::Call(expr, args) => {
if let Some(ty::FnDef(def_id, generic_args)) =
typeck_results.node_type_opt(expr.hir_id).as_ref().map(|ty| ty.kind())
{
let arg_pos = args.iter().position(|arg| arg.hir_id == closure_id)?;
let def_id = typeck_results.type_dependent_def_id(*hir_id)?;
let generic_args = typeck_results.node_args_opt(*hir_id)?;
Some((def_id, *span, arg_pos, arg_pos + 1, generic_args))
Some((
*def_id,
expr.span,
arg_pos,
arg_pos,
generic_args.no_bound_vars().unwrap(),
))
} else {
None
}
_ => None,
}
};
hir::ExprKind::MethodCall(_, _, args, span) => {
let arg_pos = args.iter().position(|arg| arg.hir_id == closure_id)?;
let def_id = typeck_results.type_dependent_def_id(*hir_id)?;
let generic_args = typeck_results.node_args_opt(*hir_id)?;
Some((def_id, *span, arg_pos, arg_pos + 1, generic_args))
}
_ => None,
}
};

// If we can detect the expression to be a function or method call where the closure was
// an argument, we point at the function or method definition argument...
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_borrowck/src/diagnostics/region_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_errors::Diag;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_middle::ty::print::RegionHighlightMode;
use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, RegionVid, Ty, Unnormalized};
use rustc_middle::ty::{self, GenericArgKind, GenericArgs, RegionVid, Ty, Unnormalized};
use rustc_span::{DUMMY_SP, Span, Symbol, bug, kw, span_bug, sym};
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
use tracing::{debug, instrument};
Expand Down Expand Up @@ -669,7 +669,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
_ => {
if let Some(last_segment) = path.segments.last()
&& let Some(highlight) = self.match_adt_and_segment(
args,
*args,
needle_fr,
last_segment,
search_stack,
Expand Down Expand Up @@ -713,7 +713,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
/// types+hir to search through).
fn match_adt_and_segment<'hir>(
&self,
args: GenericArgsRef<'tcx>,
args: GenericArgs<'tcx>,
needle_fr: RegionVid,
last_segment: &'hir hir::PathSegment<'hir>,
search_stack: &mut Vec<(Ty<'tcx>, &'hir hir::Ty<'hir>)>,
Expand All @@ -736,7 +736,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
/// `search_stack` the types+hir to search through.
fn try_match_adt_and_generic_args<'hir>(
&self,
args: GenericArgsRef<'tcx>,
args: GenericArgs<'tcx>,
needle_fr: RegionVid,
hir_args: &'hir hir::GenericArgs<'hir>,
search_stack: &mut Vec<(Ty<'tcx>, &'hir hir::Ty<'hir>)>,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct PropagatedBorrowCheckResults<'tcx> {
used_mut_upvars: SmallVec<[FieldIdx; 8]>,
}

type DeferredClosureRequirements<'tcx> = Vec<(LocalDefId, ty::GenericArgsRef<'tcx>, Locations)>;
type DeferredClosureRequirements<'tcx> = Vec<(LocalDefId, ty::GenericArgs<'tcx>, Locations)>;

/// After we borrow check a closure, we are left with various
/// requirements that we have inferred between the free regions that
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_borrowck/src/places_conflict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,12 @@ fn place_components_conflict<'tcx>(
debug!("borrow_conflicts_with_place: shallow access behind ptr");
return false;
}
(ProjectionElem::Deref, ty::Ref(_, _, hir::Mutability::Not), _) => {
// Shouldn't be tracked
(ProjectionElem::Deref, ty::Ref(_, _, hir::Mutability::Not), _)
if !(base.projection.is_empty()
&& body.local_decls[borrow_local].is_ref_to_thread_local()) =>
{
// The only shared borrows we track are from temporaries created as references
// to thread-local statics. See `crate::place_ext::PlaceExt::ignore_borrow`.
bug!("Tracking borrow behind shared reference.");
}
(ProjectionElem::Deref, ty::Ref(_, _, hir::Mutability::Mut), AccessDepth::Drop) => {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_borrowck/src/polonius/liveness_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for VarianceExtractor<'_, 'tcx> {
a_ty: Ty<'tcx>,
_: Ty<'tcx>,
def_id: DefId,
a_args: ty::GenericArgsRef<'tcx>,
b_args: ty::GenericArgsRef<'tcx>,
_: impl FnOnce(ty::GenericArgsRef<'tcx>) -> Ty<'tcx>,
a_args: ty::GenericArgs<'tcx>,
b_args: ty::GenericArgs<'tcx>,
_: impl FnOnce(ty::GenericArgs<'tcx>) -> Ty<'tcx>,
) -> RelateResult<'tcx, Ty<'tcx>> {
let variances = self.cx().variances_of(def_id);
relate_args_with_variances(self, variances, a_args, b_args)?;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::{
self, Flags, GenericArgsRef, Region, RegionVid, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable,
self, Flags, GenericArgs, Region, RegionVid, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable,
TypeVisitor,
};
use rustc_span::bug;
Expand Down Expand Up @@ -147,7 +147,7 @@ impl<'tcx> CollectMemberConstraintsVisitor<'_, '_, 'tcx> {
fn cx(&self) -> TyCtxt<'tcx> {
self.rcx.infcx.tcx
}
fn visit_closure_args(&mut self, def_id: DefId, args: GenericArgsRef<'tcx>) {
fn visit_closure_args(&mut self, def_id: DefId, args: GenericArgs<'tcx>) {
let generics = self.cx().generics_of(def_id);
for arg in args.iter().skip(generics.parent_count) {
arg.visit_with(self);
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use rustc_macros::extension;
use rustc_middle::mir::{Body, ConstraintCategory};
use rustc_middle::ty::{
self, DefiningScopeKind, DefinitionSiteHiddenType, FallibleTypeFolder, Flags, GenericArg,
GenericArgsRef, OpaqueTypeKey, ProvisionalHiddenType, Region, RegionVid, Ty, TyCtxt,
TypeFoldable, TypeSuperFoldable, TypeVisitableExt, Unnormalized, fold_regions,
GenericArgs, OpaqueTypeKey, ProvisionalHiddenType, Region, RegionVid, Ty, TyCtxt, TypeFoldable,
TypeSuperFoldable, TypeVisitableExt, Unnormalized, fold_regions,
};
use rustc_mir_dataflow::points::DenseLocationMap;
use rustc_span::Span;
Expand Down Expand Up @@ -439,8 +439,8 @@ impl<'a, 'tcx> ToArgRegionsFolder<'a, 'tcx> {
fn fold_closure_args(
&mut self,
def_id: DefId,
args: GenericArgsRef<'tcx>,
) -> Result<GenericArgsRef<'tcx>, RegionVid> {
args: GenericArgs<'tcx>,
) -> Result<GenericArgs<'tcx>, RegionVid> {
let generics = self.cx().generics_of(def_id);
self.cx().mk_args_from_iter(args.iter().enumerate().map(|(index, arg)| {
if index < generics.parent_count {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/renumber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rustc_index::IndexSlice;
use rustc_infer::infer::NllRegionVariableOrigin;
use rustc_middle::mir::visit::{MutVisitor, TyContext};
use rustc_middle::mir::{Body, ConstOperand, Location, Promoted};
use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, TypeFoldable, fold_regions};
use rustc_middle::ty::{self, GenericArgs, Ty, TyCtxt, TypeFoldable, fold_regions};
use rustc_span::Symbol;
use tracing::{debug, instrument};

Expand Down Expand Up @@ -90,7 +90,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for RegionRenumberer<'a, 'tcx> {
}

#[instrument(skip(self), level = "debug")]
fn visit_args(&mut self, args: &mut GenericArgsRef<'tcx>, location: Location) {
fn visit_args(&mut self, args: &mut GenericArgs<'tcx>, location: Location) {
*args = self.renumber_regions(*args, || RegionCtxt::Location(location));

debug!(?args);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/root_cx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl<'diag, 'tcx> BorrowCheckRootCtxt<'diag, 'tcx> {
input: &mut CollectRegionConstraintsResult<'tcx>,
closure_requirements: &Option<ClosureRegionRequirements<'tcx>>,
closure_def_id: LocalDefId,
args: ty::GenericArgsRef<'tcx>,
args: ty::GenericArgs<'tcx>,
locations: Locations,
) {
if let Some(closure_requirements) = closure_requirements {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
&mut self,
closure_requirements: &ClosureRegionRequirements<'tcx>,
closure_def_id: LocalDefId,
closure_args: ty::GenericArgsRef<'tcx>,
closure_args: ty::GenericArgs<'tcx>,
) {
// Extract the values of the free regions in `closure_args`
// into a vector. These are the regions that we will be
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/type_check/liveness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc_index::interval::IntervalSet;
use rustc_middle::mir::visit::{TyContext, Visitor};
use rustc_middle::mir::{Body, Local, Location, SourceInfo};
use rustc_middle::ty::relate::Relate;
use rustc_middle::ty::{GenericArgsRef, Region, RegionVid, Ty, TyCtxt, TypeVisitable};
use rustc_middle::ty::{GenericArgs, Region, RegionVid, Ty, TyCtxt, TypeVisitable};
use rustc_mir_dataflow::move_paths::MoveData;
use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex};
use rustc_span::span_bug;
Expand Down Expand Up @@ -220,7 +220,7 @@ struct LiveVariablesVisitor<'a, 'tcx> {
impl<'a, 'tcx> Visitor<'tcx> for LiveVariablesVisitor<'a, 'tcx> {
/// We sometimes have `args` within an rvalue, or within a
/// call. Make them live at the location where they appear.
fn visit_args(&mut self, args: &GenericArgsRef<'tcx>, location: Location) {
fn visit_args(&mut self, args: &GenericArgs<'tcx>, location: Location) {
self.record_regions_live_at(*args, location);
self.super_args(args);
}
Expand Down
15 changes: 7 additions & 8 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use rustc_middle::traits::query::NoSolution;
use rustc_middle::ty::adjustment::PointerCoercion;
use rustc_middle::ty::cast::CastTy;
use rustc_middle::ty::{
self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, GenericArgsRef, Ty, TyCtxt,
self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, GenericArgs, Ty, TyCtxt,
TypeVisitableExt, UserArgs, UserTypeAnnotationIndex, fold_regions,
};
use rustc_mir_dataflow::move_paths::MoveData;
Expand Down Expand Up @@ -2509,7 +2509,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
let src_ty = src_place.ty(self.body, tcx).ty;

let ty::Adt(dst_adt, dst_args) = dst_ty.kind() else { bug!() };
let [dst_arg, ..] = ***dst_args else { bug!() };
let [dst_arg, ..] = *dst_args.as_slice() else { bug!() };
let ty::GenericArgKind::Lifetime(dst_region) = dst_arg.kind() else { bug!() };
constraints.liveness_constraints.add_location(dst_region.as_var(), location);

Expand Down Expand Up @@ -2596,8 +2596,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
};
// These field types can still contain projections from the source or target type
// and normalize them before handing them to `NllTypeRelating`
let dst_ty = self.normalize(dst_field.ty(tcx, dst_args), location.to_locations());
let src_ty = self.normalize(src_field.ty(tcx, src_args), location.to_locations());
let dst_ty = self.normalize(dst_field.ty(tcx, *dst_args), location.to_locations());
let src_ty = self.normalize(src_field.ty(tcx, *src_args), location.to_locations());

if let (
ty::Ref(src_region, _, Mutability::Mut),
Expand Down Expand Up @@ -2709,7 +2709,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
&mut self,
tcx: TyCtxt<'tcx>,
def_id: LocalDefId,
args: GenericArgsRef<'tcx>,
args: GenericArgs<'tcx>,
location: Location,
) -> ty::InstantiatedClauses<'tcx> {
let root_def_id = self.infcx.root_def_id;
Expand All @@ -2728,16 +2728,15 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
// FIXME(async_closures): It may be useful to add a debug assert here
// to actually call `type_of` and check the `parent_args` are the same
// length as the `typeck_root_args`.
&args[..typeck_root_args.len()]
tcx.mk_args(&args.as_slice()[..typeck_root_args.len()])
}
DefKind::AnonConst
if tcx.anon_const_kind(def_id) == ty::AnonConstKind::NonTypeSystemInline =>
{
args.as_inline_const().parent_args()
tcx.mk_args(args.as_inline_const().parent_args())
}
other => bug!("unexpected item {:?}", other),
};
let parent_args = tcx.mk_args(parent_args);

assert_eq!(typeck_root_args.len(), parent_args.len());
if let Err(_) = self.eq_args(
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_borrowck/src/type_check/relate_tys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
/// Add sufficient constraints to ensure `a == b`. See also [Self::relate_types].
pub(super) fn eq_args(
&mut self,
a: ty::GenericArgsRef<'tcx>,
b: ty::GenericArgsRef<'tcx>,
a: ty::GenericArgs<'tcx>,
b: ty::GenericArgs<'tcx>,
locations: Locations,
category: ConstraintCategory<'tcx>,
) -> Result<(), NoSolution> {
Expand Down Expand Up @@ -338,9 +338,9 @@ impl<'b, 'tcx> TypeRelation<TyCtxt<'tcx>> for NllTypeRelating<'_, 'b, 'tcx> {
a_ty: Ty<'tcx>,
b_ty: Ty<'tcx>,
def_id: DefId,
a_args: ty::GenericArgsRef<'tcx>,
b_args: ty::GenericArgsRef<'tcx>,
_: impl FnOnce(ty::GenericArgsRef<'tcx>) -> Ty<'tcx>,
a_args: ty::GenericArgs<'tcx>,
b_args: ty::GenericArgs<'tcx>,
_: impl FnOnce(ty::GenericArgs<'tcx>) -> Ty<'tcx>,
) -> RelateResult<'tcx, Ty<'tcx>> {
if self.ambient_variance == ty::Invariant {
// Avoid fetching the variance if we are in an invariant context,
Expand Down
Loading
Loading