Add support for const and async trait bounds

This commit is contained in:
Michael Goulet 2024-02-16 16:00:04 +00:00
parent bb0f93a260
commit 3e4deab3d8
5 changed files with 89 additions and 0 deletions

View file

@ -157,6 +157,16 @@ fn type_bound(p: &mut Parser<'_>) -> bool {
p.bump_any();
p.expect(T![const]);
}
// test const_trait_bound
// const fn foo(_: impl const Trait) {}
T![const] => {
p.bump_any();
}
// test async_trait_bound
// fn async_foo(_: impl async Fn(&i32)) {}
T![async] => {
p.bump_any();
}
_ => (),
}
if paths::is_use_path_start(p) {