Rollup merge of #93469 - compiler-errors:issue-93450, r=estebank
Skip pointing out ambiguous impls in alloc/std crates too in inference errors This generalizes the logic in `annotate_source_of_ambiguity` to skip printing ambiguity errors traits in `alloc` and `std` as well, not just `core`. While this does spot-fix the issue mentioned below, it would be nicer to generalize this logic, for example to detect when the trait predicate's `self_ty` has any numerical inference variables. Is it worthwhile to scrap this solution for one like that? Fixes #93450 r? `@estebank` feel free to reassign
This commit is contained in:
commit
c6bb219fc4
5 changed files with 18 additions and 44 deletions
|
@ -1954,7 +1954,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
|
|||
|
||||
if self.is_tainted_by_errors()
|
||||
&& crate_names.len() == 1
|
||||
&& crate_names[0] == "`core`"
|
||||
&& ["`core`", "`alloc`", "`std`"].contains(&crate_names[0].as_str())
|
||||
&& spans.len() == 0
|
||||
{
|
||||
// Avoid complaining about other inference issues for expressions like
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue