Skip to content

False positive in new_ret_no_self if self type carries lifetime annotation? #734

Closed
@llogiq

Description

@llogiq

Example (from lib_json):

impl<'a> CharIter<'a> {
    pub fn new<'b>( s: &'b str ) -> CharIter<'b> { .. }
    ..
}

While the warning can be fixed by changing it to pub fn new(s: &'a str) -> CharIter<'a> { .. }, I am unsure if the lifetime difference is really relevant here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions