Skip to content

string_deref_patterns unsupported with rust-analyzer #17768

Open
@AlbertMarashi

Description

@AlbertMarashi

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
0.3.2053-standalone (fd74511f3 2024-07-28)

rustc version: (eg. output of rustc -V)
rustc 1.82.0-nightly (8e86c9567 2024-08-01)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)
VS Code v0.4.2058 (pre-release)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

code snippet to reproduce:

#![feature(string_deref_patterns)]
enum Foo {
    Bar(String),
    X,
}

fn foo(x: Foo) -> bool {
    match x {
        Foo::Bar("bar") => true, // expected String, found &str
        _ => false,
    }
}

Works with cargo check so just a rust-analyzer issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-patternpattern handling related thingsB-unstableunstable featureC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions