You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently check that async fns and generators are not recursive, as this would generate infinitely large state machines. However, if we ever want to support async fns or generators in traits, this check would have to run post-monomorphisation (since until that point we don't know which trait implementation will be chosen).
Since we don't like to generate errors post-monomorphisation, this seems like a serious problem!
Example:
traitFoo{asyncfnfoo(&self);}implFoofori32{asyncfnfoo(&self,other:&implFoo){
other.foo().await;}}implFoofori64{asyncfnfoo(&self,other:&implFoo){// Not recursive}}fnmain(){let x = 1i32;
x.foo(&x);// Error}
The text was updated successfully, but these errors were encountered:
We currently check that async fns and generators are not recursive, as this would generate infinitely large state machines. However, if we ever want to support async fns or generators in traits, this check would have to run post-monomorphisation (since until that point we don't know which trait implementation will be chosen).
Since we don't like to generate errors post-monomorphisation, this seems like a serious problem!
Example:
The text was updated successfully, but these errors were encountered: