Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
63c15e4
test: cover current if let closure capture behavior
Embers-of-the-Fire Mar 22, 2026
923ef1f
fix: drop eager if let scrutinee borrow during capture analysis
Embers-of-the-Fire Mar 22, 2026
665416d
test(ui): add regression for if-let closure capture size
Embers-of-the-Fire Mar 22, 2026
2aadcee
feat: remove callback param for walk_local method
Embers-of-the-Fire Mar 22, 2026
1f81a55
test: add if let test for partial capture
Embers-of-the-Fire Apr 18, 2026
f491a6c
test(miri): add if-let closure capture UB smoke tests
Embers-of-the-Fire May 21, 2026
0e87c76
Adding diagnostic markers for multiple fs functions
asder8215 Aug 4, 2026
e6b20c8
diagnostics: unify foreign-trait label for ADT and primitive types in…
Omar1H1 Aug 8, 2026
b685be1
reflection: Add TypeId::variant() returning new Variant
yara-blue Aug 13, 2026
2b7d180
reflection: add non-exhaustive to meme::type_info::Variant
yara-blue Aug 13, 2026
74890b1
reflection: update tests to use methods on TypeId
yara-blue Aug 13, 2026
f5fc985
reflection: update FieldRepresentingType debug to use methods on TypeId
yara-blue Aug 13, 2026
37e1969
reflection: remove fields from TypeKind
yara-blue Aug 13, 2026
a123594
reflection: resolve false positive in unrelated ui-test
yara-blue Aug 14, 2026
6e0fdfb
reflection: resolve false positives in field-projection ui tests
yara-blue Aug 14, 2026
f6c1ef2
reflection: add FIXME about error messages for methods
yara-blue Aug 14, 2026
f3381d2
Allow `Subcommand::Fix` to have fields
Zalathar Aug 17, 2026
e9963a8
Allow `./x fix --allow-dirty`
Zalathar Aug 17, 2026
5898a39
Initial implementation of `FnPtr` trait
carbotaniuman Aug 18, 2026
6064370
rename `ProjectionPredicate` to `ProjectionClause`
ada4a Aug 18, 2026
169bd22
rename `TraitPredicate` to `TraitClause`
ada4a Aug 12, 2026
8e8661e
std: use UNIX's `Instant` and `SystemTime` on Hermit
joboet Aug 18, 2026
0c0be1f
remove unused import on Hermit
joboet Aug 18, 2026
00d7802
remove rustc_error_messages dependency
mejrs Aug 18, 2026
951f07a
Rename test so it matches the issue
aerooneqq Aug 18, 2026
3bf4003
Require windowed (and exception) for Xtensa ABI
MabezDev Aug 6, 2026
8a446b5
Add Xtensa to the ABI flag consistency match
MabezDev Aug 17, 2026
d586e24
`allow(non_camel_case_types)` in `minicore.rs`
folkertdev Aug 18, 2026
fcc49d2
suppress projection errors already covered by a trait error
Albab-Hasan Aug 14, 2026
c67d6df
only suppress a projection error when its own trait goal fails
Albab-Hasan Aug 18, 2026
8408993
Enable overflow checks in `rustc_thread_pool`
aerooneqq Aug 18, 2026
9268e12
reflection: add a variant of TypeId::of without the static bound
yara-blue Aug 17, 2026
30a47c4
Relax codgen test variable regex
TimNN Aug 18, 2026
57d455b
Doc: clarify how `Read::bytes` handling Interrupted errors
xizheyin Aug 18, 2026
1724501
allocator: wording & grammar nitpicks
nia-e Aug 14, 2026
c132f36
okay max sure
nia-e Aug 18, 2026
2ee54ff
undo rc and arc thing
nia-e Aug 18, 2026
4f2bbfd
tighten send so bad rc can't be used
nia-e Aug 18, 2026
31d172e
this too
nia-e Aug 18, 2026
7d40fdb
there u go
nia-e Aug 18, 2026
b8f0e6a
Update books
rustbot Aug 18, 2026
5575007
Update rustbook `Cargo.lock`
traviscross Aug 18, 2026
0489275
[compiletest] Use the correct rustc lib directory for query_rustc_output
jnkel Aug 19, 2026
7cf19d0
Rollup merge of #154210 - Embers-of-the-Fire:feat/if-let-no-full-capt…
jhpratt Aug 19, 2026
66e567a
Rollup merge of #156176 - carbotaniuman:fn-ptr-trait-impl, r=jackh726
jhpratt Aug 19, 2026
a014d59
Rollup merge of #160767 - Omar1H1:diagnostics/e0117-label-fix, r=petr…
jhpratt Aug 19, 2026
5ce7b65
Rollup merge of #161297 - joboet:hermit_time_reuse, r=nia-e
jhpratt Aug 19, 2026
474ef18
Rollup merge of #160489 - asder8215:fs_diagnostic_items, r=mejrs
jhpratt Aug 19, 2026
13d77be
Rollup merge of #160643 - esp-rs:xtensa-abi-require-windowed, r=RalfJung
jhpratt Aug 19, 2026
b636576
Rollup merge of #161088 - Albab-Hasan:suppress-duplicate-closure-outp…
jhpratt Aug 19, 2026
829490d
Rollup merge of #161114 - yara-blue:remove-typekind-fields, r=oli-obk
jhpratt Aug 19, 2026
8799bcb
Rollup merge of #161115 - nia-e:allocator-nitpicks, r=clarfonthey
jhpratt Aug 19, 2026
edfaffd
Rollup merge of #161220 - Zalathar:allow-dirty, r=Kobzol
jhpratt Aug 19, 2026
9df932c
Rollup merge of #161291 - ada4a:push-xqqtloltnvwu, r=oli-obk
jhpratt Aug 19, 2026
10815a5
Rollup merge of #161296 - aerooneqq:try-enable-overflow-checks, r=pet…
jhpratt Aug 19, 2026
52cdb79
Rollup merge of #161298 - mejrs:error_messages, r=lqd
jhpratt Aug 19, 2026
beba01d
Rollup merge of #161304 - aerooneqq:rename-test, r=lqd
jhpratt Aug 19, 2026
245944b
Rollup merge of #161309 - folkertdev:minicore-allow-non-camel-case, r…
jhpratt Aug 19, 2026
43619d4
Rollup merge of #161315 - TimNN:relax-regex, r=durin42
jhpratt Aug 19, 2026
0da2f95
Rollup merge of #161318 - xizheyin:161288, r=nia-e
jhpratt Aug 19, 2026
c26c77d
Rollup merge of #161321 - rustbot:docs-update, r=traviscross
jhpratt Aug 19, 2026
41025d7
Rollup merge of #161335 - jnkel:fix-query-compiler-libs, r=jieyouxu
jhpratt Aug 19, 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: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4385,7 +4385,6 @@ dependencies = [
"rustc_ast_ir",
"rustc_crate_store",
"rustc_data_structures",
"rustc_error_messages",
"rustc_errors",
"rustc_feature",
"rustc_graphviz",
Expand Down
7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ exclude = [
"obj",
]

[profile.release.package.rustc_thread_pool]
# The rustc fork of Rayon has deadlock detection code which intermittently
# causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227)
# so we turn overflow checks off for now.
# FIXME: This workaround should be removed once #90227 is fixed.
overflow-checks = false

# These are very thin wrappers around executing lld with the right binary name.
# Basically nothing within them can go wrong without having been explicitly logged anyway.
# We ship these in every rustc tarball and even after compression they add up
Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_attr_ir/src/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,15 @@ language_item_table! {
Metadata, sym::metadata_type, metadata_type, Target::AssocTy, GenericRequirement::None;
DynMetadata, sym::dyn_metadata, dyn_metadata, Target::Struct, GenericRequirement::None;

NonNull, sym::non_null, non_null_trait, Target::Struct, GenericRequirement::Exact(1);

Freeze, sym::freeze, freeze_trait, Target::Trait, GenericRequirement::Exact(0);
UnsafeUnpin, sym::unsafe_unpin, unsafe_unpin_trait, Target::Trait, GenericRequirement::Exact(0);

FnPtrTrait, sym::fn_ptr_trait, fn_ptr_trait, Target::Trait, GenericRequirement::Exact(0);
FnPtrAddr, sym::fn_ptr_addr, fn_ptr_addr, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::None;
FnPtrAsPtr, sym::fn_ptr_as_ptr, fn_ptr_as_ptr, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::None;
FnPtrFromPtr, sym::fn_ptr_from_ptr, fn_ptr_from_ptr, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::None;
Code, sym::code, code, Target::ForeignTy, GenericRequirement::None;

Drop, sym::drop, drop_trait, Target::Trait, GenericRequirement::None;
Destruct, sym::destruct, destruct_trait, Target::Trait, GenericRequirement::None;
Expand Down Expand Up @@ -245,6 +249,7 @@ language_item_table! {
Fn, kw::Fn, fn_trait, Target::Trait, GenericRequirement::Exact(1);
FnMut, sym::fn_mut, fn_mut_trait, Target::Trait, GenericRequirement::Exact(1);
FnOnce, sym::fn_once, fn_once_trait, Target::Trait, GenericRequirement::Exact(1);
FnStatic, sym::fn_static, fn_static_trait, Target::Trait, GenericRequirement::Exact(1);

AsyncFn, sym::async_fn, async_fn_trait, Target::Trait, GenericRequirement::Exact(1);
AsyncFnMut, sym::async_fn_mut, async_fn_mut_trait, Target::Trait, GenericRequirement::Exact(1);
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,9 @@ impl SingleAttributeParser for LangParser {
return None;
};

// Only weak lang items may be applied to foreign items
if [Target::ForeignFn, Target::ForeignStatic, Target::ForeignTy, Target::ForeignMod]
.contains(&cx.target)
// Only weak lang items may be applied to foreign items,
// except for `ForeignTy` which can be a normal lang item.
if [Target::ForeignFn, Target::ForeignStatic, Target::ForeignMod].contains(&cx.target)
&& !lang_item.is_weak()
{
cx.emit_err(UnknownExternLangItem { span: cx.attr_span, lang_item: lang_item.name() });
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ impl<'diag, 'tcx> MirBorrowckCtxt<'_, 'diag, 'tcx> {
if !clauses.instantiate_identity(tcx).clauses.iter().any(|clause| {
clause.as_trait_clause().is_some_and(|tc| {
tc.self_ty().skip_binder().is_param(param.index)
&& tc.polarity() == ty::PredicatePolarity::Positive
&& tc.polarity() == ty::ClausePolarity::Positive
&& supertrait_def_ids(tcx, tc.def_id())
.flat_map(|trait_did| tcx.associated_items(trait_did).in_definition_order())
.any(|item| item.is_method())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
tcx.clauses_of(callee_def_id).instantiate(tcx, generic_args).clauses.iter().any(
|clause| {
clause.as_trait_clause().is_some_and(|trait_pred| {
trait_pred.polarity() == ty::PredicatePolarity::Positive
trait_pred.polarity() == ty::ClausePolarity::Positive
&& tcx.fn_trait_kind_from_def_id(trait_pred.def_id())
== Some(ty::ClosureKind::Fn)
&& trait_pred.self_ty().skip_binder().peel_refs()
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/type_check/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
category: ConstraintCategory<'tcx>,
) {
self.prove_clause(
ty::ClauseKind::Trait(ty::TraitPredicate {
ty::ClauseKind::Trait(ty::TraitClause {
trait_ref,
polarity: ty::PredicatePolarity::Positive,
polarity: ty::ClausePolarity::Positive,
}),
locations,
category,
Expand Down
45 changes: 45 additions & 0 deletions compiler/rustc_const_eval/src/const_eval/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,51 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
ecx.write_scalar(Scalar::from_target_usize(variants_num as u64, ecx), dest)?;
}

sym::variant_name => {
let base = ecx.read_type_id(&args[0])?;

let field_name = if let ty::Adt(def, _) = base.kind() {
let variant_idx = ecx.read_target_usize(&args[1])? as usize;
if variant_idx >= def.variants().len() {
throw_ub!(BoundsCheckFailed {
len: def.variants().len() as u64,
index: variant_idx as u64
});
}
let variant_idx = VariantIdx::from_usize(variant_idx);
def.variant(variant_idx).name
} else {
span_bug!(ecx.cur_span(), "expected enum type, got {base}")
};
let ptr = ecx.allocate_bytes_dedup(field_name.as_str().as_bytes())?;
ecx.write_immediate(
Immediate::ScalarPair(
Scalar::from_pointer(ptr, ecx),
Scalar::from_target_usize(field_name.as_str().len() as u64, ecx),
),
dest,
)?;
}

sym::variant_non_exhaustive => {
let base = ecx.read_type_id(&args[0])?;

let non_exhaustive = if let ty::Adt(def, _) = base.kind() {
let variant_idx = ecx.read_target_usize(&args[1])? as usize;
if variant_idx >= def.variants().len() {
throw_ub!(BoundsCheckFailed {
len: def.variants().len() as u64,
index: variant_idx as u64
});
}
let variant_idx = VariantIdx::from_usize(variant_idx);
def.variant(variant_idx).is_field_list_non_exhaustive()
} else {
span_bug!(ecx.cur_span(), "expected enum type, got {base}")
};
ecx.write_scalar(Scalar::from_bool(non_exhaustive), dest)?;
}

sym::field_offset => {
let frt_ty = instance.args.type_at(0);
ensure_monomorphic_enough(frt_ty)?;
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_const_eval/src/interpret/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
| ty::InstanceKind::Shim(ty::ShimKind::FnPtr(..))
| ty::InstanceKind::Shim(ty::ShimKind::DropGlue(..))
| ty::InstanceKind::Shim(ty::ShimKind::Clone(..))
| ty::InstanceKind::Shim(ty::ShimKind::FnPtrAddr(..))
| ty::InstanceKind::Shim(ty::ShimKind::FnPtrAsPtr(..))
| ty::InstanceKind::Shim(ty::ShimKind::FnPtrFromPtr(..))
| ty::InstanceKind::Shim(ty::ShimKind::ThreadLocal(..))
| ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlueCtor(..))
| ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlue(..))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ impl<O: ForestObligation> ObligationForest<O> {
/// A few post-processing that you might want to do make the forest easier to visualize:
///
/// * `sed 's,std::[a-z]*::,,g'` — Deletes the `std::<package>::` prefix of paths.
/// * `sed 's,"Binder(TraitPredicate(<\(.*\)>)) (\([^)]*\))","\1 (\2)",'` — Transforms
/// `Binder(TraitPredicate(<predicate>))` into just `<predicate>`.
/// * `sed 's,"Binder(TraitClause(<\(.*\)>)) (\([^)]*\))","\1 (\2)",'` — Transforms
/// `Binder(TraitClause(<predicate>))` into just `<predicate>`.
#[allow(dead_code)]
pub fn dump_graphviz<P: AsRef<Path>>(&self, dir: P, description: &str) {
static COUNTER: AtomicUsize = AtomicUsize::new(0);
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ declare_features! (
(unstable, fn_align, "1.53.0", Some(82232)),
/// Support delegating implementation of functions to other already implemented functions.
(incomplete, fn_delegation, "1.76.0", Some(118212)),
/// Traits for function pointers and items
(unstable, fn_static, "CURRENT_RUSTC_VERSION", Some(148768)),
/// Allows impls for the Freeze trait.
(internal, freeze_impls, "1.78.0", Some(121675)),
/// Frontmatter `---` blocks for use by external tools.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2726,7 +2726,7 @@ fn param_env_with_gat_bounds<'tcx>(
}
_ => clauses.push(
ty::Binder::bind_with_vars(
ty::ProjectionPredicate {
ty::ProjectionClause {
projection_term: ty::AliasTerm::new_from_def_id(
tcx,
trait_ty.def_id,
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 @@ -229,6 +229,8 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
| sym::ub_checks
| sym::va_copy
| sym::variant_count
| sym::variant_name
| sym::variant_non_exhaustive
| sym::wrapping_add
| sym::wrapping_mul
| sym::wrapping_sub
Expand Down Expand Up @@ -335,6 +337,8 @@ pub(crate) fn check_intrinsic_type(
sym::type_id_fields => (0, 0, vec![type_id_ty(), tcx.types.usize], tcx.types.usize),
sym::type_id_is_signed => (0, 0, vec![type_id_ty()], tcx.types.bool),
sym::type_id_variants => (0, 0, vec![type_id_ty()], tcx.types.usize),
sym::variant_name => (0, 0, vec![type_id_ty(), tcx.types.usize], Ty::new_static_str(tcx)),
sym::variant_non_exhaustive => (0, 0, vec![type_id_ty(), tcx.types.usize], tcx.types.bool),
sym::type_id_vtable => {
let dyn_metadata = tcx.require_lang_item(LangItem::DynMetadata, span);
let dyn_metadata_adt_ref = tcx.adt_def(dyn_metadata);
Expand Down
26 changes: 17 additions & 9 deletions compiler/rustc_hir_analysis/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ fn check_impl<'tcx>(
trait_ref,
);
let trait_pred =
ty::TraitPredicate { trait_ref, polarity: ty::PredicatePolarity::Positive };
ty::TraitClause { trait_ref, polarity: ty::ClausePolarity::Positive };
let mut obligations = traits::wf::trait_obligations(
wfcx.infcx,
wfcx.param_env,
Expand Down Expand Up @@ -1800,14 +1800,22 @@ fn check_method_receiver<'tcx>(
{
match receiver_validity_err {
ReceiverValidityError::DoesNotDeref if arbitrary_self_types_level.is_some() => {
let hint = match receiver_ty
.builtin_deref(false)
.unwrap_or(receiver_ty)
.ty_adt_def()
.and_then(|adt_def| tcx.get_diagnostic_name(adt_def.did()))
{
Some(sym::RcWeak | sym::ArcWeak) => Some(InvalidReceiverTyHint::Weak),
Some(sym::NonNull) => Some(InvalidReceiverTyHint::NonNull),
let adt_def =
receiver_ty.builtin_deref(false).unwrap_or(receiver_ty).ty_adt_def();

let hint = match adt_def {
Some(adt) => {
if tcx.is_lang_item(adt.did(), LangItem::NonNull) {
Some(InvalidReceiverTyHint::NonNull)
} else {
match tcx.get_diagnostic_name(adt.did()) {
Some(sym::RcWeak | sym::ArcWeak) => {
Some(InvalidReceiverTyHint::Weak)
}
_ => None,
}
}
}
_ => None,
};

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/coherence/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,9 @@ fn infringing_fields_error<'tcx>(
.or_default()
.push(error.obligation.cause.span);
}
if let ty::PredicateKind::Clause(ty::ClauseKind::Trait(ty::TraitPredicate {
if let ty::PredicateKind::Clause(ty::ClauseKind::Trait(ty::TraitClause {
trait_ref,
polarity: ty::PredicatePolarity::Positive,
polarity: ty::ClausePolarity::Positive,
..
})) = error_predicate.kind().skip_binder()
{
Expand Down
18 changes: 13 additions & 5 deletions compiler/rustc_hir_analysis/src/coherence/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,21 @@ fn emit_orphan_check_error<'tcx>(
});
}
ty::Adt(adt_def, _) => {
diag.subdiagnostic(diagnostics::OnlyCurrentTraitsAdt {
span,
name: tcx.def_path_str(adt_def.did()),
});
if is_foreign {
diag.subdiagnostic(diagnostics::OnlyCurrentTraitsForeign { span });
} else {
diag.subdiagnostic(diagnostics::OnlyCurrentTraitsAdt {
span,
name: tcx.def_path_str(adt_def.did()),
});
}
}
_ => {
diag.subdiagnostic(diagnostics::OnlyCurrentTraitsTy { span, ty });
if is_foreign {
diag.subdiagnostic(diagnostics::OnlyCurrentTraitsForeign { span });
} else {
diag.subdiagnostic(diagnostics::OnlyCurrentTraitsTy { span, ty });
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/collect/clauses_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ pub(super) fn implied_clauses_with_filter<'tcx>(
for &(clause, span) in implied_bounds {
debug!("superbound: {:?}", clause);
if let ty::ClauseKind::Trait(bound) = clause.kind().skip_binder()
&& bound.polarity == ty::PredicatePolarity::Positive
&& bound.polarity == ty::ClausePolarity::Positive
{
tcx.at(span).explicit_super_clauses_of(bound.def_id());
}
Expand All @@ -730,7 +730,7 @@ pub(super) fn implied_clauses_with_filter<'tcx>(
for &(clause, span) in implied_bounds {
debug!("superbound: {:?}", clause);
if let ty::ClauseKind::Trait(bound) = clause.kind().skip_binder()
&& bound.polarity == ty::PredicatePolarity::Positive
&& bound.polarity == ty::ClausePolarity::Positive
{
tcx.at(span).explicit_implied_clauses_of(bound.def_id());
}
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 @@ -547,7 +547,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
| PredicateFilter::SelfOnly
| PredicateFilter::SelfAndAssociatedTypeBounds => {
let bound = projection_term.map_bound(|projection_term| {
ty::ClauseKind::Projection(ty::ProjectionPredicate {
ty::ClauseKind::Projection(ty::ProjectionClause {
projection_term,
term,
})
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {

if let Some((principal_trait, ref spans)) = principal_trait {
let principal_trait = principal_trait.map_bound(|trait_pred| {
assert_eq!(trait_pred.polarity, ty::PredicatePolarity::Positive);
assert_eq!(trait_pred.polarity, ty::ClausePolarity::Positive);
trait_pred.trait_ref
});

Expand Down Expand Up @@ -350,7 +350,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
let principal_trait_ref = principal_trait.map(|(trait_pred, spans)| {
trait_pred.map_bound(|trait_pred| {
let trait_ref = trait_pred.trait_ref;
assert_eq!(trait_pred.polarity, ty::PredicatePolarity::Positive);
assert_eq!(trait_pred.polarity, ty::ClausePolarity::Positive);
assert_eq!(trait_ref.self_ty(), dummy_self);

let span = *spans.first().unwrap();
Expand Down Expand Up @@ -423,7 +423,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
let mut auto_trait_predicates: Vec<_> = auto_traits
.into_iter()
.map(|(trait_pred, _)| {
assert_eq!(trait_pred.polarity(), ty::PredicatePolarity::Positive);
assert_eq!(trait_pred.polarity(), ty::ClausePolarity::Positive);
assert_eq!(trait_pred.self_ty().skip_binder(), dummy_self);

ty::Binder::dummy(ty::ExistentialPredicate::AutoTrait(trait_pred.def_id()))
Expand Down Expand Up @@ -476,7 +476,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
/// `elaborated-predicates-unconstrained-late-bound.rs` for a test.
fn check_elaborated_projection_mentions_input_lifetimes(
&self,
pred: ty::PolyProjectionPredicate<'tcx>,
pred: ty::PolyProjectionClause<'tcx>,
span: Span,
supertrait_span: Span,
) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {

pub fn report_trait_object_addition_traits(
&self,
regular_traits: &Vec<(ty::PolyTraitPredicate<'tcx>, SmallVec<[Span; 1]>)>,
regular_traits: &Vec<(ty::PolyTraitClause<'tcx>, SmallVec<[Span; 1]>)>,
) -> ErrorGuaranteed {
// we use the last span to point at the traits themselves,
// and all other preceding spans are trait alias expansions.
Expand Down
Loading
Loading