1
Fork 0

Option<CoroutineKind>

This commit is contained in:
Eric Holk 2023-11-30 16:39:56 -08:00
parent 48d5f1f0f2
commit f9d1f922dc
No known key found for this signature in database
GPG key ID: 8EA6B43ED4CE0911
22 changed files with 117 additions and 122 deletions

View file

@ -1268,13 +1268,18 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
self.check_c_variadic_type(fk);
// Functions cannot both be `const async`
// Functions cannot both be `const async` or `const gen`
if let Some(&FnHeader {
constness: Const::Yes(cspan),
coro_kind: CoroutineKind::Async { span: aspan, .. },
coro_kind:
Some(
CoroutineKind::Async { span: aspan, .. }
| CoroutineKind::Gen { span: aspan, .. },
),
..
}) = fk.header()
{
// FIXME(eholk): Report a different error for `const gen`
self.err_handler().emit_err(errors::ConstAndAsync {
spans: vec![cspan, aspan],
cspan,