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
This commit is contained in:
David Tolnay 2021-11-24 14:27:06 -08:00
parent c859588bdb
commit 8648f5a6a6
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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,
),
},
},
],
},
}
"###);
}