-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Remove support for extern "rust-intrinsic"
blocks
#132735
Comments
I do wonder if there's some way we could have body-less free function items when users write |
Yeah that would be nice. But I guess the parser will reject body-less fn items (with ";" instead of a block) pretty early?
|
We actually reject them after expansion but before ast lowering. We could perhaps intercept these bodyless functions during ast lowering and fill them with a dummy body like |
Obviously only intercepting them if they're marked with |
That's way beyond my knowledge of those parts of the compiler. ;) So sure, sounds great. :D
I was actually going to suggest that a |
Oh, that works too. |
hmm do we have the notion of a builtin attribute macro...? |
@workingjubilee: Yes |
@rustbot claim |
Ok so basically I tried porting the first block of `error[E0308]: intrinsic has wrong type
and `` pub fn prefetch_write_data(data: *const T, locality: i32) { `` |
Yes, the intrinsics need to be marked as |
Change intrinsic declarations to new style Pr is for issue rust-lang#132735 This changes the first `extern "rust-intrinsic"` block to the new style. r? `@RalfJung`
Rollup merge of rust-lang#132907 - BLANKatGITHUB:intrinsic, r=saethlin Change intrinsic declarations to new style Pr is for issue rust-lang#132735 This changes the first `extern "rust-intrinsic"` block to the new style. r? `@RalfJung`
changes old intrinsic declaration to new declaration This pr is for issue rust-lang#132735 It changes old `extern "intrinsic"` code block with new declaration. There are other blocks that use old declaration but as the changes needed in single block is quite large I do them in parts
changes old intrinsic declaration to new declaration This pr is for issue rust-lang#132735 It changes old `extern "intrinsic"` code block with new declaration. There are other blocks that use old declaration but as the changes needed in single block is quite large I do them in parts
Rollup merge of rust-lang#133106 - BLANKatGITHUB:intrinsic, r=RalfJung changes old intrinsic declaration to new declaration This pr is for issue rust-lang#132735 It changes old `extern "intrinsic"` code block with new declaration. There are other blocks that use old declaration but as the changes needed in single block is quite large I do them in parts
Adds new intrinsic declaration This pr is for rust-lang#132735 removes removes `extern "intrinsic"` I think its the last block of this file and was kind of asking for advice how to handle other files as mentioned in the issue .
Rollup merge of rust-lang#134013 - BLANKatGITHUB:intrinsic, r=saethlin Adds new intrinsic declaration This pr is for rust-lang#132735 removes removes `extern "intrinsic"` I think its the last block of this file and was kind of asking for advice how to handle other files as mentioned in the issue .
#135031 implements that. |
The current status for this issue is that many but not all of the intrinsics in @BLANKatGITHUB do you plan to continue this, porting the remaining intrinsics in |
Sorry I am currently busy with my exams, but I will get to it as soon I get the time |
No worries. :) Focus on your exams first! |
Note that uses outside #[rustc_intrinsic]
unsafe fn unreachable();
|
Thanks for understanding I will be free again around 20 January, I will contact you then for more information. |
…lfJung Partial progress on rust-lang#132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase Part of rust-lang#132735: Replace `extern "rust-intrinsic"` with `#[rustc_intrinsic]` macro - Updated all instances of `extern "rust-intrinsic"` to use the `#[rustc_intrinsic]` macro. - Skipped `.md` files and test files to avoid unnecessary changes.
…lfJung Partial progress on rust-lang#132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase Part of rust-lang#132735: Replace `extern "rust-intrinsic"` with `#[rustc_intrinsic]` macro - Updated all instances of `extern "rust-intrinsic"` to use the `#[rustc_intrinsic]` macro. - Skipped `.md` files and test files to avoid unnecessary changes.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#133695 (Reexport likely/unlikely in std::hint) - rust-lang#135330 (Respect --sysroot for rustc -vV and -Cpasses=list) - rust-lang#135333 (Partial progress on rust-lang#132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase) - rust-lang#135741 (Recognise new IPv6 documentation range from IETF RFC 9637) - rust-lang#135770 (Update contributing docs for submodule/subtree changes) - rust-lang#135775 (Subtree update of `rust-analyzer`) - rust-lang#135776 (Subtree sync for rustc_codegen_cranelift) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#135333 - vayunbiyani:test-environment, r=RalfJung Partial progress on rust-lang#132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase Part of rust-lang#132735: Replace `extern "rust-intrinsic"` with `#[rustc_intrinsic]` macro - Updated all instances of `extern "rust-intrinsic"` to use the `#[rustc_intrinsic]` macro. - Skipped `.md` files and test files to avoid unnecessary changes.
Hi @BLANKatGITHUB , I hope your exams went well! While you were away, I made some progress on the issue. Let me know if there's anything else I can assist you with regarding its resolution. |
@vayunbiyani thanks I saw you change quite a few files in one pr , I am not quite sure if every file in compiler and all the tests are ported , I hope you can provide more info on that as I was busy with exams currently I am working on |
@RalfJung I don't see |
What do you mean you don't see it? It's right there. And yes the "even newer" style without a body cannot be used in the library. The issue documentation says that. |
@BLANKatGITHUB You’re correct, not every file has been updated. I’ve only ported some of the more obvious ones. I’m a bit uncertain about how to handle porting the test cases while adhering to best practices. What do you think about jumping on Zulip to figure this out? |
|
@vayunbiyani sure drop the link |
You can find me here as |
ports last few library files to new intrinsic style This pr ports the last 2 library files to new intrinsic style this pr is part of issue rust-lang#132735
Rollup merge of rust-lang#136005 - BLANKatGITHUB:library, r=RalfJung ports last few library files to new intrinsic style This pr ports the last 2 library files to new intrinsic style this pr is part of issue rust-lang#132735
We currently have two ways to declare symbols that are invoked as intrinsics. The old way:
The new way, which supports giving a "fallback body" that will be used for backends that do not have the intrinsic implemented:
The goal of this issue is to remove support for the old style, and consistently use the new style.
extern "rust-intrinsic"
intrinsics inlibrary
to the new style, updating them using the pattern described above. This can be a PR on its own.extern "rust-intrinsic"
insrc/tools/miri
andtests/ui/simd
to the new style. In fact, these can use the even newer style (which can't be used inlibrary
yet because of bootstraping):extern "rust-intrinsic"
blocks from the compiler -- in particular, remove this. AFAIK these are also the only extern blocks that support generics, so there might be more things that can be cleaned up here. (@compiler-errors or @oli-obk might know more about that.) A bunch of tests will still need updating; you can grep forrust-intrinsic
to find them all. They should all be ported to the new style, similar to the PR in step 2.The text was updated successfully, but these errors were encountered: