Skip to content
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

Merged
merged 2 commits into from
Jul 23, 2019

Conversation

matklad
Copy link
Member

@matklad matklad commented Jul 22, 2019

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?

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 22, 2019
@Mark-Simulacrum
Copy link
Member

Did you check if cfg_attr(bootstrap, unstable(...)) would work instead of the current unstable attributes on the xid functions? I'd prefer to merge with that rather than without, or at least understand why it doesn't work to remove them in stage1+.

@matklad
Copy link
Member Author

matklad commented Jul 22, 2019

@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 cfg_attr(not(bootstrap)) which uses a different feature name (unicode_internals probably)?

@Mark-Simulacrum
Copy link
Member

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.
@matklad
Copy link
Member Author

matklad commented Jul 22, 2019

@Mark-Simulacrum should be good now I think

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 22, 2019

📌 Commit 27b703d has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 22, 2019
Co-Authored-By: Ralf Jung <post@ralfj.de>
@matklad
Copy link
Member Author

matklad commented Jul 23, 2019

bors r=Mark-Simulacrum

@matklad
Copy link
Member Author

matklad commented Jul 23, 2019

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Jul 23, 2019

📌 Commit 7e612c1 has been approved by Mark-Simulacrum

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 23, 2019
…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?
bors added a commit that referenced this pull request Jul 23, 2019
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
@bors bors merged commit 7e612c1 into rust-lang:master Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants