println! macro is unsafe
Same issue that has been reported a few times popped up again: https://github.com/rust-lang/rust-analyzer/issues/10022. I'm using 1.89.0-nightly (255aa2208 2025-06-19). This happen inside vscode on Ubuntu 24.04 if that makes a difference.
Likely https://github.com/rust-lang/rust/pull/140748 / https://github.com/rust-lang/rust-analyzer/issues/19929
Switched to yesterday's nightly and it works fine.
Switched to yesterday's nightly and it works fine.
I got the same error and have been unsuccessfully trying to understand the problem for legit 5 hours, just to see your issue. Life is tough
Is it a rustc issue though ? What should I roll-back ? Rust-analyzer ? Because I also tried multiple previous versions of it (actually, previous versions of the extension) and none worked, even when cargo cleaning and reloading the window/extensions
It's not a rustc issue, it's a rust-analyzer issue, but it only occurs when you're on a new nightly toolchain. So you can rollback to a nightly before https://github.com/rust-lang/rust/pull/140748. Alternatively, set "rust-analyzer.cargo.extraEnv": { "RUSTUP_TOOLCHAIN": "stable" }, which will cause r-a to analyze stable std instead.
I got the same error and have been unsuccessfully trying to understand the problem for legit 5 hours, just to see your issue. Life is tough
Is it a rustc issue though ? What should I roll-back ? Rust-analyzer ? Because I also tried multiple previous versions of it (actually, previous versions of the extension) and none worked, even when cargo cleaning and reloading the window/extensions
This is caused by internal changes within rustc that not yet implemented in rust-analyzer, so basically rust-analyzer issue. So, switching rust-analyzer versions won't work for now.
Switched to yesterday's nightly and it works fine.
I think what perry-blueberry meant with this comment is that they switched to yesterday(Of course, from the moment that they wrote the comment)'s nightly rustc without problematic change and it worked fine with it.
As #20056 has been merged, I think this would be fixed in next rust-analyzer releases, both nightly and stable. Though we still have some remaining homeworks in #20058, I'll finish it soon
I believe I'm hitting this on beta too.
@Veykril could it be that #20056 is not on beta?
Oh indeed, we need to backport that