Skip to content
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

Add non_exhaustive to reference. #609

Merged
merged 2 commits into from
Oct 26, 2019

Conversation

davidtwco
Copy link
Member

@davidtwco davidtwco commented May 12, 2019

This PR adds documentation for RFC 2008 (tracking issue rust-lang/rust#44109) to the reference.

@ehuss
Copy link
Contributor

ehuss commented May 12, 2019

Nice! I'm looking forward to this being stabilized. The stabilization report says 1.35, but that's in about 10 days, will it maybe be in a future release?

As for categorization, that's a tough one. I had originally intended that section to be just for lints, but I can't think of a better place to put it. I don't feel strongly where it goes, so unless someone else has a suggestion, I don't have a preference.

@davidtwco
Copy link
Member Author

The stabilization report says 1.35, but that's in about 10 days, will it maybe be in a future release?

I just wrote the next release when I was drafting that, I have no idea what release it will be. I've changed it to TBD in that document.

@davidtwco davidtwco force-pushed the rfc-2008-documentation branch from 54bfb46 to 5c0ab40 Compare May 13, 2019 19:09
@ehuss ehuss force-pushed the rfc-2008-documentation branch from 5c0ab40 to 4852200 Compare July 16, 2019 22:35
@ehuss
Copy link
Contributor

ehuss commented Jul 16, 2019

@davidtwco Just a heads up, I have rebased this PR on latest master to resolve the conflicts, so be careful updating locally.

The reference has migrated to mdbook 0.3. This means that links should use the .md extension, and are relative to the page they are on (previously they were relative to the root of the book). Please don't hesitate to ask if you have any questions or any trouble updating. Sorry for the interruption!

@davidtwco
Copy link
Member Author

@ehuss thanks a lot for doing that, I hadn’t been checking to see if there were any conflicts.

@ehuss ehuss added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Oct 2, 2019
@Centril
Copy link
Contributor

Centril commented Oct 25, 2019

The stabilization PR (rust-lang/rust#64639) just went through.

src/attributes/diagnostics.md Outdated Show resolved Hide resolved
src/attributes/diagnostics.md Outdated Show resolved Hide resolved
src/attributes/diagnostics.md Outdated Show resolved Hide resolved
src/attributes/diagnostics.md Outdated Show resolved Hide resolved
src/attributes/diagnostics.md Outdated Show resolved Hide resolved
src/attributes/diagnostics.md Outdated Show resolved Hide resolved
src/attributes/diagnostics.md Outdated Show resolved Hide resolved
src/attributes/diagnostics.md Outdated Show resolved Hide resolved
@davidtwco davidtwco force-pushed the rfc-2008-documentation branch from 4852200 to c01aff7 Compare October 26, 2019 12:44
src/attributes/type_system.md Outdated Show resolved Hide resolved
src/attributes/type_system.md Outdated Show resolved Hide resolved
src/attributes/type_system.md Outdated Show resolved Hide resolved
src/attributes/type_system.md Outdated Show resolved Hide resolved
src/attributes/type_system.md Outdated Show resolved Hide resolved
src/attributes/type_system.md Show resolved Hide resolved
@davidtwco davidtwco force-pushed the rfc-2008-documentation branch from c01aff7 to 363a64a Compare October 26, 2019 13:25
@Centril Centril requested a review from ehuss October 26, 2019 13:44
@Centril
Copy link
Contributor

Centril commented Oct 26, 2019

LGTM; but maybe @ehuss and @petrochenkov want to take a look also.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Nice!

@ehuss
Copy link
Contributor

ehuss commented Oct 26, 2019

I was wondering if you would be willing to make a PR to define "inhabited" and "uninhabited" in the glossary? It is not defined anywhere, and this adds a second reference to the term, which (I think) is unclear for anyone not well versed in type theory (e.g. me).

Signed-off-by: David Wood <david@davidtw.co>
@davidtwco
Copy link
Member Author

I was wondering if you would be willing to make a PR to define "inhabited" and "uninhabited" in the glossary? It is not defined anywhere, and this adds a second reference to the term, which (I think) is unclear for anyone not well versed in type theory (e.g. me).

I've added a commit which adds inhabited/uninhabited to the glossary.

@ehuss
Copy link
Contributor

ehuss commented Oct 26, 2019

Thanks! ❤️

@@ -65,6 +65,12 @@ For example, `2 + (3 * 4)` is an expression that returns the value 14.
An [item] that is not a member of an [implementation], such as a *free
function* or a *free const*. Contrast to an [associated item].

### Inhabited

A type is inhabited if it has constructors and therefore can be instantiated. An inhabited type is
Copy link
Contributor

Choose a reason for hiding this comment

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

Is your notion of "has constructors" intended to e.g. take visibility into account? That's the current definition of inhabitedness in the type system but not the abstract machine. You are describing this from the POV of the type system, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Uh, yes..? I just borrowed the explanation from RFC 1216.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. :) Well, this is good.

@Centril Centril merged commit beb79db into rust-lang:master Oct 26, 2019
@davidtwco davidtwco deleted the rfc-2008-documentation branch October 26, 2019 20:34
bors added a commit to rust-lang/rust that referenced this pull request Oct 30, 2019
Update cargo, books.

## cargo

8 commits in 3ba5f27170db10af7a92f2b682e049397197b8fa..5da4b4d47963868d9878480197581ccbbdaece74
2019-10-22 15:05:18 +0000 to 2019-10-28 21:53:41 +0000
- Add --filter-platform to `cargo metadata`. (rust-lang/cargo#7376)
- Fix `cargo fix` not showing colors. (rust-lang/cargo#7550)
- Rephrase --manifest-path section (rust-lang/cargo#7409)
- Add a note to discourage the use of -Zminimal-versions. (rust-lang/cargo#7549)
- Fix profile override warning in a workspace. (rust-lang/cargo#7536)
- Fix some tests failing on Windows nightly. (rust-lang/cargo#7534)
- Show better error message for Windows abnormal termination. (rust-lang/cargo#7535)
- Run `apt update` before `apt install` (rust-lang/cargo#7541)

## reference

8 commits in 5b9d2fc..4b21b64
2019-10-03 22:39:10 +0200 to 2019-10-27 22:33:11 +0100
- Document `const_constructor` feature (rust-lang/reference#677)
- Add `non_exhaustive` to reference. (rust-lang/reference#609)
- Re-add rust-docs component for lintcheck (rust-lang/reference#702)
- group signed and unsigned integers in layout table (rust-lang/reference#700)
- Fix layout table rendering (rust-lang/reference#699)
- Add reference for attributes in function parameters (rust-lang/reference#657)
- Update now that proc macros can expand to macro_rules. (rust-lang/reference#694)
- Fix match in union example. (rust-lang/reference#684)

## book

8 commits in 9bb8b161963fcebc9d9ccd732ba26f42108016d5..28fa3d15b0bc67ea5e79eeff2198e4277fc61baf
2019-10-14 18:42:55 -0500 to 2019-10-29 07:16:09 -0500
- Update Ch19.1 on slice splitting (rust-lang/book#1999)
- fixed inconsistent terminology regarding enums (rust-lang/book#2022)
- Update ch15-03 code to match output. (rust-lang/book#2020)
- Fixes rust-lang/book#2039 (rust-lang/book#2040)
- Update ch15-03-drop.md (rust-lang/book#2049)
- unit type value is also a value (rust-lang/book#2061)
- Minor: remove an extraneous `.` (rust-lang/book#2059)
- Clarifications and consistent use of quotation marks (rust-lang/book#1992)

## rust-by-example

4 commits in 0b111eaae36cc4b4997684be853882a59e2c7ca7..f3197ddf2abab9abdbc029def8164f4a748b0d91
2019-10-14 18:34:25 -0300 to 2019-10-29 10:17:40 -0300
- Fix typos (rust-lang/rust-by-example#1285)
- Improve Cargo / Dependencies section (rust-lang/rust-by-example#1287)
- Improve Cargo / Build Scripts section (rust-lang/rust-by-example#1288)
- Make if_let exercise runnable (rust-lang/rust-by-example#1289)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants