Skip to content

Suggest fix for borrowed_box return value #6728

@camsteffen

Description

@camsteffen

It would be nice if borrowed_box suggested a fix for the returned value in addition to the function signature.

Example from #6723:

pub trait Inner{}
pub struct Wrapper(Box<dyn Inner>);

pub unsafe fn get_inner(wrapper: *mut Wrapper) -> &'static Box<dyn Inner> {
    &(*wrapper).0
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-suggestionLint: Improving, adding or fixing lint suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions