From 7bb31b100a58112314bd940c21960e22e5103f1a Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 20 Mar 2023 13:47:02 -0700 Subject: [PATCH] Improve error reporting in path parser --- src/path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 },