Skip to content

&raw const/&raw mut is not syntax-highlighted in all files #19357

@RalfJung

Description

@RalfJung

When opening a file that is not in the current project (i.e. RA cannot do its full semantic analysis), syntax highlighting of &raw is broken:

Image

Note that raw is not in the same style as mut.
raw is not a keyword, but its role as a contextual keyword in these expressions is entirely syntactic so this does not seem to me like it should require full type information to be properly highlighted.

rust-analyzer version: rust-analyzer version: 0.3.2337-standalone (5e7dd31 2025-03-09) [/home/r/.vscode-oss/extensions/rust-lang.rust-analyzer-0.3.2337-linux-x64/server/rust-analyzer]

editor or extension: VSCodium, extension v0.3.2337

code snippet to reproduce:

fn main() {
    let x = &raw mut 5;
}

Metadata

Metadata

Assignees

Labels

A-highlighting(semantic) token highlightingC-bugCategory: bugE-easyE-has-instructionsIssue has some instructions and pointers to code to get started

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions