Skip to content

Cannot insta review when using syntax + use<'_> #771

@ErickHdez96

Description

@ErickHdez96

What happened?

When using the syntax + use <> or + use<'_> in return impl position -> impl Display + use <'_> {, cargo insta review fails with the output error: expected identifier.

Reproduction steps

  1. Use the syntax + use <'_> in return impl position in any function, and add an insta assertion in the same file.
fn f(x: &i8) -> impl std::fmt::Display + use<'_> { x }

#[test]
fn it_does_not_work() {
    insta::assert_snapshot!(f(&8), @"");
}
  1. Run cargo test, it shows the correct diff.
  2. Run cargo insta review. The aforementioned error message is printed.

Insta Version

insta = "1.43.1"

rustc Version

rustc 1.86.0

What did you expect?

To be able to automagically update the snapshot

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions