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

Projects
None yet
5 participants
@SimonSapin
Copy link
Contributor

SimonSapin commented Mar 17, 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 #39658

@SimonSapin SimonSapin force-pushed the SimonSapin:deprecate-asciiext branch from fa731b7 to dbc0c43 Mar 17, 2018

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

This comment has been minimized.

@SimonSapin

SimonSapin Mar 17, 2018

Author Contributor

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

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Mar 19, 2018

@bors: r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 19, 2018

📌 Commit dbc0c43 has been approved by alexcrichton

kennytm added a commit to kennytm/rust that referenced this pull request Mar 21, 2018

Rollup merge of rust-lang#49109 - SimonSapin:deprecate-asciiext, r=al…
…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 21, 2018

Auto merge of #49236 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests

- Successful merges: #48596, #48624, #48786, #48939, #49064, #49069, #49093, #49109, #49117, #49140, #49158, #49188, #49189, #49209, #49211, #49231, #49234
- Failed merges:
@kennytm

This comment has been minimized.

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();
   |             ^^^^^^^^^^^^^^^^^^^^
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 #39658
@SimonSapin

This comment has been minimized.

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)]

@SimonSapin SimonSapin force-pushed the SimonSapin:deprecate-asciiext branch from dbc0c43 to c09b9f9 Mar 21, 2018

@SimonSapin

This comment has been minimized.

Copy link
Contributor Author

SimonSapin commented Mar 21, 2018

@bors: r=alexcrichton

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 21, 2018

📌 Commit c09b9f9 has been approved by alexcrichton

@bors

This comment has been minimized.

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

kennytm added a commit to kennytm/rust that referenced this pull request Mar 21, 2018

Rollup merge of rust-lang#49109 - SimonSapin:deprecate-asciiext, r=al…
…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

Auto merge of #49236 - kennytm:rollup, r=kennytm
Rollup of 20 pull requests

- Successful merges: #48596, #48624, #48786, #48939, #49069, #49093, #49117, #49140, #49158, #49188, #49189, #49209, #49211, #49231, #49234, #49216, #49109, #49029, #49203, #48374
- Failed merges:

kennytm added a commit to kennytm/rust that referenced this pull request Mar 22, 2018

Rollup merge of rust-lang#49109 - SimonSapin:deprecate-asciiext, r=al…
…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

kennytm added a commit to kennytm/rust that referenced this pull request Mar 22, 2018

Rollup merge of rust-lang#49109 - SimonSapin:deprecate-asciiext, r=al…
…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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@SimonSapin SimonSapin deleted the SimonSapin:deprecate-asciiext branch Mar 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.