Skip to content

Conversation

steveklabnik
Copy link
Contributor

Closes #19556.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current use of Ordering the prelude is currently a subject of a bit of debate (rust-lang/rfcs#497, rust-lang/rfcs#504), would it be possible to write this without referencing the prelude or Ordering at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to have it removed, but until then, the guide is still deficient. What's the timeline on the RFC getting accepted? I'd rather not have the guide be wrong for weeks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I was thinking that we could accept this now if an example other than Ordering was used. Perhaps Option which will likely always be in the prelude?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose Ordering for a few reasons. One is that it's a classic pattern in C which is different than in Rust. Secondly because it fits nicely into the classic guessing game example. Removing the Ordering example invovles changing almost the first half of the guide.

We do talk about Option in the section with variants, which we haven't gotten to yet at this point, IIRC. Or at least, that's why we do Ordering first: enum without variants, then one with.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! We can revise slightly as necessary as the prelude changes later on in that case.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 9, 2014
@bors bors merged commit e294772 into rust-lang:master Dec 9, 2014
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a wee tidbit - I think it might be unnecessary to use "example" twice in

For example, here is an example...

Perhaps this sentence could just be "Here is an example using our StringResult:" ?

lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 28, 2025
…iags

internal: Make hir-ty non-diagnostic queries transparent
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.

Guide does not explain the namespaced enums
4 participants