Skip to content

Is exact count of other implementations useful in this error message? #102864

Open
@scottmcm

Description

@scottmcm

I got the following CI failure in #102862

---- [ui] src/test/ui/try-trait/bad-interconversion.rs stdout ----
diff of stderr:

16	             <f64 as From<i16>>
17	             <f64 as From<i32>>
18	             <f64 as From<i8>>
-	           and 67 others
+	           and 68 others
20	   = note: required for `Result<u64, u8>` to implement `FromResidual<Result<Infallible, i32>>`
21	
22	error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`

I don't know if this is a diagnostics request or a UI test normalization request, but getting UI test failures when adding a From implementation is kinda annoying (if admittedly easy enough to fix).

So I wonder how much value the exact number here is providing. I wonder if it might make sense to change the message to

and many others

if it's above some threshold.

I can't see any reason the exact count is useful to the programmer reading the error (at least when it's a large number), and it might save some work in error message generation to stop once it's found a bunch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-diagnosticsArea: Messages for errors, warnings, and lintsA-testsuiteArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions