Skip to content

Add missing ?const #1085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Add missing ?const #1085

wants to merge 1 commit into from

Conversation

tyilo
Copy link
Contributor

@tyilo tyilo commented Feb 23, 2023

No description provided.

@rylev rylev requested a review from yoshuawuyts February 24, 2023 09:06
@yoshuawuyts
Copy link
Member

Thanks for filing this PR! - I get that it's confusing, because what you wrote is indeed what we think the syntax should be! But by this point in the post, we haven't yet suggested changing the syntax of const fn to ?const fn, despite having mentioned that const fn already does mean "maybe-const". Confusing!

We only suggest changing const fn to ?const fn for consistency later on in the post, in the section titled: "consistent syntax". So I think you're absolutely right that this looks really weird and inconsistent, especially compared to the ?const trait notation - but that's something we intentionally call out later in the post and is something we would actually like to address!

@tyilo
Copy link
Contributor Author

tyilo commented Feb 24, 2023

Thanks for filing this PR! - I get that it's confusing, because what you wrote is indeed what we think the syntax should be! But by this point in the post, we haven't yet suggested changing the syntax of const fn to ?const fn, despite having mentioned that const fn already does mean "maybe-const". Confusing!

We only suggest changing const fn to ?const fn for consistency later on in the post, in the section titled: "consistent syntax". So I think you're absolutely right that this looks really weird and inconsistent, especially compared to the ?const trait notation - but that's something we intentionally call out later in the post and is something we would actually like to address!

Hmm, but then shouldn't it also be const ?async fn read_string in the "Combining const and async" section and not ?const ?async?

@yoshuawuyts
Copy link
Member

Ah, yes! That’s a good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants