Rename Generics::params to Generics::own_params
This commit is contained in:
parent
8c7c151a7a
commit
1c19b6ad60
54 changed files with 177 additions and 169 deletions
|
@ -165,7 +165,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
));
|
||||
}
|
||||
|
||||
for param in generics.params.iter() {
|
||||
for param in generics.own_params.iter() {
|
||||
let value = match param.kind {
|
||||
GenericParamDefKind::Type { .. } | GenericParamDefKind::Const { .. } => {
|
||||
args[param.index as usize].to_string()
|
||||
|
@ -821,7 +821,7 @@ impl<'tcx> OnUnimplementedFormatString {
|
|||
()
|
||||
}
|
||||
// So is `{A}` if A is a type parameter
|
||||
s if generics.params.iter().any(|param| param.name == s) => (),
|
||||
s if generics.own_params.iter().any(|param| param.name == s) => (),
|
||||
s => {
|
||||
if self.is_diagnostic_namespace_variant {
|
||||
if let Some(item_def_id) = item_def_id.as_local() {
|
||||
|
@ -915,7 +915,7 @@ impl<'tcx> OnUnimplementedFormatString {
|
|||
let trait_str = tcx.def_path_str(trait_ref.def_id);
|
||||
let generics = tcx.generics_of(trait_ref.def_id);
|
||||
let generic_map = generics
|
||||
.params
|
||||
.own_params
|
||||
.iter()
|
||||
.filter_map(|param| {
|
||||
let value = match param.kind {
|
||||
|
|
|
@ -2799,7 +2799,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
// Check if this is an implicit bound, even in foreign crates.
|
||||
if tcx
|
||||
.generics_of(item_def_id)
|
||||
.params
|
||||
.own_params
|
||||
.iter()
|
||||
.any(|param| tcx.def_span(param.def_id) == span)
|
||||
{
|
||||
|
|
|
@ -397,7 +397,7 @@ pub fn object_safety_violations_for_assoc_item(
|
|||
// Associated types can only be object safe if they have `Self: Sized` bounds.
|
||||
ty::AssocKind::Type => {
|
||||
if !tcx.features().generic_associated_types_extended
|
||||
&& !tcx.generics_of(item.def_id).params.is_empty()
|
||||
&& !tcx.generics_of(item.def_id).own_params.is_empty()
|
||||
&& !item.is_impl_trait_in_trait()
|
||||
{
|
||||
vec![ObjectSafetyViolation::GAT(item.name, item.ident(tcx).span)]
|
||||
|
|
|
@ -606,7 +606,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
for assoc_type in assoc_types {
|
||||
let defs: &ty::Generics = tcx.generics_of(assoc_type);
|
||||
|
||||
if !defs.params.is_empty() && !tcx.features().generic_associated_types_extended {
|
||||
if !defs.own_params.is_empty() && !tcx.features().generic_associated_types_extended {
|
||||
tcx.dcx().span_delayed_bug(
|
||||
obligation.cause.span,
|
||||
"GATs in trait object shouldn't have been considered",
|
||||
|
|
|
@ -1777,7 +1777,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
// If this type is a GAT, and of the GAT args resolve to something new,
|
||||
// that means that we must have newly inferred something about the GAT.
|
||||
// We should give up in that case.
|
||||
if !generics.params.is_empty()
|
||||
if !generics.own_params.is_empty()
|
||||
&& obligation.predicate.args[generics.parent_count..].iter().any(|&p| {
|
||||
p.has_non_region_infer() && self.infcx.resolve_vars_if_possible(p) != p
|
||||
})
|
||||
|
@ -2441,7 +2441,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
|
|||
});
|
||||
|
||||
let tcx = self.tcx();
|
||||
let trait_ref = if tcx.generics_of(trait_def_id).params.len() == 1 {
|
||||
let trait_ref = if tcx.generics_of(trait_def_id).own_params.len() == 1 {
|
||||
ty::TraitRef::new(tcx, trait_def_id, [normalized_ty])
|
||||
} else {
|
||||
// If this is an ill-formed auto/built-in trait, then synthesize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue