-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
add rustc_private as a proper language feature gate #62869
Conversation
Did you check if |
@Mark-Simulacrum sorry, I am afraid I don't fully understand what you are suggesting. Do you mean applying this patch? diff --git a/src/libcore/char/methods.rs b/src/libcore/char/methods.rs
index e843303380..6709b9c75b 100644
--- a/src/libcore/char/methods.rs
+++ b/src/libcore/char/methods.rs
@@ -553,9 +553,10 @@ impl char {
/// 'XID_Start' is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to `ID_Start` but modified for closure under `NFKx`.
- #[unstable(feature = "rustc_private",
- reason = "mainly needed for compiler internals",
- issue = "27812")]
+ #[cfg_attr(bootstrap,
+ unstable(feature = "rustc_private",
+ reason = "mainly needed for compiler internals",
+ issue = "27812"))]
#[inline]
pub fn is_xid_start(self) -> bool {
derived_property::XID_Start(self)
@@ -567,9 +568,10 @@ impl char {
/// 'XID_Continue' is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to 'ID_Continue' but modified for closure under NFKx.
- #[unstable(feature = "rustc_private",
- reason = "mainly needed for compiler internals",
- issue = "27812")]
+ #[cfg_attr(bootstrap,
+ unstable(feature = "rustc_private",
+ reason = "mainly needed for compiler internals",
+ issue = "27812"))]
#[inline]
pub fn is_xid_continue(self) -> bool {
derived_property::XID_Continue(self) I am testing this right now, but I am not sure how this'd work: if not bootstrapping, this will make these methods stable? Should I add an |
Oh, right, I sort of forgot that we do in fact want that feature gate (i.e., this is not a stabilization). Yeah, let's do not(bootstrap) with unicode_internals or some similar name. |
At the moment, `rustc_private` as a (library) feature exists by accident: `char::is_xid_start`, `char::is_xid_continue` methods in libcore define it.
@Mark-Simulacrum should be good now I think |
@bors r+ |
📌 Commit 27b703d has been approved by |
Co-Authored-By: Ralf Jung <[email protected]>
bors r=Mark-Simulacrum |
@bors r=Mark-Simulacrum |
📌 Commit 7e612c1 has been approved by |
…crum add rustc_private as a proper language feature gate At the moment, `rustc_private` as a (library) feature exists by accident: `char::is_xid_start`, `char::is_xid_continue` methods in libcore define it. cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F I don't know if this is at all reasonable, but at least tests seem to pass locally. That probably means that we can remove/rename to something more resonable the feature in libcore in the next release?
Rollup of 14 pull requests Successful merges: - #60951 (more specific errors in src/librustc/mir/interpret/error.rs) - #62523 (Delay bug to resolve HRTB ICE) - #62656 (explain how to search in slice without owned data) - #62791 (Handle more cases of typos misinterpreted as type ascription) - #62804 (rustc_typeck: improve diagnostics for _ const/static declarations) - #62808 (Revert "Disable stack probing for gnux32.") - #62817 (Tweak span for variant not found error) - #62842 (Add tests for issue-58887) - #62851 (move unescape module to rustc_lexer) - #62859 (Place::as_place_ref is now Place::as_ref) - #62869 (add rustc_private as a proper language feature gate) - #62880 (normalize use of backticks in compiler messages for librustc_allocator) - #62885 (Change "OSX" to "macOS") - #62889 (Update stage0.txt) Failed merges: r? @ghost
At the moment,
rustc_private
as a (library) feature exists byaccident:
char::is_xid_start
,char::is_xid_continue
methods inlibcore define it.
cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F
I don't know if this is at all reasonable, but at least tests seem to pass locally. That probably means that we can remove/rename to something more resonable the feature in libcore in the next release?