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

Incorrect analysis of std::ffi::CString in rust-analyzer v0.3.1940 #17169

Closed
Aobanana-chan opened this issue May 1, 2024 · 2 comments · Fixed by #17172
Closed

Incorrect analysis of std::ffi::CString in rust-analyzer v0.3.1940 #17169

Aobanana-chan opened this issue May 1, 2024 · 2 comments · Fixed by #17172
Assignees
Labels
A-nameres name, path and module resolution Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug

Comments

@Aobanana-chan
Copy link

rust-analyzer version: v0.3.1940

rustc version: 1.77.1

editor or extension: VSCode

code snippet to reproduce:

use std::ffi::CString;

fn main() {
    let _s = CString::new("test");
}

When I create a new instance of std::ffi::CString, the variable type analysis incorrectly shows "unknown".
image

This problem is resolved when I revert to version v0.3.1932 of rust-analyzer.
image

@Aobanana-chan Aobanana-chan added the C-bug Category: bug label May 1, 2024
@lnicola
Copy link
Member

lnicola commented May 1, 2024

Caused by #17151.

image

@lnicola lnicola added A-nameres name, path and module resolution Broken Window Bugs / technical debt to be addressed immediately labels May 1, 2024
@Veykril Veykril self-assigned this May 1, 2024
@prajwalch

This comment was marked as off-topic.

bors added a commit that referenced this issue May 2, 2024
fix: Correctly handle `no_core`/`no_std` for preludes

Fixes #17169, my previous change missed the fact that the sysroot itself depends on its own crates explicitly
@bors bors closed this as completed in 1fb8364 May 2, 2024
lnicola pushed a commit to lnicola/rust that referenced this issue May 19, 2024
fix: Correctly handle `no_core`/`no_std` for preludes

Fixes rust-lang/rust-analyzer#17169, my previous change missed the fact that the sysroot itself depends on its own crates explicitly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-nameres name, path and module resolution Broken Window Bugs / technical debt to be addressed immediately C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants