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

Commit 733cb1e64 breaks imports.preferNoStd #17840

Closed
traviscross opened this issue Aug 9, 2024 · 1 comment · Fixed by #17844
Closed

Commit 733cb1e64 breaks imports.preferNoStd #17840

traviscross opened this issue Aug 9, 2024 · 1 comment · Fixed by #17844
Labels
C-bug Category: bug

Comments

@traviscross
Copy link

traviscross commented Aug 9, 2024

Commit 733cb1e ("Optimize find_path for sysroot library search some more") breaks the rust-analyzer.imports.preferNoStd behavior.

That is, with that option set, and that commit applied, writing:

fn main() {
    let _ = Pin<tab><enter>
}

...produces:

use std::pin::Pin;

fn main() {
    let _ = Pin
}

...rather than:

use core::pin::Pin;

fn main() {
    let _ = Pin
}

The commit reverts cleanly, and reverting the commit on master fixes the behavior.

cc @Veykril

@traviscross traviscross added the C-bug Category: bug label Aug 9, 2024
traviscross added a commit to traviscross/rust-analyzer that referenced this issue Aug 9, 2024
This reverts commit 733cb1e.

Reverting this commit fixes the behavior of
[`rust-analyzer.imports.preferNoStd`][].

This fixes rust-lang#17840.

[`rust-analyzer.imports.preferNoStd`]: https://rust-analyzer.github.io/manual.html#rust-analyzer.imports.preferNoStd
traviscross added a commit to traviscross/rust-analyzer that referenced this issue Aug 9, 2024
This reverts commit 733cb1e.

Reverting this commit fixes the behavior of
[`rust-analyzer.imports.preferNoStd`][].

This fixes rust-lang#17840.

[`rust-analyzer.imports.preferNoStd`]: https://rust-analyzer.github.io/manual.html#rust-analyzer.imports.preferNoStd
@Veykril
Copy link
Member

Veykril commented Aug 10, 2024

Given #![no_std] in a crate makes it work it looks like the config is not being honored to me for some reason No there seems other issue at play

bors added a commit that referenced this issue Aug 10, 2024
fix: Fix find_path not respecting non-std preference config correctly

Fixes #17840
@bors bors closed this as completed in 0daeb5c Aug 10, 2024
lnicola pushed a commit to lnicola/rust that referenced this issue Aug 13, 2024
fix: Fix find_path not respecting non-std preference config correctly

Fixes rust-lang/rust-analyzer#17840
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
2 participants