Skip to content

Proc macros not expanding again in rust 1.78 #17231

Closed
@mkolopanis

Description

@mkolopanis

rust-analyzer version: rust-analyzer version: 0.4.1959-standalone

rustc version: rustc 1.78.0 (9b00956e5 2024-04-29)

editor or extension: VS-Code 1.89.1
dc96b837cf6bb4af9cd736aa3af08cf8279f7685
x64

relevant settings: None

Appears to be the same issue as #16331 again, as mentioned in #17178.

Have tried using the pre-release and stable releases of rust-analyzer in vscode which has no effect.
This seems to be the best MWE mentioned in #16331 and the proc macro expansion still fails with this MWE.
Occurs on a brand new project and even after removing target directory.

I haven't been able to find anything on this on the Forums, and the linked issues were asked to make a new one (e.g. this one).

image

Rust Analyzer Output
024-05-14T16:22:21.270686Z ERROR rust_analyzer::main_loop: FetchBuildDataError:
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/user/.vscode/extensions/rust-lang.rust-analyzer-0.4.1959-linux-x64/server/rust-analyzer /home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/clippy-driver /home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: Unrecognized option: 'keep-going'


error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/user/.vscode/extensions/rust-lang.rust-analyzer-0.4.1959-linux-x64/server/rust-analyzer /home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/clippy-driver /home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: Unrecognized option: 'keep-going'

code snippet to reproduce:

#![no_std]

#[cfg(feature = "std")]
extern crate std;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(thiserror::Error))]
enum Test {
    One,
    Two,
}
impl core::fmt::Display for Test {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{:?}", self)
    }
}
fn main() {}

Cargo.toml

[package]
 name    = "rust-test"
 version = "0.1.0"
 edition = "2021"

[features]
 std = [ "dep:thiserror" ]

[dependencies]
 thiserror = { version = "1.0.60", optional = true }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Broken WindowBugs / technical debt to be addressed immediatelyC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions