diff options
| author | Michael Goulet <michael@errs.io> | 2024-05-09 20:56:44 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-05-09 20:58:46 -0400 |
| commit | 9523b3fbf0a6318772b582fc4f5fa69d4b7f6e94 (patch) | |
| tree | 5c3f8e3759d77894bbf045285de433da6be0ec4d /clippy_utils | |
| parent | 18fe295d33b64da533790b44f573c67bb4ba5245 (diff) | |
| download | rust-9523b3fbf0a6318772b582fc4f5fa69d4b7f6e94.tar.gz rust-9523b3fbf0a6318772b582fc4f5fa69d4b7f6e94.zip | |
Rename Generics::params to Generics::own_params
Diffstat (limited to 'clippy_utils')
| -rw-r--r-- | clippy_utils/src/ty.rs | 6 | ||||
| -rw-r--r-- | clippy_utils/src/ty/type_certainty/mod.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/clippy_utils/src/ty.rs b/clippy_utils/src/ty.rs index 23750ed4d1b..ad17c7cefff 100644 --- a/clippy_utils/src/ty.rs +++ b/clippy_utils/src/ty.rs @@ -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!( diff --git a/clippy_utils/src/ty/type_certainty/mod.rs b/clippy_utils/src/ty/type_certainty/mod.rs index 2241494b484..c2ff19931d5 100644 --- a/clippy_utils/src/ty/type_certainty/mod.rs +++ b/clippy_utils/src/ty/type_certainty/mod.rs @@ -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() |
