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 is_empty() for PathBuf (fixes #30259), Overide methods in iterator implementation for EscapeDefault (#24214), Add help note for E0514, Improve internal docs in librustc #30520

Closed
wants to merge 28 commits into from

Conversation

ticki
Copy link
Contributor

@ticki ticki commented Dec 22, 2015

See also #30259, #24214 and #30363.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

Ms2ger and others added 6 commits December 22, 2015 12:40
Lots of cruft to remove!
It's been awhile since we last updated jemalloc, and there's likely some bugs
that have been fixed since the last version we're using, so let's try to update
again.
Checks for a `10.` prefix on the subfolder

Signed-off-by: Peter Atashian <retep998@gmail.com>
All these definitions can now be written in Rust, so do so!
@@ -1 +1 @@
Subproject commit b6087e82ba1384c4af3adf2dc68e92316f0d4caf
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a git accident

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the submodules.

/// ```
#[unstable(feature = "path_extras", reason = "recently added", issue = "30259")]
pub fn is_empty(&self) -> bool {
if let Some(b) = self.inner.to_bytes() {
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to use os_str_as_u8_slice and check if it is empty. It's not fallible and it's simple.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bluss Check out the latest commit.

…ough the unicode validity checking on Windows
@ticki ticki force-pushed the master branch 2 times, most recently from 66cb5a6 to 7db394a Compare December 22, 2015 15:02
@ticki
Copy link
Contributor Author

ticki commented Dec 22, 2015

I refactored this patch a bit, by adding a is_empty() method to OsStr, and using it in Path, this gives a minor speed-up on Windows.

@bluss
Copy link
Member

bluss commented Dec 22, 2015

yep, travis failed to build jemalloc for some reason (so not related to this PR).

Can you put the information in the PR title into the PR message itself? Probably give the PR a shorter title too.

Adding OsStr::is_empty() seems logical, and Path::is_empty looks good too

@alexcrichton
Copy link
Member

It looks like there's quite a few changes going on here, namely:

  1. Lots of submodules updates -- can these all be reverted? It looks like they may be intentional?
  2. Specialization of EscapeDefault iterator methods -- updated, but no tests have been added. Perhaps this could be separated to a different PR?
  3. Various formatting/documentation here and there -- could this be separated to a different PR?
  4. Updating a compiler message -- can this also be separated?
  5. Addition of new APIs on Path and OsString -- can this PR be focused on these additions?

This is touching quite a few components which will be easier to review if split apart (as different reviewers are most applicable for the various areas here).

@ticki
Copy link
Contributor Author

ticki commented Dec 22, 2015

Lots of submodules updates -- can these all be reverted? It looks like they may be intentional?

Right, I'll downgrade them.

Specialization of EscapeDefault iterator methods -- updated, but no tests have been added. Perhaps this could be separated to a different PR?

Yeah, will add some tests.

Various formatting/documentation here and there -- could this be separated to a different PR?

Updating a compiler message -- can this also be separated?

Addition of new APIs on Path and OsString -- can this PR be focused on these additions?

Yeah, I'll fix the points above and then seperate them into multiple PRs. Sorry for that.

@ticki
Copy link
Contributor Author

ticki commented Dec 22, 2015

The submodules are now downgraded.

@bluss
Copy link
Member

bluss commented Dec 23, 2015

This is somewhere in the log.


failures:

---- path::Path::is_empty_0 stdout ----
    <anon>:8:19: 8:29 error: use of unstable library feature 'os_extras': recently added (see issue #30259)
<anon>:8     assert!(!path.is_empty());
                           ^~~~~~~~~~
<anon>:8:5: 8:31 note: in this expansion of assert! (defined in <std macros>)
<anon>:8:19: 8:29 help: add #![feature(os_extras)] to the crate attributes to enable
error: aborting due to previous error
thread 'path::Path::is_empty_0' panicked at 'Box<Any>', src/libsyntax/errors/mod.rs:269


failures:
    path::Path::is_empty_0

@ticki
Copy link
Contributor Author

ticki commented Dec 23, 2015

Yeah, I realized that I forgot to push the latest commit.

@nagisa
Copy link
Member

nagisa commented Dec 29, 2015

Still seems to be a mess?

@ticki
Copy link
Contributor Author

ticki commented Dec 29, 2015

Yes. I'll organize this better when I get time.

@ticki
Copy link
Contributor Author

ticki commented Dec 29, 2015

I've now parted this into multiple PRs. Will close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants