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 😄)
This commit is contained in:
commit
d4ad96cf6e
5 changed files with 14 additions and 11 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue