Skip to content

Commit

Permalink
Add test for parenthesized path arguments with disambiguator
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dtolnay committed Nov 25, 2021
1 parent c859588 commit 8648f5a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
},
},
],
},
}
"###);
}

0 comments on commit 8648f5a

Please sign in to comment.