From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_hir_analysis/src/variance/terms.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'compiler/rustc_hir_analysis/src/variance/terms.rs') diff --git a/compiler/rustc_hir_analysis/src/variance/terms.rs b/compiler/rustc_hir_analysis/src/variance/terms.rs index 1f763011e..3b286bb9c 100644 --- a/compiler/rustc_hir_analysis/src/variance/terms.rs +++ b/compiler/rustc_hir_analysis/src/variance/terms.rs @@ -42,22 +42,22 @@ impl<'a> fmt::Debug for VarianceTerm<'a> { } } -// The first pass over the crate simply builds up the set of inferreds. +/// The first pass over the crate simply builds up the set of inferreds. pub struct TermsContext<'a, 'tcx> { pub tcx: TyCtxt<'tcx>, pub arena: &'a DroplessArena, - // For marker types, UnsafeCell, and other lang items where - // variance is hardcoded, records the item-id and the hardcoded - // variance. + /// For marker types, `UnsafeCell`, and other lang items where + /// variance is hardcoded, records the item-id and the hardcoded + /// variance. pub lang_items: Vec<(LocalDefId, Vec)>, - // Maps from the node id of an item to the first inferred index - // used for its type & region parameters. + /// Maps from the node id of an item to the first inferred index + /// used for its type & region parameters. pub inferred_starts: LocalDefIdMap, - // Maps from an InferredIndex to the term for that variable. + /// Maps from an InferredIndex to the term for that variable. pub inferred_terms: Vec>, } @@ -91,8 +91,8 @@ pub fn determine_parameters_to_be_inferred<'a, 'tcx>( let adt = tcx.adt_def(def_id); for variant in adt.variants() { - if let Some(ctor) = variant.ctor_def_id { - terms_cx.add_inferreds_for_item(ctor.expect_local()); + if let Some(ctor_def_id) = variant.ctor_def_id() { + terms_cx.add_inferreds_for_item(ctor_def_id.expect_local()); } } } -- cgit v1.2.3