Rollup merge of #139669 - nnethercote:overhaul-AssocItem, r=oli-obk
Overhaul `AssocItem` `AssocItem` has multiple fields that only make sense some of the time. E.g. the `name` can be empty if it's an RPITIT associated type. It's clearer and less error prone if these fields are moved to the relevant `kind` variants. r? ``@fee1-dead``
This commit is contained in:
commit
13cd5256ac
86 changed files with 609 additions and 546 deletions
|
@ -42,7 +42,7 @@ impl<'a, 'tcx> UndefinedTransmutesChecker<'a, 'tcx> {
|
|||
if self.tcx.is_const_fn(def_id)
|
||||
|| matches!(
|
||||
self.tcx.opt_associated_item(def_id),
|
||||
Some(AssocItem { kind: AssocKind::Const, .. })
|
||||
Some(AssocItem { kind: AssocKind::Const { .. }, .. })
|
||||
)
|
||||
{
|
||||
let fn_sig = function.ty(self.body, self.tcx).fn_sig(self.tcx).skip_binder();
|
||||
|
|
|
@ -66,7 +66,7 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceKind<'tcx>) -> Body<
|
|||
let call_mut = tcx
|
||||
.associated_items(fn_mut)
|
||||
.in_definition_order()
|
||||
.find(|it| it.kind == ty::AssocKind::Fn)
|
||||
.find(|it| it.is_fn())
|
||||
.unwrap()
|
||||
.def_id;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue