summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev+love@gmail.com>2023-01-13 16:54:23 +0900
committerGitHub <noreply@github.com>2023-01-13 16:54:23 +0900
commitd4ad96cf6e4c8f9930695a5cd40064f45fcbf974 (patch)
treeb02a3893357c44b5af4c47efa28ae71a24570276 /compiler/rustc_trait_selection/src
parentf6f362c3326162049dc09502eb9b2a6f9c6d3c07 (diff)
parent8e27211dbc8b6fd334e33c767641522f1ebb785f (diff)
downloadrust-d4ad96cf6e4c8f9930695a5cd40064f45fcbf974.tar.gz
rust-d4ad96cf6e4c8f9930695a5cd40064f45fcbf974.zip
Rollup merge of #106754 - compiler-errors:ty-infer-method-is-confusing, r=lcnr
Rename `Ty::is_ty_infer` -> `Ty::is_ty_or_numeric_infer`

Makes sure people are aware that they may have a type variable *or* an int/float variable.

r? `@oli-obk` https://github.com/rust-lang/rust/pull/106322#issuecomment-1376913539 but I could instead implement your solution, let me know.

(This will conflict with #106322 for now, ignore that :smile:)
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
index 20bede22c34..0c7ffb056cc 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
@@ -2252,8 +2252,11 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                     Ok(None) => {
                         let ambiguities =
                             ambiguity::recompute_applicable_impls(self.infcx, &obligation);
-                        let has_non_region_infer =
-                            trait_ref.skip_binder().substs.types().any(|t| !t.is_ty_infer());
+                        let has_non_region_infer = trait_ref
+                            .skip_binder()
+                            .substs
+                            .types()
+                            .any(|t| !t.is_ty_or_numeric_infer());
                         // It doesn't make sense to talk about applicable impls if there are more
                         // than a handful of them.
                         if ambiguities.len() > 1 && ambiguities.len() < 10 && has_non_region_infer {