Skip to content

Invalid suggestion to change <Trait>::.. to <<dyn Trait>>::..: #88508

Closed
@m-ou-se

Description

@m-ou-se

Split off from #88113

Example here: https://crater-reports.s3.amazonaws.com/pr-87190-2/try%23d8627d19850b63702b76089d7b055730e9ddca14/reg/extended-primitives-0.3.5/log.txt

use std::fmt;

#[derive(Debug)]
pub struct Foo;

impl fmt::Display for Foo {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        <fmt::Debug>::fmt(self, f)  // bare_trait_objects
    }
}

This suggests

<<dyn fmt::Debug>>::fmt(self, f)

which is not valid.

Metadata

Metadata

Assignees

Labels

A-edition-2021Area: The 2021 editionA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.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