diff --git a/src/path.rs b/src/path.rs index 924ef8a4d3..969a9865cb 100644 --- a/src/path.rs +++ b/src/path.rs @@ -548,9 +548,9 @@ pub(crate) mod parsing { segments.push_punct(punct); } if segments.is_empty() { - return Err(input.error("expected path")); + return Err(input.parse::().unwrap_err()); } else if segments.trailing_punct() { - return Err(input.error("expected path segment")); + return Err(input.error("expected path segment after `::`")); } segments },