Skip to content

Commit 8d92c99

Browse files
committed
Fix test on WASM target by making ambiguity pruning more agressive
1 parent fd3804a commit 8d92c99

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
21032103
// It doesn't make sense to talk about applicable impls if there are more than a
21042104
// handful of them. If there are a lot of them, but only a few of them have no type
21052105
// params, we only show those, as they are more likely to be useful/intended.
2106-
if ambiguities.len() > 20 {
2106+
if ambiguities.len() > 5 {
21072107
let infcx = self.infcx;
21082108
if !ambiguities.iter().all(|option| match option {
21092109
DefId(did) => infcx.fresh_args_for_item(DUMMY_SP, *did).is_empty(),

tests/ui/traits/issue-77982.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect(
5050
- impl From<char> for u32;
5151
- impl From<u16> for u32;
5252
- impl From<u8> for u32;
53-
- impl<T> From<!> for T;
54-
- impl<T> From<T> for T;
5553
help: try using a fully qualified path to specify the expected types
5654
|
5755
LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(<u32 as Into<T>>::into(0u32))).collect();

0 commit comments

Comments
 (0)