diff options
| author | Michael Goulet <michael@errs.io> | 2024-11-03 21:47:56 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-11-04 04:45:52 +0000 |
| commit | be4b0261c2d1beb2676bab585556b8893d1cee1a (patch) | |
| tree | 412544ad28a0e8efe90d8af3ca01be24053ebe25 /compiler/rustc_middle/src | |
| parent | 8e6af16192b754f86defbad2bdb76940cb15c901 (diff) | |
| download | rust-be4b0261c2d1beb2676bab585556b8893d1cee1a.tar.gz rust-be4b0261c2d1beb2676bab585556b8893d1cee1a.zip | |
ty::KContainer -> ty::AssocItemContainer::K
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/assoc.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/instance.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/util/call_kind.rs | 4 |
4 files changed, 10 insertions, 12 deletions
diff --git a/compiler/rustc_middle/src/ty/assoc.rs b/compiler/rustc_middle/src/ty/assoc.rs index 3137fe9bd1d..62157d9bfe2 100644 --- a/compiler/rustc_middle/src/ty/assoc.rs +++ b/compiler/rustc_middle/src/ty/assoc.rs @@ -10,8 +10,8 @@ use crate::ty; #[derive(Clone, Copy, PartialEq, Eq, Debug, HashStable, Hash, Encodable, Decodable)] pub enum AssocItemContainer { - TraitContainer, - ImplContainer, + Trait, + Impl, } /// Information about an associated item @@ -63,16 +63,16 @@ impl AssocItem { #[inline] pub fn trait_container(&self, tcx: TyCtxt<'_>) -> Option<DefId> { match self.container { - AssocItemContainer::ImplContainer => None, - AssocItemContainer::TraitContainer => Some(tcx.parent(self.def_id)), + AssocItemContainer::Impl => None, + AssocItemContainer::Trait => Some(tcx.parent(self.def_id)), } } #[inline] pub fn impl_container(&self, tcx: TyCtxt<'_>) -> Option<DefId> { match self.container { - AssocItemContainer::ImplContainer => Some(tcx.parent(self.def_id)), - AssocItemContainer::TraitContainer => None, + AssocItemContainer::Impl => Some(tcx.parent(self.def_id)), + AssocItemContainer::Trait => None, } } diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs index e237d382900..7ee13bc1725 100644 --- a/compiler/rustc_middle/src/ty/instance.rs +++ b/compiler/rustc_middle/src/ty/instance.rs @@ -690,7 +690,7 @@ impl<'tcx> Instance<'tcx> { && !matches!( tcx.opt_associated_item(def), Some(ty::AssocItem { - container: ty::AssocItemContainer::TraitContainer, + container: ty::AssocItemContainer::Trait, .. }) ) diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 6d7ed56263b..df47ac2099a 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -55,9 +55,7 @@ use tracing::{debug, instrument}; pub use vtable::*; use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir}; -pub use self::AssocItemContainer::*; pub use self::BorrowKind::*; -pub use self::IntVarValue::*; pub use self::closure::{ BorrowKind, CAPTURE_STRUCT_LOCAL, CaptureInfo, CapturedPlace, ClosureTypeInfo, MinCaptureInformationMap, MinCaptureList, RootVariableMinCaptureList, UpvarCapture, UpvarId, @@ -2074,7 +2072,7 @@ impl<'tcx> TyCtxt<'tcx> { let Some(item) = self.opt_associated_item(def_id) else { return false; }; - if item.container != ty::AssocItemContainer::ImplContainer { + if item.container != ty::AssocItemContainer::Impl { return false; } diff --git a/compiler/rustc_middle/src/util/call_kind.rs b/compiler/rustc_middle/src/util/call_kind.rs index fe30cbfae4e..ed27a880562 100644 --- a/compiler/rustc_middle/src/util/call_kind.rs +++ b/compiler/rustc_middle/src/util/call_kind.rs @@ -72,8 +72,8 @@ pub fn call_kind<'tcx>( let parent = tcx.opt_associated_item(method_did).and_then(|assoc| { let container_id = assoc.container_id(tcx); match assoc.container { - AssocItemContainer::ImplContainer => tcx.trait_id_of_impl(container_id), - AssocItemContainer::TraitContainer => Some(container_id), + AssocItemContainer::Impl => tcx.trait_id_of_impl(container_id), + AssocItemContainer::Trait => Some(container_id), } }); |
