Rename AssocItemContainer -> AssocContainer
This commit is contained in:
@@ -857,11 +857,11 @@ fn foo(&self) -> Self::T { String::new() }
|
||||
&& self.infcx.can_eq(param_env, assoc_ty, found)
|
||||
{
|
||||
let msg = match assoc_item.container {
|
||||
ty::AssocItemContainer::Trait => {
|
||||
ty::AssocContainer::Trait => {
|
||||
"associated type defaults can't be assumed inside the \
|
||||
trait defining them"
|
||||
}
|
||||
ty::AssocItemContainer::Impl => {
|
||||
ty::AssocContainer::Impl => {
|
||||
"associated type is `default` and may be overridden"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::{LangItem, lang_items};
|
||||
use rustc_middle::ty::{AssocItemContainer, GenericArgsRef, Instance, Ty, TyCtxt, TypingEnv};
|
||||
use rustc_middle::ty::{AssocContainer, GenericArgsRef, Instance, Ty, TyCtxt, TypingEnv};
|
||||
use rustc_span::{DUMMY_SP, DesugaringKind, Ident, Span, sym};
|
||||
use tracing::debug;
|
||||
|
||||
@@ -76,8 +76,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::Impl => tcx.trait_id_of_impl(container_id),
|
||||
AssocItemContainer::Trait => Some(container_id),
|
||||
AssocContainer::Impl => tcx.trait_id_of_impl(container_id),
|
||||
AssocContainer::Trait => Some(container_id),
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ pub(crate) fn assoc_def(
|
||||
if let Some(assoc_item) = ancestors.leaf_def(tcx, assoc_def_id) {
|
||||
// Ensure that the impl is constrained, otherwise projection may give us
|
||||
// bad unconstrained infer vars.
|
||||
if assoc_item.item.container == ty::AssocItemContainer::Impl
|
||||
if assoc_item.item.container == ty::AssocContainer::Impl
|
||||
&& let Some(impl_def_id) = assoc_item.item.container_id(tcx).as_local()
|
||||
{
|
||||
tcx.ensure_ok().enforce_impl_non_lifetime_params_are_constrained(impl_def_id)?;
|
||||
|
||||
Reference in New Issue
Block a user