From 8648f5a6a6b318ccf753829285af2da4c255e0f6 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 24 Nov 2021 14:27:06 -0800 Subject: [PATCH] Add test for parenthesized path arguments with disambiguator Currently fails with: ---- parse_parenthesized_path_arguments_with_disambiguator stdout ---- thread 'parse_parenthesized_path_arguments_with_disambiguator' panicked at 'called `Result::unwrap()` on an `Err` value: Error("expected identifier")', tests/test_path.rs:110:5 --- tests/test_path.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_path.rs b/tests/test_path.rs index e05b52ee66..c732eff70c 100644 --- a/tests/test_path.rs +++ b/tests/test_path.rs @@ -102,3 +102,25 @@ fn print_incomplete_qpath() { "###); assert!(ty.path.segments.pop().is_none()); } + +#[test] +fn parse_parenthesized_path_arguments_with_disambiguator() { + #[rustfmt::skip] + let tokens = quote!(FnOnce::() -> !); + snapshot!(tokens as Type, @r###" + Type::Path { + path: Path { + segments: [ + PathSegment { + ident: "FnOnce", + arguments: PathArguments::Parenthesized { + output: Type( + Type::Never, + ), + }, + }, + ], + }, + } + "###); +}