Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-snake-case None match / {unknown} for non-basic types on latest rustc #19287

Open
MatthewSbar opened this issue Mar 5, 2025 · 5 comments
Labels
C-bug Category: bug

Comments

@MatthewSbar
Copy link

MatthewSbar commented Mar 5, 2025

I have the same symptoms as #19281 (Non-snake case None match, non-standard types show as {unknown}) and have run through the same troubleshooting steps (reinstalling rustup, add/remove rust-src, reinstalling VSCode extension, starting in a brand new project, cargo clean, etc.), however, I don't believe my issue is network/package related, I'm also on MacOs. If there's some type of workaround for this, it would be nice.

If I run
cd $(rustc --print sysroot)/lib/rustlib/src/rust/library && __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS=nightly cargo metadata

It prints a bunch of json, if I run cargo metadata in my project, it prints a bunch of json, I am not really sure what the purpose of cargo metadata is in all of this, but, it seems like it's doing whatever it's supposed to? Maybe if #19281 were fixed I'd see an error. 🤷

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rust-analyzer version: 0.3.2330-standalone (02862f5 2025-03-03)

rustc version: (eg. output of rustc -V)
rustc 1.85.0 (4d91de4e4 2025-02-17)

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)
Version: 1.97.2 (Universal)
Commit: e54c774e0add60467559eb0d1e229c6452cf8447
Date: 2025-02-12T23:20:35.343Z
Electron: 32.2.7
ElectronBuildId: 10982180
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin x64 24.3.0

Extension:
Installation
Identifier
rust-lang.rust-analyzer
Version
0.3.2330
Last Updated
2025-03-05, 00:03:20

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
I haven't changed anything to my knowledge

code snippet to reproduce:
Leaving this blank since there are a million issues where String doesn't have type hints in a hello world project

@MatthewSbar MatthewSbar added the C-bug Category: bug label Mar 5, 2025
@Veykril
Copy link
Member

Veykril commented Mar 5, 2025

What does rust-analyzer: Status show when you invoke that vscode command in an opened project (while having a given rust file open).

Any logs? What does the status bar item (bottom left) show on hover?

@TheGhoul21
Copy link

I have the same issue. When I run the rust-analyzer: Status command I see an empty log

@MatthewSbar
Copy link
Author

This is from my "real" project rather than a toy project, the issue appears in both cases

Workspaces:
Loaded 288 packages across 1 workspace.
Workspace root folders: [AbsPath("/Users/matthew.sbar/repos/RuneWords/server/runewords_server/Cargo.toml")]
Analysis:
32mb of files
4858 trees, 128 preserved
17934 trees, 512 preserved (macros)
0b of library index symbols (0)
100kb of module index symbols (969)
0b in total

Debug info:
146379 attribute query entries, 354362 total attributes (9mb for storing entries)
22792 ast id maps
215 block def maps

Crates for file 4358:
Crate: runewords_server(280)
    Root module file id: 4215
    Edition: 2021
    Version: 0.1.0
    Enabled cfgs: CfgOptions(["debug_assertions", "miri", "panic=unwind", "rust_analyzer", "target_abi=", "target_arch=x86_64", "target_endian=little", "target_env=", "target_family=unix", "target_feature=cmpxchg16b", "target_feature=fxsr", "target_feature=sse", "target_feature=sse2", "target_feature=sse3", "target_feature=sse4.1", "target_feature=ssse3", "target_has_atomic", "target_has_atomic=128", "target_has_atomic=16", "target_has_atomic=32", "target_has_atomic=64", "target_has_atomic=8", "target_has_atomic=ptr", "target_has_atomic_equal_alignment=128", "target_has_atomic_equal_alignment=16", "target_has_atomic_equal_alignment=32", "target_has_atomic_equal_alignment=64", "target_has_atomic_equal_alignment=8", "target_has_atomic_equal_alignment=ptr", "target_has_atomic_load_store", "target_has_atomic_load_store=128", "target_has_atomic_load_store=16", "target_has_atomic_load_store=32", "target_has_atomic_load_store=64", "target_has_atomic_load_store=8", "target_has_atomic_load_store=ptr", "target_os=macos", "target_pointer_width=64", "target_thread_local", "target_vendor=apple", "test", "true", "unix"])
    Potential cfgs: None
    Env: Env { entries: {"CARGO": "/Users/matthew.sbar/.cargo/bin/cargo", "CARGO_CRATE_NAME": "runewords_server", "CARGO_MANIFEST_DIR": "/Users/matthew.sbar/repos/RuneWords/server/runewords_server", "CARGO_PKG_AUTHORS": "", "CARGO_PKG_DESCRIPTION": "", "CARGO_PKG_HOMEPAGE": "", "CARGO_PKG_LICENSE": "", "CARGO_PKG_LICENSE_FILE": "", "CARGO_PKG_NAME": "runewords_server", "CARGO_PKG_README": "", "CARGO_PKG_REPOSITORY": "", "CARGO_PKG_RUST_VERSION": "", "CARGO_PKG_VERSION": "0.1.0", "CARGO_PKG_VERSION_MAJOR": "0", "CARGO_PKG_VERSION_MINOR": "1", "CARGO_PKG_VERSION_PATCH": "0", "CARGO_PKG_VERSION_PRE": ""} }
    Origin: Local { repo: None, name: Some("runewords_server") }
    Is a proc macro crate: false
    Proc macro cwd: Some(AbsPathBuf("/Users/matthew.sbar/repos/RuneWords/server/runewords_server"))
    Dependencies: serde=5, log=13, tokio=24, bytestring=46, serde_json=105, actix_web=136, actix_ws=137, awc=140, uuid=185, aws_config=195, aws_sdk_dynamodb=196, bimap=197, chrono=199, config=230, dashmap=232, dotenv=233, env_logger=243, fst=244, itertools=245, lazy_static=246, rand=250, rayon=254, serde_with=263, structopt=277, typed_arena=278
Version: 
0.3.2330-standalone (02862f5d52 2025-03-03)
... config here but that's super long

Status bar logs just has this, I am not sure what file it's referring to 🤷

2025-03-05T13:47:25.071905-06:00 ERROR Position LineCol { line: 29, col: 43 } column exceeds line length 2, clamping it

Interestingly I do not have this issue with Cursor, which I installed right after opening this report, reinstalling VSCode might fix it, but I'm not in a position to do that on this machine for a couple days. My VSCode workspace is trusted if there was any concern about that since that is one potential difference between VSCode and Cursor.

@ChayimFriedman2
Copy link
Contributor

Status bar logs just has this, I am not sure what file it's referring to 🤷

2025-03-05T13:47:25.071905-06:00 ERROR Position LineCol { line: 29, col: 43 } column exceeds line length 2, clamping it

That's not related, it's a known bug and it isn't related to sysroot.

@Veykril
Copy link
Member

Veykril commented Mar 7, 2025

@MatthewSbar judging from your status output std isnt loaded for you, I assume your toolchain version is 1.81 or below which we dropped support for (there should be a warning in VSCode for that)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

4 participants