@@ -14,7 +14,7 @@ use rustc_span::def_id::DefId;
1414use rustc_span:: { Symbol , kw, sym} ;
1515
1616use crate :: PrintAttribute ;
17- use crate :: target:: { MethodKind , Target } ;
17+ use crate :: target:: { AssocCtxt , MethodKind , Target } ;
1818
1919/// All of the lang items, defined or not.
2020/// Defined lang items can come from the current crate or its dependencies.
@@ -161,8 +161,8 @@ language_item_table! {
161161 MetaSized , sym:: meta_sized, meta_sized_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
162162 PointeeSized , sym:: pointee_sized, pointee_sized_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
163163 Unsize , sym:: unsize, unsize_trait, Target :: Trait , GenericRequirement :: Minimum ( 1 ) ;
164- AlignOf , sym:: mem_align_const, align_const, Target :: AssocConst , GenericRequirement :: Exact ( 0 ) ;
165- SizeOf , sym:: mem_size_const, size_const, Target :: AssocConst , GenericRequirement :: Exact ( 0 ) ;
164+ AlignOf , sym:: mem_align_const, align_const, Target :: AssocConst ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 0 ) ;
165+ SizeOf , sym:: mem_size_const, size_const, Target :: AssocConst ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 0 ) ;
166166 OffsetOf , sym:: offset_of, offset_of, Target :: Fn , GenericRequirement :: Exact ( 1 ) ;
167167 /// Trait injected by `#[derive(PartialEq)]`, (i.e. "Partial EQ").
168168 StructuralPeq , sym:: structural_peq, structural_peq_trait, Target :: Trait , GenericRequirement :: None ;
@@ -174,10 +174,10 @@ language_item_table! {
174174 Sync , sym:: sync, sync_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
175175 DiscriminantKind , sym:: discriminant_kind, discriminant_kind_trait, Target :: Trait , GenericRequirement :: None ;
176176 /// The associated item of the `DiscriminantKind` trait.
177- Discriminant , sym:: discriminant_type, discriminant_type, Target :: AssocTy , GenericRequirement :: None ;
177+ Discriminant , sym:: discriminant_type, discriminant_type, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: None ;
178178
179179 PointeeTrait , sym:: pointee_trait, pointee_trait, Target :: Trait , GenericRequirement :: None ;
180- Metadata , sym:: metadata_type, metadata_type, Target :: AssocTy , GenericRequirement :: None ;
180+ Metadata , sym:: metadata_type, metadata_type, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: None ;
181181 DynMetadata , sym:: dyn_metadata, dyn_metadata, Target :: Struct , GenericRequirement :: None ;
182182
183183 NonNull , sym:: non_null, non_null_trait, Target :: Struct , GenericRequirement :: Exact ( 1 ) ;
@@ -241,9 +241,9 @@ language_item_table! {
241241 Deref , sym:: deref, deref_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
242242 DerefMut , sym:: deref_mut, deref_mut_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
243243 DerefPure , sym:: deref_pure, deref_pure_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
244- DerefTarget , sym:: deref_target, deref_target, Target :: AssocTy , GenericRequirement :: None ;
244+ DerefTarget , sym:: deref_target, deref_target, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: None ;
245245 Receiver , sym:: receiver, receiver_trait, Target :: Trait , GenericRequirement :: None ;
246- ReceiverTarget , sym:: receiver_target, receiver_target, Target :: AssocTy , GenericRequirement :: None ;
246+ ReceiverTarget , sym:: receiver_target, receiver_target, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: None ;
247247 LegacyReceiver , sym:: legacy_receiver, legacy_receiver_trait, Target :: Trait , GenericRequirement :: None ;
248248
249249 Fn , kw:: Fn , fn_trait, Target :: Trait , GenericRequirement :: Exact ( 1 ) ;
@@ -254,24 +254,24 @@ language_item_table! {
254254 AsyncFn , sym:: async_fn, async_fn_trait, Target :: Trait , GenericRequirement :: Exact ( 1 ) ;
255255 AsyncFnMut , sym:: async_fn_mut, async_fn_mut_trait, Target :: Trait , GenericRequirement :: Exact ( 1 ) ;
256256 AsyncFnOnce , sym:: async_fn_once, async_fn_once_trait, Target :: Trait , GenericRequirement :: Exact ( 1 ) ;
257- AsyncFnOnceOutput , sym:: async_fn_once_output, async_fn_once_output, Target :: AssocTy , GenericRequirement :: Exact ( 1 ) ;
258- CallOnceFuture , sym:: call_once_future, call_once_future, Target :: AssocTy , GenericRequirement :: Exact ( 1 ) ;
259- CallRefFuture , sym:: call_ref_future, call_ref_future, Target :: AssocTy , GenericRequirement :: Exact ( 2 ) ;
257+ AsyncFnOnceOutput , sym:: async_fn_once_output, async_fn_once_output, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 1 ) ;
258+ CallOnceFuture , sym:: call_once_future, call_once_future, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 1 ) ;
259+ CallRefFuture , sym:: call_ref_future, call_ref_future, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 2 ) ;
260260 AsyncFnKindHelper , sym:: async_fn_kind_helper, async_fn_kind_helper, Target :: Trait , GenericRequirement :: Exact ( 1 ) ;
261- AsyncFnKindUpvars , sym:: async_fn_kind_upvars, async_fn_kind_upvars, Target :: AssocTy , GenericRequirement :: Exact ( 5 ) ;
261+ AsyncFnKindUpvars , sym:: async_fn_kind_upvars, async_fn_kind_upvars, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 5 ) ;
262262
263- FnOnceOutput , sym:: fn_once_output, fn_once_output, Target :: AssocTy , GenericRequirement :: None ;
263+ FnOnceOutput , sym:: fn_once_output, fn_once_output, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: None ;
264264
265265 Iterator , sym:: iterator, iterator_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
266266 FusedIterator , sym:: fused_iterator, fused_iterator_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
267267 Future , sym:: future_trait, future_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
268- FutureOutput , sym:: future_output, future_output, Target :: AssocTy , GenericRequirement :: Exact ( 0 ) ;
268+ FutureOutput , sym:: future_output, future_output, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 0 ) ;
269269 AsyncIterator , sym:: async_iterator, async_iterator_trait, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
270270
271271 CoroutineState , sym:: coroutine_state, coroutine_state, Target :: Enum , GenericRequirement :: None ;
272272 Coroutine , sym:: coroutine, coroutine_trait, Target :: Trait , GenericRequirement :: Exact ( 1 ) ;
273- CoroutineReturn , sym:: coroutine_return, coroutine_return, Target :: AssocTy , GenericRequirement :: Exact ( 1 ) ;
274- CoroutineYield , sym:: coroutine_yield, coroutine_yield, Target :: AssocTy , GenericRequirement :: Exact ( 1 ) ;
273+ CoroutineReturn , sym:: coroutine_return, coroutine_return, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 1 ) ;
274+ CoroutineYield , sym:: coroutine_yield, coroutine_yield, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 1 ) ;
275275 CoroutineResume , sym:: coroutine_resume, coroutine_resume, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: None ;
276276
277277 Unpin , sym:: unpin, unpin_trait, Target :: Trait , GenericRequirement :: None ;
@@ -389,8 +389,8 @@ language_item_table! {
389389 PollPending , sym:: Pending , poll_pending_variant, Target :: Variant , GenericRequirement :: None ;
390390
391391 AsyncGenReady , sym:: AsyncGenReady , async_gen_ready, Target :: Method ( MethodKind :: Inherent ) , GenericRequirement :: Exact ( 1 ) ;
392- AsyncGenPending , sym:: AsyncGenPending , async_gen_pending, Target :: AssocConst , GenericRequirement :: Exact ( 1 ) ;
393- AsyncGenFinished , sym:: AsyncGenFinished , async_gen_finished, Target :: AssocConst , GenericRequirement :: Exact ( 1 ) ;
392+ AsyncGenPending , sym:: AsyncGenPending , async_gen_pending, Target :: AssocConst ( AssocCtxt :: Impl { of_trait : false } ) , GenericRequirement :: Exact ( 1 ) ;
393+ AsyncGenFinished , sym:: AsyncGenFinished , async_gen_finished, Target :: AssocConst ( AssocCtxt :: Impl { of_trait : false } ) , GenericRequirement :: Exact ( 1 ) ;
394394
395395 // FIXME(swatinem): the following lang items are used for async lowering and
396396 // should become obsolete eventually.
@@ -426,8 +426,8 @@ language_item_table! {
426426 Range , sym:: Range , range_struct, Target :: Struct , GenericRequirement :: None ;
427427 RangeToInclusive , sym:: RangeToInclusive , range_to_inclusive_struct, Target :: Struct , GenericRequirement :: None ;
428428 RangeTo , sym:: RangeTo , range_to_struct, Target :: Struct , GenericRequirement :: None ;
429- RangeMax , sym:: RangeMax , range_max, Target :: AssocConst , GenericRequirement :: Exact ( 0 ) ;
430- RangeMin , sym:: RangeMin , range_min, Target :: AssocConst , GenericRequirement :: Exact ( 0 ) ;
429+ RangeMax , sym:: RangeMax , range_max, Target :: AssocConst ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 0 ) ;
430+ RangeMin , sym:: RangeMin , range_min, Target :: AssocConst ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 0 ) ;
431431 RangeSub , sym:: RangeSub , range_sub, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: Exact ( 0 ) ;
432432
433433 // `new_range` types that are `Copy + IntoIterator`
@@ -458,9 +458,9 @@ language_item_table! {
458458 // Field representing types.
459459 FieldRepresentingType , sym:: field_representing_type, field_representing_type, Target :: Struct , GenericRequirement :: Exact ( 3 ) ;
460460 Field , sym:: field, field, Target :: Trait , GenericRequirement :: Exact ( 0 ) ;
461- FieldBase , sym:: field_base, field_base, Target :: AssocTy , GenericRequirement :: Exact ( 0 ) ;
462- FieldType , sym:: field_type, field_type, Target :: AssocTy , GenericRequirement :: Exact ( 0 ) ;
463- FieldOffset , sym:: field_offset, field_offset, Target :: AssocConst , GenericRequirement :: Exact ( 0 ) ;
461+ FieldBase , sym:: field_base, field_base, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 0 ) ;
462+ FieldType , sym:: field_type, field_type, Target :: AssocTy ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 0 ) ;
463+ FieldOffset , sym:: field_offset, field_offset, Target :: AssocConst ( AssocCtxt :: Trait ) , GenericRequirement :: Exact ( 0 ) ;
464464
465465 // Used to fallback `{float}` to `f32` when `f32: From<{float}>`
466466 From , sym:: From , from_trait, Target :: Trait , GenericRequirement :: Exact ( 1 ) ;
0 commit comments