about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-05-10 07:30:22 +0200
committerGitHub <noreply@github.com>2024-05-10 07:30:22 +0200
commitb8997e30f07385419473cc63404acd974a6eba4b (patch)
tree2f1ae75c7b72ca99ecb641407c13c96cc73eccfa
parent9b4ad016ec058f3de95a2492e2f3ef1c54f37714 (diff)
parentdbeae8da7882ea24ed2002deb3bfa06d50cad985 (diff)
downloadrust-b8997e30f07385419473cc63404acd974a6eba4b.tar.gz
rust-b8997e30f07385419473cc63404acd974a6eba4b.zip
Rollup merge of #124955 - nnethercote:next_ty_var, r=lcnr
Use fewer origins when creating type variables.

To reduce lots of repetitive boilerplate code. Details in the individual commit messages.

r? ``@lcnr``
-rw-r--r--clippy_utils/src/ty.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/clippy_utils/src/ty.rs b/clippy_utils/src/ty.rs
index 626d6a35307..00d3ed0626c 100644
--- a/clippy_utils/src/ty.rs
+++ b/clippy_utils/src/ty.rs
@@ -10,7 +10,6 @@ use rustc_hir as hir;
 use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
 use rustc_hir::def_id::DefId;
 use rustc_hir::{Expr, FnDecl, LangItem, TyKind, Unsafety};
-use rustc_infer::infer::type_variable::TypeVariableOrigin;
 use rustc_infer::infer::TyCtxtInferExt;
 use rustc_lint::LateContext;
 use rustc_middle::mir::interpret::Scalar;
@@ -276,11 +275,7 @@ pub fn implements_trait_with_env_from_iter<'tcx>(
         .into_iter()
         .map(|arg| {
             arg.into().unwrap_or_else(|| {
-                let orig = TypeVariableOrigin {
-                    span: DUMMY_SP,
-                    param_def_id: None,
-                };
-                infcx.next_ty_var(orig).into()
+                infcx.next_ty_var(DUMMY_SP).into()
             })
         })
         .collect::<Vec<_>>();