-
Notifications
You must be signed in to change notification settings - Fork 12.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
#[allow_internal_unstable] does not allow unstable library features when applied on functions #69399
Comments
|
Ugh, that's an unprincipled hack, and the attribute is still not checked correctly. I had this example where it doesn't do anything without errors. I can now see how it's used in libcore, but it should be named |
Also, do we need that anymore? Given that we're starting to add more and more |
The point of this is that we don't want to stabilize |
cc @Centril @oli-obk for use of |
The fix for this is described in #69373 (comment). |
I would like to tackle this issue, but I'm not 100% sure how to go forward. If I understood correctly, I would just need to follow the instructions in the above fix. |
I believe that should indeed suffice to fix the issue, but I may have overlooked larger things |
I don't think I'll be able to fix this issue on my own, I'm afraid. I'm not familiar enough with the internal workings and the fix linked above cannot really be used like that anymore, if I understood the code correctly. |
rust/compiler/rustc_mir/src/transform/check_consts/validation.rs Lines 802 to 828 in 62bfcfd
So I guess we'll need to just remove rust/compiler/rustc_mir/src/transform/check_consts/validation.rs Lines 807 to 812 in 62bfcfd
|
I applied that change locally and it didn't fix the issue. I think the error lies elsewhere, because compiling the above code with Edit: rust/compiler/rustc_middle/src/middle/stability.rs Lines 409 to 428 in e1d7681
|
oh.. oof. This means it's part of
Yea, I don't think we should change anything here and keep requiring the feature on the entire crate. So the only change left from this issue that I think we should address is to rename the attribute on functions to |
My current understanding of what needs to be done to address the renaming:
(Note: If somebody more experienced than me should rather deal with this, please tell me. I'm really enjoying working on this so far, but I also understand if I'm too much of a burden with that many (simple) questions...) |
From my end it looks like you are approaching this in a well-organized manner, and not at all a burden!
I would make that function private and take a
Yes, both of these can be checked similarly to |
allow_internal_unstable is currently used to side-step feature gate and stability checks. While it was originally only meant to be used only on macros, its use was expanded to const functions. This commit prepares stricter checks for the usage of allow_internal_unstable (only on macros) and introduces the rustc_allow_const_fn_unstable attribute for usage on functions. See rust-lang#69399
The
#[allow_internal_unstable]
attribute can only enable compiler features. Library features cannot be enabled.Examples:
#![feature]
s.Rustc version =
1.43.0-nightly (2020-02-22 436494b8f8008b600d64)
The text was updated successfully, but these errors were encountered: