Skip to content

Commit

Permalink
Fix wildcard type annotation (#11)
Browse files Browse the repository at this point in the history
This should fix #10. I added a small test, which passes for me.
  • Loading branch information
pratapsingh1729 authored Nov 11, 2023
2 parents 73910ea + e3c4e5e commit c021b73
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/verus.pest
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ extern_crate = {
}

rename = {
as_str ~ (name | "_")
as_str ~ (name | underscore_str)
}

use = {
Expand Down Expand Up @@ -1213,7 +1213,7 @@ slice_type = {
}

infer_type = {
"_"
underscore_str
}

fn_ptr_type = {
Expand Down
17 changes: 17 additions & 0 deletions tests/rustfmt-tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,20 @@ use LongLongLongLongLongLongLongLongLongLongType as LongerLongLongLongLongLongLo
"#;
compare(file);
}

#[test]
fn rust_wildcard_type_annotation() {
let file = r#"
fn foo() {
let x: _ = bar();
}
fn blah() {
let (temp_owl__x607, Tracked(itree)): ( _
, Tracked<ITreeToken<(Seq<u8>, state_Initiator), Endpoint>> ) = { baz(); };
}
"#;
compare(file);

}

0 comments on commit c021b73

Please sign in to comment.