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

Cleanup PartialEq docs. #57357

Merged
merged 8 commits into from Jan 18, 2019

Conversation

Projects
None yet
7 participants
@frewsxcv
Copy link
Member

frewsxcv commented Jan 5, 2019

  • Cleanup the impl PartialEq<BookFormat> for Book implementation
  • Implement impl PartialEq<Book> for BookFormat so it’s symmetric
  • Removes the last example since it appears to be redundant with the
    previous two examples.
Cleanup PartialEq docs.
- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes #53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Jan 5, 2019

r? @Kimundi

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

@frewsxcv

This comment has been minimized.

Copy link
Member

frewsxcv commented Jan 5, 2019

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Jan 5, 2019

A side-effect of the changes here is that there's now no example that uses match, which feels like an important teaching opportunity wrt. PartialEq.. Could we perhaps work that in in some other way?

Also @frewsxcv, note that you cannot actually assign a team so don't use r? for that; just cc the team instead.

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Jan 5, 2019

@frewsxcv

This comment has been minimized.

Copy link
Member

frewsxcv commented Jan 5, 2019

A side-effect of the changes here is that there's now no example that uses match, which feels like an important teaching opportunity wrt. PartialEq.. Could we perhaps work that in in some other way?

In my opinion, this doesn't seem like the right place to teach people about language features like match, that seems better suited for TRPL or other introductory learning resources.

Also @frewsxcv, note that you cannot actually assign a team so don't use r? for that; just cc the team instead.

Oh I know, I'm just asking someone from the docs team for a review.

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Jan 5, 2019

In my opinion, this doesn't seem like the right place to teach people about language features like match, that seems better suited for TRPL or other introductory learning resources.

OK, you might be right, seems like a judgement call for Steve to make. ;)

Oh I know, I'm just asking someone from the docs team for a review.

Right, but when you r? a team, rust-highfive just gets unhappy and the PR then has no assignee... =P

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Jan 5, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:20236aeb:start=1546710288980257518,finish=1546710289847796099,duration=867538581
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:11:43] 
[01:11:43] running 118 tests
[01:12:09] .iiiii...i.....i..i...i..i.i..i.ii..i.....i..i....i..........iiii..........i...ii...i.......ii.i.i.i 100/118
[01:12:14] ......iii.i.....ii
[01:12:14] 
[01:12:14]  finished in 31.168
[01:12:14] travis_fold:end:test_debuginfo

---
[01:25:19] 
[01:25:19]    Doc-tests core
[01:25:26] 
[01:25:26] running 2226 tests
[01:25:38] ......iiiii......................................................................................... 100/2226
[01:25:50] .......................................................F............................................ 200/2226
[01:26:23] ......................................................i............................................. 400/2226
[01:26:36] .................................................................................................... 500/2226
[01:26:50] .................................................................................................... 600/2226
[01:27:03] .................................................................................................... 700/2226
---
[01:31:03] ---- cmp.rs - cmp::PartialEq (line 98) stdout ----
[01:31:03] error[E0308]: mismatched types
[01:31:03]   --> cmp.rs:113:24
[01:31:03]    |
[01:31:03] 18 |         self.format == *other
[01:31:03]    |                        ^^^^^^ expected struct `main::Book`, found enum `main::BookFormat`
[01:31:03]    = note: expected type `main::Book`
[01:31:03]    = note: expected type `main::Book`
[01:31:03]               found type `main::BookFormat`
[01:31:03] 
[01:31:03] error[E0609]: no field `format` on type `&main::BookFormat`
[01:31:03]   --> cmp.rs:120:24
[01:31:03]    |
[01:31:03] 25 |         *other == self.format
[01:31:03] 
[01:31:03] thread 'cmp.rs - cmp::PartialEq (line 98)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:321:13
[01:31:03] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:31:03] 
---
[01:31:03] 
[01:31:03] error: test failed, to rerun pass '--doc'
[01:31:03] 
[01:31:03] 
[01:31:03] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
[01:31:03] 
[01:31:03] 
[01:31:03] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:31:03] Build completed unsuccessfully in 0:31:35
[01:31:03] Build completed unsuccessfully in 0:31:35
[01:31:03] Makefile:48: recipe for target 'check' failed
[01:31:03] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0b7916c8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sat Jan  5 19:16:04 UTC 2019
---
travis_time:end:022cc656:start=1546715766317601604,finish=1546715766323461094,duration=5859490
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:153102d7
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!check

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Jan 6, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:1bbb413e:start=1546746815281139193,finish=1546746887192540144,duration=71911400951
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:09:06] 
[01:09:06] running 118 tests
[01:09:30] .iiiii...i.....i..i...i..i.i..i.ii..i.....i..i....i..........iiii..........i...ii...i.......ii.i.i.i 100/118
[01:09:34] ......iii.i.....ii
[01:09:34] 
[01:09:34]  finished in 28.252
[01:09:34] travis_fold:end:test_debuginfo

---
[01:21:49] 
[01:21:49]    Doc-tests core
[01:21:54] 
[01:21:54] running 2226 tests
[01:22:05] ......iiiii......................................................................................... 100/2226
[01:22:17] ........................................................F........................................... 200/2226
[01:22:45] ......................................................i............................................. 400/2226
[01:22:57] .................................................................................................... 500/2226
[01:23:09] .................................................................................................... 600/2226
[01:23:21] .................................................................................................... 700/2226

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Jan 6, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0ebb2427:start=1546791004728620765,finish=1546791084487855236,duration=79759234471
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:10:39] 
[01:10:39] running 118 tests
[01:11:04] .iiiii...i.....i..i...i..i.i..i.ii..i.....i..i....i..........iiii..........i...ii...i.......ii.i.i.i 100/118
[01:11:09] ......iii.i.....ii
[01:11:09] 
[01:11:09]  finished in 29.811
[01:11:09] travis_fold:end:test_debuginfo

---
[01:23:40] 
[01:23:40]    Doc-tests core
[01:23:46] 
[01:23:46] running 2226 tests
[01:23:58] ......iiiii......................................................................................... 100/2226
[01:24:09] .......................................................F............................................ 200/2226
[01:24:39] ......................................................i............................................. 400/2226
[01:24:51] .................................................................................................... 500/2226
[01:25:04] .................................................................................................... 600/2226
[01:25:17] .................................................................................................... 700/2226

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@QuietMisdreavus
Copy link
Member

QuietMisdreavus left a comment

I like adding the symmetric PartialEq impls, but i'm wary about removing the example you took out.

Show resolved Hide resolved src/libcore/cmp.rs
Show resolved Hide resolved src/libcore/cmp.rs Outdated

frewsxcv added some commits Jan 12, 2019

@QuietMisdreavus
Copy link
Member

QuietMisdreavus left a comment

Looks good, thanks!

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Jan 16, 2019

@bors r+ rollup

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 16, 2019

📌 Commit 32b2834 has been approved by QuietMisdreavus

Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019

Rollup merge of rust-lang#57357 - frewsxcv:frewsxcv-partial-eq, r=Qui…
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.

Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019

Rollup merge of rust-lang#57357 - frewsxcv:frewsxcv-partial-eq, r=Qui…
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.

Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019

Rollup merge of rust-lang#57357 - frewsxcv:frewsxcv-partial-eq, r=Qui…
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.

bors added a commit that referenced this pull request Jan 17, 2019

Auto merge of #57690 - Centril:rollup, r=Centril
Rollup of 18 pull requests

Successful merges:

 - #56594 (Remove confusing comment about ideally using `!` for `c_void`)
 - #56996 (Move spin_loop_hint to core::hint module)
 - #57065 (Optimize try_mark_green and eliminate the lock on dep node colors)
 - #57107 (Add a regression test for mutating a non-mut #[thread_local])
 - #57253 (Make privacy checking, intrinsic checking and liveness checking incremental)
 - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356))
 - #57340 (Use correct tracking issue for c_variadic)
 - #57357 (Cleanup PartialEq docs.)
 - #57370 (Support passing cflags/cxxflags/ldflags to LLVM build)
 - #57501 (High priority resolutions for associated variants)
 - #57551 (resolve: Add a test for issue #57539)
 - #57610 (Fix nested `?` matchers)
 - #57635 (use structured macro and path resolve suggestions)
 - #57636 (Fix sources sidebar not showing up)
 - #57646 (Fixes text becoming invisible when element targetted)
 - #57654 (Add some links in std::fs.)
 - #57655 (OSX: fix #57534 registering thread dtors while running thread dtors)
 - #57659 (Fix release manifest generation)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Jan 17, 2019

Auto merge of #57690 - Centril:rollup, r=Centril
Rollup of 18 pull requests

Successful merges:

 - #56594 (Remove confusing comment about ideally using `!` for `c_void`)
 - #56996 (Move spin_loop_hint to core::hint module)
 - #57065 (Optimize try_mark_green and eliminate the lock on dep node colors)
 - #57107 (Add a regression test for mutating a non-mut #[thread_local])
 - #57253 (Make privacy checking, intrinsic checking and liveness checking incremental)
 - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356))
 - #57340 (Use correct tracking issue for c_variadic)
 - #57357 (Cleanup PartialEq docs.)
 - #57370 (Support passing cflags/cxxflags/ldflags to LLVM build)
 - #57501 (High priority resolutions for associated variants)
 - #57551 (resolve: Add a test for issue #57539)
 - #57610 (Fix nested `?` matchers)
 - #57635 (use structured macro and path resolve suggestions)
 - #57636 (Fix sources sidebar not showing up)
 - #57646 (Fixes text becoming invisible when element targetted)
 - #57654 (Add some links in std::fs.)
 - #57655 (OSX: fix #57534 registering thread dtors while running thread dtors)
 - #57659 (Fix release manifest generation)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Jan 18, 2019

Auto merge of #57690 - Centril:rollup, r=Centril
Rollup of 18 pull requests

Successful merges:

 - #56594 (Remove confusing comment about ideally using `!` for `c_void`)
 - #56996 (Move spin_loop_hint to core::hint module)
 - #57065 (Optimize try_mark_green and eliminate the lock on dep node colors)
 - #57107 (Add a regression test for mutating a non-mut #[thread_local])
 - #57253 (Make privacy checking, intrinsic checking and liveness checking incremental)
 - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356))
 - #57340 (Use correct tracking issue for c_variadic)
 - #57357 (Cleanup PartialEq docs.)
 - #57370 (Support passing cflags/cxxflags/ldflags to LLVM build)
 - #57501 (High priority resolutions for associated variants)
 - #57551 (resolve: Add a test for issue #57539)
 - #57610 (Fix nested `?` matchers)
 - #57635 (use structured macro and path resolve suggestions)
 - #57636 (Fix sources sidebar not showing up)
 - #57646 (Fixes text becoming invisible when element targetted)
 - #57654 (Add some links in std::fs.)
 - #57655 (OSX: fix #57534 registering thread dtors while running thread dtors)
 - #57659 (Fix release manifest generation)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019

Rollup merge of rust-lang#57357 - frewsxcv:frewsxcv-partial-eq, r=Qui…
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.

bors added a commit that referenced this pull request Jan 18, 2019

Auto merge of #57727 - Centril:rollup, r=Centril
Rollup of 22 pull requests

