Skip to content

Conversation

waywardmonkeys
Copy link
Contributor

Fixes #114281.

@rustbot
Copy link
Collaborator

rustbot commented Aug 21, 2023

r? @cuviper

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 21, 2023
@rust-log-analyzer

This comment has been minimized.

@waywardmonkeys waywardmonkeys force-pushed the augment-type-keyword-docs branch from 82f4f83 to 0420d0f Compare August 21, 2023 12:06
@waywardmonkeys
Copy link
Contributor Author

I originally had an additional example with a where clause, but since it failed and wasn't essential, I removed it.

@rust-log-analyzer

This comment has been minimized.

@waywardmonkeys waywardmonkeys force-pushed the augment-type-keyword-docs branch from 0420d0f to 5324570 Compare August 21, 2023 13:01
@fmease
Copy link
Member

fmease commented Aug 21, 2023

I originally had an additional example with a where clause, but […] it failed

Yeah, fyi, where clauses are not properly supported on type aliases. In a future edition they might be (currently available under #![feature(lazy_type_alias)]).

@waywardmonkeys
Copy link
Contributor Author

@fmease Yes, it is slightly confusing after reading https://doc.rust-lang.org/reference/items/type-aliases.html and thinking they exist. :)

@fmease
Copy link
Member

fmease commented Aug 21, 2023

Right, that's only the grammar. Syntactically they are allowed, semantically they are mostly ignored and warned against. I admit that it can be a bit confusing if you are not familiar with them. However the reference is correct, technically speaking ^^

@waywardmonkeys
Copy link
Contributor Author

Maybe it is better then if my PR doesn't link to the reference since it is more likely to be actively confusing.

@fmease
Copy link
Member

fmease commented Aug 21, 2023

Hmm, I dunno. Personally I quite like it and these pages typically link to the Reference, so I guess it's fine.

@cuviper
Copy link
Member

cuviper commented Aug 22, 2023

LGTM!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 22, 2023

📌 Commit 5324570 has been approved by cuviper

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 22, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 23, 2023
…d-docs, r=cuviper

docs: Add example, reference link for `type` keyword.

Fixes rust-lang#114281.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2023
Rollup of 7 pull requests

Successful merges:

 - rust-lang#114930 (Automatically add OS labels to std PRs)
 - rust-lang#115053 (docs: Add example, reference link for `type` keyword.)
 - rust-lang#115092 (Add generics_of to smir)
 - rust-lang#115096 (Add regression test for not `memcpy`ing padding bytes)
 - rust-lang#115100 (Add support for `ptr::write`s for the `invalid_reference_casting` lint)
 - rust-lang#115114 (Contents of reachable statics is reachable)
 - rust-lang#115122 (Fix clippy lint for identical `if`/`else` contraining `?` expressions)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 21411c4 into rust-lang:master Aug 23, 2023
@rustbot rustbot added this to the 1.74.0 milestone Aug 23, 2023
@waywardmonkeys waywardmonkeys deleted the augment-type-keyword-docs branch August 24, 2023 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

type keyword no generics example
6 participants