std: introduce path normalize methods at top of std::path#142957
std: introduce path normalize methods at top of std::path#142957rust-bors[bot] merged 1 commit intorust-lang:mainfrom
std::path#142957Conversation
This comment has been minimized.
This comment has been minimized.
|
Given the discussion on the issue, I think it would make more sense to have an overview in the top-level |
|
@rustbot ready I added a section |
normalize_lexically docstd::path
|
Going to pass this one on because I'm not sure when I'll have time to get to it. r? libs |
| //! - [`PartialEq<Path>`], [`PartialOrd<Path>`], and [`Ord<Path>`] implementations | ||
| //! perform the same normalization for comparison | ||
| //! - [`Path::has_root`] and [`PathBuf::push`] also apply this normalization | ||
| //! |
There was a problem hiding this comment.
Since they all say they do the same normalization, it would probably be good to move that part outside of the list. Maybe roughly:
Several methods in this module perform basic path normalization by disregarding
repeated separators, non-leading `.` components, and trailing separators. These include:
- Methods for iteration, such as [`Path::components`] and [`Path::iter`]
- Methods for inspection, such as [`Path::has_root`]
- Comparisons using [`PartialEq`]` and [`PartialOrd`]
[`Path::join`] and [`PathBuf::push`] also disregard trailing slashes.I moved push and join out since I think they don't really interact with anything other than the trailing separator?
There was a problem hiding this comment.
Ord is missing?
- Comparisons using [`PartialEq`], [`PartialOrd`], and [`Ord`]
I revise the doc. Sorry for late response. :)
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| //! - [`PartialEq<Path>`], [`PartialOrd<Path>`], and [`Ord<Path>`] implementations | ||
| //! perform the same normalization for comparison | ||
| //! - [`Path::has_root`] and [`PathBuf::push`] also apply this normalization | ||
| //! |
There was a problem hiding this comment.
Ord is missing?
- Comparisons using [`PartialEq`], [`PartialOrd`], and [`Ord`]
I revise the doc. Sorry for late response. :)
|
@bors r+ rollup |
std: introduce path normalize methods at top of `std::path` Closes rust-lang#142931 Mention other methods that call `conponents` and `canonicalize` that fully normalize path. And fix two typo. r? libs
std: introduce path normalize methods at top of `std::path` Closes rust-lang#142931 Mention other methods that call `conponents` and `canonicalize` that fully normalize path. And fix two typo. r? libs
std: introduce path normalize methods at top of `std::path` Closes rust-lang#142931 Mention other methods that call `conponents` and `canonicalize` that fully normalize path. And fix two typo. r? libs
std: introduce path normalize methods at top of `std::path` Closes rust-lang#142931 Mention other methods that call `conponents` and `canonicalize` that fully normalize path. And fix two typo. r? libs
std: introduce path normalize methods at top of `std::path` Closes rust-lang#142931 Mention other methods that call `conponents` and `canonicalize` that fully normalize path. And fix two typo. r? libs
Rollup of 12 pull requests Successful merges: - #152388 (`rust-analyzer` subtree update) - #151613 (Align `ArrayWindows` trait impls with `Windows`) - #152134 (Set crt_static_allow_dylibs to true for Emscripten target) - #152166 (cleanup some more things in `proc_macro::bridge`) - #152236 (compiletest: `-Zunstable-options` for json targets) - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented) - #142957 (std: introduce path normalize methods at top of `std::path`) - #145504 (Add some conversion trait impls) - #152131 (Port rustc_no_implicit_bounds attribute to parser.) - #152315 (fix: rhs_span to rhs_span_new) - #152327 (Check stalled coroutine obligations eagerly) - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
Rollup of 12 pull requests Successful merges: - #152388 (`rust-analyzer` subtree update) - #151613 (Align `ArrayWindows` trait impls with `Windows`) - #152134 (Set crt_static_allow_dylibs to true for Emscripten target) - #152166 (cleanup some more things in `proc_macro::bridge`) - #152236 (compiletest: `-Zunstable-options` for json targets) - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented) - #142957 (std: introduce path normalize methods at top of `std::path`) - #145504 (Add some conversion trait impls) - #152131 (Port rustc_no_implicit_bounds attribute to parser.) - #152315 (fix: rhs_span to rhs_span_new) - #152327 (Check stalled coroutine obligations eagerly) - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
Rollup of 12 pull requests Successful merges: - #152388 (`rust-analyzer` subtree update) - #151613 (Align `ArrayWindows` trait impls with `Windows`) - #152134 (Set crt_static_allow_dylibs to true for Emscripten target) - #152166 (cleanup some more things in `proc_macro::bridge`) - #152236 (compiletest: `-Zunstable-options` for json targets) - #152287 (Fix an ICE in the vtable iteration for a trait reference in const eval when a supertrait not implemented) - #142957 (std: introduce path normalize methods at top of `std::path`) - #145504 (Add some conversion trait impls) - #152131 (Port rustc_no_implicit_bounds attribute to parser.) - #152315 (fix: rhs_span to rhs_span_new) - #152327 (Check stalled coroutine obligations eagerly) - #152377 (Rename the query system's `JobOwner` to `ActiveJobGuard`, and include `key_hash`)
Closes #142931
Mention other methods that call
conponentsandcanonicalizethat fully normalize path. And fix two typo.r? libs