-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
calling functions with implicit-enabled target features is unsafe #19154
Comments
We can't depend on |
I could swear I checked that. Weird... Anyway, I'm not sure it will be a good idea to embed a list of target feature implications into rust-analyzer. I will try again later to make it compiler on stable (what will be the process for that? Create a compiler team MCP?) and if I'll fail, we'll see what to do. |
Probably ask t-compiler / MCP yes. The main reason I dropped it was that I only wanted to look briefly into it (because of the assembly things) but due to the pervasive use of symbols I kind of gave up as making all of those generic (or outright replace the symbol use with string literals) seemed like too much to propose. |
What I imagine is a |
That might be a way forward. We should open a zulip topic for a vibe check on this ideally though, you wanna do that or should I? |
Isn't that the job of the MCP? |
Well I guess? If you already have a concrete design in mind an MCP is probably the way to go then |
MCP submitted: rust-lang/compiler-team#839. |
rust-analyzer version: 0.4.2302-standalone
rustc version: rustc 1.86.0-nightly (ef148cd7e 2025-02-12)
code snippet to reproduce:
This should be caused by
rust-analyzer/crates/hir-ty/src/utils.rs
Lines 316 to 320 in 51389bd
It should calculate the set of all explicit-enabled and implicit-enabled target features of caller and calee, and then check if's a subset.
The "target feature to implicit-enabled target features" relationship is recorded in https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/target_features.rs. (How to get it in ra?)
The text was updated successfully, but these errors were encountered: