Skip to content

Commit e479c70

Browse files
committed
Auto merge of #104387 - Manishearth:rollup-9e551p5, r=Manishearth
Rollup of 9 pull requests Successful merges: - #103709 (ci: Upgrade dist-x86_64-netbsd to NetBSD 9.0) - #103744 (Upgrade cc for working is_flag_supported on cross-compiles) - #104105 (llvm: dwo only emitted when object code emitted) - #104158 (Return .efi extension for EFI executable) - #104181 (Add a few known-bug tests) - #104266 (Regression test for coercion of mut-ref to dyn-star) - #104300 (Document `Path::parent` behavior around relative paths) - #104304 (Enable profiler in dist-s390x-linux) - #104362 (Add `delay_span_bug` to `AttrWrapper::take_for_recovery`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2e81036 + 2c2a882 commit e479c70

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

std/src/path.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,10 @@ impl Path {
21422142

21432143
/// Returns the `Path` without its final component, if there is one.
21442144
///
2145-
/// Returns [`None`] if the path terminates in a root or prefix.
2145+
/// This means it returns `Some("")` for relative paths with one component.
2146+
///
2147+
/// Returns [`None`] if the path terminates in a root or prefix, or if it's
2148+
/// the empty string.
21462149
///
21472150
/// # Examples
21482151
///
@@ -2156,6 +2159,14 @@ impl Path {
21562159
/// let grand_parent = parent.parent().unwrap();
21572160
/// assert_eq!(grand_parent, Path::new("/"));
21582161
/// assert_eq!(grand_parent.parent(), None);
2162+
///
2163+
/// let relative_path = Path::new("foo/bar");
2164+
/// let parent = relative_path.parent();
2165+
/// assert_eq!(parent, Some(Path::new("foo")));
2166+
/// let grand_parent = parent.and_then(Path::parent);
2167+
/// assert_eq!(grand_parent, Some(Path::new("")));
2168+
/// let great_grand_parent = grand_parent.and_then(Path::parent);
2169+
/// assert_eq!(great_grand_parent, None);
21592170
/// ```
21602171
#[stable(feature = "rust1", since = "1.0.0")]
21612172
#[doc(alias = "dirname")]

unwind/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ compiler_builtins = "0.1.0"
2020
cfg-if = "1.0"
2121

2222
[build-dependencies]
23-
cc = "1.0.69"
23+
cc = "1.0.76"
2424

2525
[features]
2626

0 commit comments

Comments
 (0)