Home
last modified time | relevance | path

Searched refs:AdtDef (Results 1 – 25 of 48) sorted by last modified time

12

/dports/lang/rust/rustc-1.58.1-src/src/doc/rustc-dev-guide/src/
H A Dgenerics.md36 - There would be an `AdtDef` (and corresponding `DefId`) for `MyStruct`.
41 - This is one `TyKind::Adt` containing the `AdtDef` of `MyStruct` with the `SubstsRef` above.
H A Dty.md237 Adt(&'tcx AdtDef, SubstsRef<'tcx>)
247 - The [`AdtDef`][adtdef] references the struct/enum/union but without the values for its type
255 [adtdef]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.AdtDef.html
258 **`AdtDef` and `DefId`**
266 `AdtDef` is more or less a wrapper around `DefId` with lots of useful helper methods. There is
267 essentially a one-to-one relationship between `AdtDef` and `DefId`. You can get the `AdtDef` for a
268 `DefId` with the [`tcx.adt_def(def_id)` query][adtdefq]. `AdtDef`s are all interned, as shown
311 ## Question: Why not substitute “inside” the `AdtDef`?
313 Recall that we represent a generic struct with `(AdtDef, substs)`. So why bother with this scheme?
317 less of a hassle. However, the `(AdtDef, substs)` scheme has some advantages over this.
[all …]
H A Dmemory.md48 defined and discussed in depth in the `AdtDef and DefId` section.
/dports/lang/rust/rustc-1.58.1-src/src/tools/clippy/clippy_lints/src/
H A Dcase_sensitive_file_extension_comparisons.rs57 ty::Adt(&ty::AdtDef { did, .. }, _) => { in check_case_sensitive_file_extension_comparison()
/dports/lang/rust/rustc-1.58.1-src/src/tools/clippy/clippy_utils/src/
H A Dty.rs13 use rustc_middle::ty::{self, AdtDef, IntTy, Ty, TyCtxt, TypeFoldable, UintTy};
48 pub fn contains_adt_constructor<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, adt: &'tcx AdtDef) -> bool { in contains_adt_constructor()
/dports/lang/rust/rustc-1.58.1-src/src/librustdoc/passes/
H A Dcollect_intra_doc_links.rs556 ty::Adt(&ty::AdtDef { did, .. }, _) | ty::Foreign(did) => { in def_id_to_res()
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_privacy/src/
H A Dlib.rs190 ty::Adt(&ty::AdtDef { did: def_id, .. }, ..) in visit_ty()
1039 def: &'tcx ty::AdtDef, // definition of the struct or enum in check_field() argument
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_typeck/src/check/
H A Dexpr.rs2092 def: &'tcx ty::AdtDef, in suggest_fields_on_recordish() argument
H A Dmod.rs799 fn bad_variant_count<'tcx>(tcx: TyCtxt<'tcx>, adt: &'tcx ty::AdtDef, sp: Span, did: DefId) { in bad_variant_count() argument
821 adt: &'tcx ty::AdtDef, in bad_non_zero_sized_fields() argument
H A Dplace_op.rs128 ty::Adt(ty::AdtDef { did, .. }, _) in try_index_step()
H A Dcheck.rs1187 pub(super) fn check_packed(tcx: TyCtxt<'_>, sp: Span, def: &ty::AdtDef) { in check_packed() argument
1287 pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, sp: Span, adt: &'tcx ty::AdtDef) { in check_transparent() argument
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_passes/src/
H A Ddead.rs315 fn mark_as_used_if_union(&mut self, adt: &ty::AdtDef, fields: &[hir::ExprField<'_>]) { in mark_as_used_if_union() argument
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_ty_utils/src/
H A Dneeds_drop.rs19 |adt_def: &ty::AdtDef| adt_def.destructor(tcx).map(|_| DtorType::Significant); in needs_drop_raw()
81 F: Fn(&ty::AdtDef, SubstsRef<'tcx>) -> NeedsDropResult<I>,
194 adt_has_dtor: impl Fn(&ty::AdtDef) -> Option<DtorType>, in drop_tys_helper()
219 let adt_components = move |adt_def: &ty::AdtDef, substs: SubstsRef<'tcx>| { in drop_tys_helper()
263 ) -> impl Fn(&ty::AdtDef) -> Option<DtorType> + 'tcx { in adt_consider_insignificant_dtor()
264 move |adt_def: &ty::AdtDef| { in adt_consider_insignificant_dtor()
288 |adt_def: &ty::AdtDef| adt_def.destructor(tcx).map(|_| DtorType::Significant); in adt_drop_tys()
H A Drepresentability.rs36 let mut shadow_seen: Vec<&'tcx ty::AdtDef> = Vec::new(); in ty_is_representable()
66 shadow_seen: &mut Vec<&'tcx ty::AdtDef>, in are_inner_types_recursive() argument
244 fn same_adt<'tcx>(ty: Ty<'tcx>, def: &'tcx ty::AdtDef) -> bool { in same_adt()
257 shadow_seen: &mut Vec<&'tcx ty::AdtDef>, in is_type_structurally_recursive() argument
289 shadow_seen: &mut Vec<&'tcx ty::AdtDef>, in is_type_structurally_recursive_inner() argument
H A Dty.rs13 adtdef: &ty::AdtDef, in sized_constraint_for_ty() argument
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_typeck/src/
H A Dcollect.rs1008 fn adt_def(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::AdtDef { in adt_def() argument
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_symbol_mangling/src/
H A Dv0.rs457 ty::Adt(&ty::AdtDef { did: def_id, .. }, substs) in print_type()
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_trait_selection/src/traits/
H A Dstructural_match.rs9 use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt, TypeFoldable, TypeVisitor};
15 Adt(&'tcx AdtDef),
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_codegen_ssa/src/debuginfo/
H A Dtype_names.rs21 use rustc_middle::ty::{self, AdtDef, ExistentialProjection, Ty, TyCtxt};
382 def: &AdtDef, in push_debuginfo_type_name() argument
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_lint/src/
H A Dbuiltin.rs2529 fn is_multi_variant(adt: &ty::AdtDef) -> bool { in check_expr()
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_middle/src/mir/
H A Dmod.rs14 use crate::ty::{AdtDef, InstanceDef, Region, ScalarInt, UserTypeAnnotationIndex};
2231 Adt(&'tcx AdtDef, VariantIdx, SubstsRef<'tcx>, Option<UserTypeAnnotationIndex>, Option<usize>),
2696 pub fn variant(self, adt_def: &'tcx AdtDef, variant_index: VariantIdx, field: Field) -> Self { in variant() argument
2747 adt_def: &AdtDef, in variant() argument
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_middle/src/ty/
H A Dadt.rs67 pub struct AdtDef { struct
78 impl PartialOrd for AdtDef { argument
86 impl Ord for AdtDef { implementation
87 fn cmp(&self, other: &AdtDef) -> Ordering { in cmp()
92 impl PartialEq for AdtDef { implementation
100 impl Eq for AdtDef {} implementation
102 impl Hash for AdtDef { implementation
105 (self as *const AdtDef).hash(s) in hash()
109 impl<S: Encoder> Encodable<S> for AdtDef { implementation
157 impl<'tcx> AdtDef { impl
[all …]
H A Dcontext.rs19 self, AdtDef, AdtKind, Binder, BindingMode, BoundVar, CanonicalPolyFnSig,
1081 ) -> &'tcx ty::AdtDef { in alloc_adt_def() argument
1082 self.arena.alloc(ty::AdtDef::new(self, did, kind, variants, repr)) in alloc_adt_def()
2248 pub fn mk_adt(self, def: &'tcx AdtDef, substs: SubstsRef<'tcx>) -> Ty<'tcx> { in mk_adt() argument
2474 adt_def: &'tcx AdtDef, in mk_place_downcast() argument
H A Dutil.rs346 pub fn destructor_constraints(self, def: &'tcx ty::AdtDef) -> Vec<ty::subst::GenericArg<'tcx>> { in destructor_constraints()
/dports/lang/rust/rustc-1.58.1-src/compiler/rustc_mir_build/src/build/matches/
H A Dtest.rs747 adt_def: &'tcx ty::AdtDef, in candidate_after_variant_switch() argument

12