Skip to content

Assist/Quickfix for converting method call to function call syntax #13247

@jonas-schievink

Description

@jonas-schievink

It's not uncommon to accidentally write code like this:

fn main() {
    let b = Box::new(0);
    let ptr = b.into_raw();
}

But Box::into_raw is an associated function, not a method. It would be nice to detect this and offer an assist. A diagnostic + quickfix would also be possible (though maybe there's some use case in converting this, even if it is a method, in which case it should probably be a normal assist?)

Metadata

Metadata

Assignees

Labels

A-diagnosticsdiagnostics / error reportingC-featureCategory: feature requestS-actionableSomeone could pick this issue up and work on it right now

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions