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

Deprecate the AsciiExt trait in favor of inherent methods #49109

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

SimonSapin
Copy link
Contributor

The trait and some of its methods are stable and will remain.
Some of the newer methods are unstable and can be removed later.

Fixes #39658

@@ -143,8 +142,6 @@ macro_rules! assert_all {
stringify!($what), b);
}
}
assert!($str.$what());
assert!($str.as_bytes().$what());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods are removed on str and [u8] in favor of explicit Iterator::all: #39658 (comment)

@SimonSapin SimonSapin added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 17, 2018
@Centril Centril added the relnotes Marks issues that should be documented in the release notes of the next release. label Mar 18, 2018
@SimonSapin SimonSapin added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 19, 2018
@alexcrichton
Copy link
Member

alexcrichton commented Mar 19, 2018

@bors: r+

@bors
Copy link
Contributor

bors commented Mar 19, 2018

📌 Commit dbc0c43 has been approved by alexcrichton

@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 Mar 19, 2018
@kennytm
Copy link
Member

kennytm commented Mar 21, 2018

@bors r-

Failed to build stage0-std on Windows.

error[E0624]: method `make_ascii_uppercase` is private
  --> libstd\sys\windows\process.rs:47:13
   |
47 |         buf.make_ascii_uppercase();
   |             ^^^^^^^^^^^^^^^^^^^^

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 21, 2018
The trait and some of its methods are stable and will remain.
Some of the newer methods are unstable and can be removed later.

Fixes rust-lang#39658
@SimonSapin
Copy link
Contributor Author

SimonSapin commented Mar 21, 2018

I had turned a trait impl into inherent methods, but forgot to make them public. Additional diff squashed into the commit just now:

diff --git a/src/libstd/sys_common/wtf8.rs b/src/libstd/sys_common/wtf8.rs
index 175107bdc4..78b2bb5fe6 100644
--- a/src/libstd/sys_common/wtf8.rs
+++ b/src/libstd/sys_common/wtf8.rs
@@ -871,21 +871,21 @@ impl Hash for Wtf8 {
 }
 
 impl Wtf8 {
-    fn is_ascii(&self) -> bool {
+    pub fn is_ascii(&self) -> bool {
         self.bytes.is_ascii()
     }
-    fn to_ascii_uppercase(&self) -> Wtf8Buf {
+    pub fn to_ascii_uppercase(&self) -> Wtf8Buf {
         Wtf8Buf { bytes: self.bytes.to_ascii_uppercase() }
     }
-    fn to_ascii_lowercase(&self) -> Wtf8Buf {
+    pub fn to_ascii_lowercase(&self) -> Wtf8Buf {
         Wtf8Buf { bytes: self.bytes.to_ascii_lowercase() }
     }
-    fn eq_ignore_ascii_case(&self, other: &Wtf8) -> bool {
+    pub fn eq_ignore_ascii_case(&self, other: &Wtf8) -> bool {
         self.bytes.eq_ignore_ascii_case(&other.bytes)
     }
 
-    fn make_ascii_uppercase(&mut self) { self.bytes.make_ascii_uppercase() }
-    fn make_ascii_lowercase(&mut self) { self.bytes.make_ascii_lowercase() }
+    pub fn make_ascii_uppercase(&mut self) { self.bytes.make_ascii_uppercase() }
+    pub fn make_ascii_lowercase(&mut self) { self.bytes.make_ascii_lowercase() }
 }
 
 #[cfg(test)]

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 21, 2018
@SimonSapin
Copy link
Contributor Author

@bors: r=alexcrichton

@bors
Copy link
Contributor

bors commented Mar 21, 2018

📌 Commit c09b9f9 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Mar 21, 2018

🌲 The tree is currently closed for pull requests below priority 30, this pull request will be tested once the tree is reopened

@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 Mar 21, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Mar 21, 2018
…excrichton

Deprecate the AsciiExt trait in favor of inherent methods

The trait and some of its methods are stable and will remain.
Some of the newer methods are unstable and can be removed later.

Fixes rust-lang#39658
kennytm added a commit to kennytm/rust that referenced this pull request Mar 22, 2018
…excrichton

Deprecate the AsciiExt trait in favor of inherent methods

The trait and some of its methods are stable and will remain.
Some of the newer methods are unstable and can be removed later.

Fixes rust-lang#39658
bors added a commit that referenced this pull request Mar 22, 2018
@alexcrichton alexcrichton merged commit c09b9f9 into rust-lang:master Mar 22, 2018
@SimonSapin SimonSapin deleted the deprecate-asciiext branch March 22, 2018 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants