Merge commit '37f4fbb929' into clippy-subtree-update

This commit is contained in:
Philipp Krones 2024-07-25 18:29:17 +02:00
parent 6d674685ae
commit 4e6851e50b
291 changed files with 4890 additions and 5205 deletions

View file

@ -74,7 +74,7 @@ impl<'tcx> LateLintPass<'tcx> for InterningDefinedSymbol {
}
for &module in &[&paths::KW_MODULE, &paths::SYM_MODULE] {
for def_id in def_path_def_ids(cx, module) {
for def_id in def_path_def_ids(cx.tcx, module) {
for item in cx.tcx.module_children(def_id) {
if let Res::Def(DefKind::Const, item_def_id) = item.res
&& let ty = cx.tcx.type_of(item_def_id).instantiate_identity()

View file

@ -55,7 +55,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidPaths {
// This is not a complete resolver for paths. It works on all the paths currently used in the paths
// module. That's all it does and all it needs to do.
pub fn check_path(cx: &LateContext<'_>, path: &[&str]) -> bool {
if !def_path_res(cx, path).is_empty() {
if !def_path_res(cx.tcx, path).is_empty() {
return true;
}

View file

@ -108,7 +108,7 @@ impl UnnecessaryDefPath {
// Extract the path to the matched type
&& let Some(segments) = path_to_matched_type(cx, item_arg)
&& let segments = segments.iter().map(|sym| &**sym).collect::<Vec<_>>()
&& let Some(def_id) = def_path_def_ids(cx, &segments[..]).next()
&& let Some(def_id) = def_path_def_ids(cx.tcx, &segments[..]).next()
{
// Check if the target item is a diagnostic item or LangItem.
#[rustfmt::skip]
@ -206,7 +206,7 @@ impl UnnecessaryDefPath {
fn check_array(&mut self, cx: &LateContext<'_>, elements: &[Expr<'_>], span: Span) {
let Some(path) = path_from_array(elements) else { return };
for def_id in def_path_def_ids(cx, &path.iter().map(AsRef::as_ref).collect::<Vec<_>>()) {
for def_id in def_path_def_ids(cx.tcx, &path.iter().map(AsRef::as_ref).collect::<Vec<_>>()) {
self.array_def_ids.insert((def_id, span));
}
}