-
Notifications
You must be signed in to change notification settings - Fork 88
Restructure crate as core module #160
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
Conversation
17da0d6
to
314737b
Compare
One comment is that a downside of stdarch's, err, architecture, is that it has easily the worst IDE support of any part of the standard library (everything in core::arch::*:: shows up as unrecognized). I'm not sure whether or not we should keep that in mind, but it would be nice if core::simd avoided this, somehow. |
It looks like most of the changes are stylistic (since the imports got longer). One thing I don't understand--why make these changes at all? Can |
This code depends on core though, which would make it a circular dep, unless we do the work to make it That said, I'm not sure I've ever seen a non-macro |
Yeah, I suppose that makes sense. |
I looked, for a long while, at alternatives. |
314737b
to
ddf8dfa
Compare
This would break everything because then we would have to forge our own lang items, which would not match the ones in core. |
Also, is this due to the path or due to it being a submodule? Because this will be in-tree as a subtree for rust-lang/rust, not a submodule. |
rust-lang/rust-analyzer#3898 It looks like there is an open bug for this? But |
I suspect this means core::arch resolves, but things inside it still don't. Or something like that, since I can confirm it's still an issue. |
I believe it's because it's a EDIT: This might mean if it's located inside https://github.com/rust-lang/rust/tree/master/library/core it would be fine. |
I literally just tried pub use core::arch::x86_64::{
__m128, __m128i, _mm_add_ps, _mm_cvtps_epi32, _mm_load_ps, _mm_load_ss, _mm_max_ps, _mm_min_ps,
_mm_mul_ps, _mm_set1_ps, _mm_setzero_ps, _mm_shuffle_ps, _mm_store_si128,
}; in a fresh crate and it seems to resolve fine. |
Hm, maybe it's an issue with my setup and then it's not worth worrying about. I just wanted to avoid us having the same bad experience as core::arch due to developing out-of-tree. |
At the moment I am using an Extremely Basic "Visual Studio Code + rust-analyzer plugin with barely any modifiers" setup so, nothing terrible exotic is likely responsible for a difference here. I would be okay with nesting in theory but I am concerned that if we nest inside |
ddf8dfa
to
fc75818
Compare
Aligns module with rust-lang/library/core, creating an... unusual architecture that is easier to pull in as a module, as core itself can have no dependencies (as we haven't built core yet).
fc75818
to
3251c2c
Compare
Last month I had bad enough problems with RA and a crate using core::arch that I just turned off RA because it was totally useless to constantly see fake errors. Might have been fixed since then though. |
The patch in question was merged on Aug 20, so it is worth updating r-a and retrying. |
Aligns module with rust-lang/library/core, creating an... unusual
architecture that is easier to pull in as a module, as core itself can
have no dependencies (as we haven't built core yet).