diff options
| author | Michael Goulet <michael@errs.io> | 2024-07-06 18:24:51 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-07-07 11:10:32 -0400 |
| commit | a982471e07a87f1a379682d3b6241f61b4c9f135 (patch) | |
| tree | 2bd3723fb88524d30369194d89376ba09de24338 /compiler/rustc_middle/src | |
| parent | b2e30bdec480d38d050b7a8a3281cbd71fdcb075 (diff) | |
| download | rust-a982471e07a87f1a379682d3b6241f61b4c9f135.tar.gz rust-a982471e07a87f1a379682d3b6241f61b4c9f135.zip | |
Uplift trait_ref_is_knowable and friends
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/adt.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs index 8e221cdc603..88ee32eae95 100644 --- a/compiler/rustc_middle/src/ty/adt.rs +++ b/compiler/rustc_middle/src/ty/adt.rs @@ -229,6 +229,10 @@ impl<'tcx> rustc_type_ir::inherent::AdtDef<TyCtxt<'tcx>> for AdtDef<'tcx> { fn sized_constraint(self, tcx: TyCtxt<'tcx>) -> Option<ty::EarlyBinder<'tcx, Ty<'tcx>>> { self.sized_constraint(tcx) } + + fn is_fundamental(self) -> bool { + self.is_fundamental() + } } #[derive(Copy, Clone, Debug, Eq, PartialEq, HashStable, TyEncodable, TyDecodable)] diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index dca48069974..dab3d3dbae4 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -524,6 +524,10 @@ impl<'tcx> Interner for TyCtxt<'tcx> { self.is_object_safe(trait_def_id) } + fn trait_is_fundamental(self, def_id: DefId) -> bool { + self.trait_def(def_id).is_fundamental + } + fn trait_may_be_implemented_via_object(self, trait_def_id: DefId) -> bool { self.trait_def(trait_def_id).implement_via_object } @@ -635,6 +639,10 @@ bidirectional_lang_item_map! { } impl<'tcx> rustc_type_ir::inherent::DefId<TyCtxt<'tcx>> for DefId { + fn is_local(self) -> bool { + self.is_local() + } + fn as_local(self) -> Option<LocalDefId> { self.as_local() } |