Successful merges:

 - #56594 (Remove confusing comment about ideally using `!` for `c_void`)
 - #57107 (Add a regression test for mutating a non-mut #[thread_local])
 - #57340 (Use correct tracking issue for c_variadic)
 - #57357 (Cleanup PartialEq docs.)
 - #57370 (Support passing cflags/cxxflags/ldflags to LLVM build)
 - #57475 (Add signed num::NonZeroI* types)
 - #57501 (High priority resolutions for associated variants)
 - #57551 (resolve: Add a test for issue #57539)
 - #57610 (Fix nested `?` matchers)
 - #57634 (Remove an unused function argument)
 - #57635 (use structured macro and path resolve suggestions)
 - #57636 (Fix sources sidebar not showing up)
 - #57646 (Fixes text becoming invisible when element targetted)
 - #57649 (privacy: Account for associated existential types)
 - #57650 (librustc_metadata: Pass a default value when unwrapping a span)
 - #57654 (Add some links in std::fs.)
 - #57658 (Two HIR tweaks)
 - #57659 (Fix release manifest generation)
 - #57683 (Document Unpin in std::prelude documentation)
 - #57685 (Enhance `Pin` impl applicability for `PartialEq` and `PartialOrd`.)
 - #57698 (Fix typo bug in DepGraph::try_mark_green().)
 - #57720 (Fix suggestions given mulitple bad lifetimes)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019

Rollup merge of rust-lang#57357 - frewsxcv:frewsxcv-partial-eq, r=Qui…
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 18, 2019

Rollup merge of rust-lang#57357 - frewsxcv:frewsxcv-partial-eq, r=Qui…
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.

bors added a commit that referenced this pull request Jan 18, 2019

Auto merge of #57732 - Centril:rollup, r=Centril
Rollup of 21 pull requests

Successful merges:

 - #56594 (Remove confusing comment about ideally using `!` for `c_void`)
 - #57107 (Add a regression test for mutating a non-mut #[thread_local])
 - #57340 (Use correct tracking issue for c_variadic)
 - #57357 (Cleanup PartialEq docs.)
 - #57370 (Support passing cflags/cxxflags/ldflags to LLVM build)
 - #57501 (High priority resolutions for associated variants)
 - #57551 (resolve: Add a test for issue #57539)
 - #57610 (Fix nested `?` matchers)
 - #57634 (Remove an unused function argument)
 - #57635 (use structured macro and path resolve suggestions)
 - #57636 (Fix sources sidebar not showing up)
 - #57646 (Fixes text becoming invisible when element targetted)
 - #57650 (librustc_metadata: Pass a default value when unwrapping a span)
 - #57654 (Add some links in std::fs.)
 - #57658 (Two HIR tweaks)
 - #57659 (Fix release manifest generation)
 - #57683 (Document Unpin in std::prelude documentation)
 - #57685 (Enhance `Pin` impl applicability for `PartialEq` and `PartialOrd`.)
 - #57698 (Fix typo bug in DepGraph::try_mark_green().)
 - #57720 (Fix suggestions given mulitple bad lifetimes)
 - #57725 (Use structured suggestion to surround struct literal with parenthesis)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019

Rollup merge of rust-lang#57357 - frewsxcv:frewsxcv-partial-eq, r=Qui…
…etMisdreavus

Cleanup PartialEq docs.

- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
  - Fixes rust-lang#53844.
- Removes the last example since it appears to be redundant with the
  previous two examples.

bors added a commit that referenced this pull request Jan 18, 2019

Auto merge of #57737 - Centril:rollup, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #56594 (Remove confusing comment about ideally using `!` for `c_void`)
 - #57340 (Use correct tracking issue for c_variadic)
 - #57357 (Cleanup PartialEq docs.)
 - #57551 (resolve: Add a test for issue #57539)
 - #57636 (Fix sources sidebar not showing up)
 - #57646 (Fixes text becoming invisible when element targetted)
 - #57654 (Add some links in std::fs.)
 - #57683 (Document Unpin in std::prelude documentation)
 - #57685 (Enhance `Pin` impl applicability for `PartialEq` and `PartialOrd`.)
 - #57710 (Fix non-clickable urls)

Failed merges:

r? @ghost

@bors bors merged commit 32b2834 into rust-lang:master Jan 18, 2019

@frewsxcv frewsxcv deleted the frewsxcv:frewsxcv-partial-eq branch Jan 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment