-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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. |
|
@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
Okay I think all the preparation is done now. :) There are fairly few such intrinsic blocks still left in the test suite; this is probably best done together with the actual removal. |
…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.
@BLANKatGITHUB do you still plan to work on the next step for this issue, or should the issue assignment be released? |
@RalfJung sorry I was a little busy with college , I just used grep on rust repo and found several files which uses old declaration , I am not sure where to start many are in tests and some in compiler |
As I said above, the next step is to actually remove the "rust-intrinsic" ABI string from the compiler. The remaining uses of the old style can be fixed as part of that PR, there's not so many of them. The PR description even points to the line of code you have to change for that. |
Ah, never mind, there's one bit of cleanup that has to happen before -- there's two uses in |
Seems like the file got renamed, grep for Also, rust-lang/stdarch#1722 has to be synced to the rustc repo before you can proceed. I am hoping to include another PR in that sync before I will try a sync myself, though someone else might also do a sync in the mean time. |
Blocked on #136831 |
@BLANKatGITHUB the stdarch update landed, so this is ready for the next step :) |
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 .
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
ports the compiler test cases to new rust_intrinsic format pr is part of rust-lang#132735
ports the compiler test cases to new rust_intrinsic format pr is part of rust-lang#132735
ports the compiler test cases to new rust_intrinsic format pr is part of rust-lang#132735
ports the compiler test cases to new rust_intrinsic format pr is part of rust-lang#132735
Rollup merge of rust-lang#138364 - BLANKatGITHUB:compiler, r=RalfJung ports the compiler test cases to new rust_intrinsic format pr is part of rust-lang#132735
We currently have two ways to declare symbols that are invoked as intrinsics. The old way:
The new way:
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. (Implemented in Change intrinsic declarations to new style #132907, changes old intrinsic declaration to new declaration #133106, ports last few library files to new intrinsic style #136005)extern "rust-intrinsic"
insrc/tools/miri
andtests/ui/simd
to the new style.This is implemented in Partial progress on #132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase #135333, Port ui/simd tests to use the intrinsic macro #136022.
extern "rust-intrinsic"
in this file (note that this is a separate repository)extern "rust-intrinsic"
blocks from the compiler -- in particular, remove this. 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.Abi::RustIntrinsic
entirely?The text was updated successfully, but these errors were encountered: