diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-23 15:07:33 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-23 15:07:33 -0700 |
| commit | e98d4d9589974c9cf0f12266fa53fb690a28cd99 (patch) | |
| tree | 46713139543c82eb7822573c320cbe26e6f4c69d /src/libstd/path.rs | |
| parent | 67e516c5c2ddd0dbed6b07ccca6b5bdd4ad10b36 (diff) | |
| parent | 9ec9bc68fb310aac29e984d26cc37952de328f1e (diff) | |
| download | rust-e98d4d9589974c9cf0f12266fa53fb690a28cd99.tar.gz rust-e98d4d9589974c9cf0f12266fa53fb690a28cd99.zip | |
rollup merge of #23283: brson/rpathfix
Fix regression in -C rpath that causes failures with symlinks The new `relative_from` method no longer supports the case on unix where both paths are absolute, which `-C rpath` depended on. This version fixes the problem by copying the old path_relative_from function into the rpath module. Fixes #23140 After experimenting with the new `relative_from` function on `Path` I'm not sure what it's use case is. It no longer even figures out that the relative path from `/foo/bar` to `/foo/baz/qux` is `../baz/qux`.
Diffstat (limited to 'src/libstd/path.rs')
| -rw-r--r-- | src/libstd/path.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index ddceed14cc6..05c7761be7b 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1243,6 +1243,9 @@ impl Path { } /// Returns a path that, when joined onto `base`, yields `self`. + /// + /// If `base` is not a prefix of `self` (i.e. `starts_with` + /// returns false), then `relative_from` returns `None`. #[unstable(feature = "path_relative_from", reason = "see #23284")] pub fn relative_from<'a, P: ?Sized>(&'a self, base: &'a P) -> Option<&Path> where P: AsPath |
