Skip to content

method-probing machinery can false-positive #46459

Open
@zackmdavis

Description

@zackmdavis

While working on improving method suggestions, it was discovered that the return value of probe_for_return_type—at least, a slightly altered version thereof that passes ProbeScope::AllTraits to probe_op rather than ProbeScope::TraitsInScope (as on master at issue-filing time)—could include methods that don't actually return the desired type. Most notably, this happened with core::convert::Into::into.

The root cause seems to be that when we try to resolve type variables, we might find that the return type of the trait method still needs to be resolved, and that unresolved type variable is considered to fulfill the required return type?? (I regret my difficulty to provide a better report than this.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions