Skip to content

Regression in useless_transmute due to rustup #5343

Open
@flip1995

Description

@flip1995

After rust-lang/rust#69189, the following check returns true for types, where only the lifetimes differ: &'a T == &'b T

let from_ty = cx.tables.expr_ty(&args[0]);
let to_ty = cx.tables.expr_ty(e);
match (&from_ty.kind, &to_ty.kind) {
_ if from_ty == to_ty => span_lint(

According to rust-lang/rust#69189 (comment), this probably needs to be fixed by checking the lifetimes of the types with MIR borrowck.

Originally posted by @flip1995 in #5333

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.I-false-positiveIssue: The lint was triggered on code it shouldn't haveT-middleType: Probably requires verifiying types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions