Skip to content

Commit a513555

Browse files
nikomatsakisNiko Matsakis
authored andcommitted
support type ascription for let
to the extent we can...
1 parent 8298556 commit a513555

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/formality-core/src/judgment.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,15 @@ macro_rules! push_rules {
402402
}
403403
};
404404

405+
(@body $args:tt; $inputs:tt; $step_index:expr; (let $p:ident /*[1]*/: $t:ty = $i:expr) $($m:tt)*) => {
406+
// [1] I'd prefer to have `$p:pat` but the follow-set rules don't allow for it.
407+
// That's dumb.
408+
{
409+
let $p : $t = $i;
410+
$crate::push_rules!(@body $args; $inputs; $step_index + 1; $($m)*);
411+
}
412+
};
413+
405414
(@body $args:tt; $inputs:tt; $step_index:expr; (let $p:pat = $i:expr) $($m:tt)*) => {
406415
{
407416
let $p = $i;

0 commit comments

Comments
 (0)