Rename Generics::params to Generics::own_params
This commit is contained in:
parent
18fe295d33
commit
9523b3fbf0
@ -382,7 +382,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing<'tcx> {
|
||||
cx,
|
||||
impl_ty,
|
||||
trait_id,
|
||||
&args[..cx.tcx.generics_of(trait_id).params.len() - 1],
|
||||
&args[..cx.tcx.generics_of(trait_id).own_params.len() - 1],
|
||||
)
|
||||
{
|
||||
false
|
||||
|
@ -480,7 +480,7 @@ fn param_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) ->
|
||||
// Vec<(param_def, needs_eq)>
|
||||
let mut params = tcx
|
||||
.generics_of(did)
|
||||
.params
|
||||
.own_params
|
||||
.iter()
|
||||
.map(|p| (p, matches!(p.kind, GenericParamDefKind::Type { .. })))
|
||||
.collect::<Vec<_>>();
|
||||
|
@ -148,7 +148,7 @@ fn try_resolve_type<'tcx>(
|
||||
match args.get(index - 1) {
|
||||
Some(GenericArg::Type(ty)) => Some(lower_ty(tcx, ty)),
|
||||
Some(_) => None,
|
||||
None => Some(tcx.type_of(generics.params[index].def_id).skip_binder()),
|
||||
None => Some(tcx.type_of(generics.own_params[index].def_id).skip_binder()),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ impl {self_ty_without_ref} {{
|
||||
&& let ImplItemKind::Fn(sig, _) = item.kind
|
||||
&& let FnRetTy::Return(ret) = sig.decl.output
|
||||
&& is_nameable_in_impl_trait(ret)
|
||||
&& cx.tcx.generics_of(item_did).params.is_empty()
|
||||
&& cx.tcx.generics_of(item_did).own_params.is_empty()
|
||||
&& sig.decl.implicit_self == expected_implicit_self
|
||||
&& sig.decl.inputs.len() == 1
|
||||
&& let Some(imp) = get_parent_as_impl(cx.tcx, item.hir_id())
|
||||
|
@ -76,7 +76,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeParamMismatch {
|
||||
};
|
||||
|
||||
// get the names of the generic parameters in the type
|
||||
let type_params = &cx.tcx.generics_of(defid).params;
|
||||
let type_params = &cx.tcx.generics_of(defid).own_params;
|
||||
let type_param_names: Vec<_> = type_params
|
||||
.iter()
|
||||
.filter_map(|p| match p.kind {
|
||||
|
@ -1070,11 +1070,11 @@ pub fn approx_ty_size<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> u64 {
|
||||
fn assert_generic_args_match<'tcx>(tcx: TyCtxt<'tcx>, did: DefId, args: &[GenericArg<'tcx>]) {
|
||||
let g = tcx.generics_of(did);
|
||||
let parent = g.parent.map(|did| tcx.generics_of(did));
|
||||
let count = g.parent_count + g.params.len();
|
||||
let count = g.parent_count + g.own_params.len();
|
||||
let params = parent
|
||||
.map_or([].as_slice(), |p| p.params.as_slice())
|
||||
.map_or([].as_slice(), |p| p.own_params.as_slice())
|
||||
.iter()
|
||||
.chain(&g.params)
|
||||
.chain(&g.own_params)
|
||||
.map(|x| &x.kind);
|
||||
|
||||
assert!(
|
||||
|
@ -176,7 +176,7 @@ fn qpath_certainty(cx: &LateContext<'_>, qpath: &QPath<'_>, resolves_to_type: bo
|
||||
.get(*lang_item)
|
||||
.map_or(Certainty::Uncertain, |def_id| {
|
||||
let generics = cx.tcx.generics_of(def_id);
|
||||
if generics.parent_count == 0 && generics.params.is_empty() {
|
||||
if generics.parent_count == 0 && generics.own_params.is_empty() {
|
||||
Certainty::Certain(if resolves_to_type { Some(def_id) } else { None })
|
||||
} else {
|
||||
Certainty::Uncertain
|
||||
@ -206,7 +206,7 @@ fn path_segment_certainty(
|
||||
// Checking `res_generics_def_id(..)` before calling `generics_of` avoids an ICE.
|
||||
if cx.tcx.res_generics_def_id(path_segment.res).is_some() {
|
||||
let generics = cx.tcx.generics_of(def_id);
|
||||
let count = generics.params.len() - usize::from(generics.host_effect_index.is_some());
|
||||
let count = generics.own_params.len() - usize::from(generics.host_effect_index.is_some());
|
||||
let lhs = if (parent_certainty.is_certain() || generics.parent_count == 0) && count == 0 {
|
||||
Certainty::Certain(None)
|
||||
} else {
|
||||
@ -299,7 +299,7 @@ fn type_is_inferable_from_arguments(cx: &LateContext<'_>, expr: &Expr<'_>) -> bo
|
||||
let fn_sig = cx.tcx.fn_sig(callee_def_id).skip_binder();
|
||||
|
||||
// Check that all type parameters appear in the functions input types.
|
||||
(0..(generics.parent_count + generics.params.len()) as u32).all(|index| {
|
||||
(0..(generics.parent_count + generics.own_params.len()) as u32).all(|index| {
|
||||
Some(index as usize) == generics.host_effect_index
|
||||
|| fn_sig
|
||||
.inputs()
|
||||
|
Loading…
x
Reference in New Issue
Block a user