Alternate syntax idea for Return Type Notation #117375
Labels
C-discussion
Category: Discussion or questions that doesn't represent real issues.
F-return_type_notation
`#[feature(return_type_notation)]`
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
WG-async
Working group: Async & await
Tracking Issue: #109417
Hi, I'm new so let me know if this is not the right forum for this :), the tracking issue noted that it was not for discussion and that people should open up a separate issue.
I had an idea for a more consistent syntax for Return Type Notation. My thought process is as follows:
Given that we already have traits that auto-implement for all functions (
FnOnce
,Fn
,FnMut
), which all contain the associated typeFnOnce::Output
, why not just allow the ability to impose constraints on that associated type as a way to name the output of a function?For Example:
Came up with this idea while watching Jon Gjengset's lecture about impl Traits, so I don't quite understand all the minutiae of the feature, only that this is a problem and it seems to require syntax changes. Is this idea semantically inconsistent? decent but needs modification? totally awesome? What you all think?
The text was updated successfully, but these errors were encountered: