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

rewrite documentation for unimplemented! to clarify use #64726

Merged
merged 1 commit into from
Oct 8, 2019
Merged

rewrite documentation for unimplemented! to clarify use #64726

merged 1 commit into from
Oct 8, 2019

Conversation

andrewbanchich
Copy link
Contributor

The current docs for unimplemented! seem to miss the point of this macro.

This can be useful if you are prototyping and are just looking to have your code type-check, or if you're implementing a trait that requires multiple methods, and you're only planning on using one of them.

You could also return a () if you just want your code to type-check.

I think unimplemented! is useful for when you want your program to exit when it reaches an unimplemented area.

I rewrote the explanation and gave examples of both forms of this macro that I think clarify its use a little better.

@rust-highfive
Copy link
Collaborator

r? @rkruppe

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 24, 2019
@andrewbanchich andrewbanchich changed the title rewrite documentation for unimplemented! rewrite documentation for unimplemented! to clarify use Sep 24, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-09-24T03:23:30.6139977Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-24T03:23:30.6328875Z ##[command]git config gc.auto 0
2019-09-24T03:23:30.6414985Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-24T03:23:30.6472640Z ##[command]git config --get-all http.proxy
2019-09-24T03:23:30.6623863Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64726/merge:refs/remotes/pull/64726/merge
---
2019-09-24T03:30:45.8786990Z    Compiling serde_json v1.0.40
2019-09-24T03:30:47.8615655Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-09-24T03:30:59.6278557Z     Finished release [optimized] target(s) in 1m 36s
2019-09-24T03:30:59.6361664Z tidy check
2019-09-24T03:31:00.1507278Z tidy error: /checkout/src/libcore/macros.rs:572: line longer than 100 chars
2019-09-24T03:31:01.7306553Z some tidy checks failed
2019-09-24T03:31:01.7316934Z 
2019-09-24T03:31:01.7316934Z 
2019-09-24T03:31:01.7322818Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-09-24T03:31:01.7323329Z 
2019-09-24T03:31:01.7323358Z 
2019-09-24T03:31:01.7331242Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-09-24T03:31:01.7331326Z Build completed unsuccessfully in 0:01:39
2019-09-24T03:31:01.7331326Z Build completed unsuccessfully in 0:01:39
2019-09-24T03:31:01.7377616Z == clock drift check ==
2019-09-24T03:31:01.7392956Z   local time: Tue Sep 24 03:31:01 UTC 2019
2019-09-24T03:31:01.8244109Z   network time: Tue, 24 Sep 2019 03:31:01 GMT
2019-09-24T03:31:01.8251601Z == end clock drift check ==
2019-09-24T03:31:03.2351728Z ##[error]Bash exited with code '1'.
2019-09-24T03:31:03.2387449Z ##[section]Starting: Checkout
2019-09-24T03:31:03.2390193Z ==============================================================================
2019-09-24T03:31:03.2390251Z Task         : Get sources
2019-09-24T03:31:03.2390299Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

src/libcore/macros.rs Outdated Show resolved Hide resolved
@qnighy
Copy link
Contributor

qnighy commented Sep 24, 2019

You could also return a () if you just want your code to type-check.

Returning () won't work if the return type is something like Result<BufRead<File>, std::io::Error>.

@andrewbanchich
Copy link
Contributor Author

andrewbanchich commented Sep 24, 2019

@qnighy I meant regarding the example given, we could easily get it to type check without this macro.

I did miss that it still allows it to compile if you try returning non-unit types. I'll edit my pull request to demonstrate this.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-09-24T11:01:35.8633195Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-24T11:01:35.8816222Z ##[command]git config gc.auto 0
2019-09-24T11:01:35.8897359Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-24T11:01:35.8958277Z ##[command]git config --get-all http.proxy
2019-09-24T11:01:35.9098492Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64726/merge:refs/remotes/pull/64726/merge
---
2019-09-24T12:04:46.0542449Z .................................................................................................... 1500/9038
2019-09-24T12:04:52.2040213Z .................................................................................................... 1600/9038
2019-09-24T12:05:04.7416010Z .........................................................................i...............i.......... 1700/9038
2019-09-24T12:05:11.8724890Z .................................................................................................... 1800/9038
2019-09-24T12:05:20.6218782Z ................................................................iiiii............................... 1900/9038
2019-09-24T12:05:40.7898575Z .................................................................................................... 2100/9038
2019-09-24T12:05:43.4074170Z .................................................................................................... 2200/9038
2019-09-24T12:05:46.7766990Z .................................................................................................... 2300/9038
2019-09-24T12:05:55.4112695Z .................................................................................................... 2400/9038
---
2019-09-24T12:08:57.2613956Z .....................................................i...............i.............................. 4700/9038
2019-09-24T12:09:06.5166998Z .................................................................................................... 4800/9038
2019-09-24T12:09:15.1498326Z .................................................................................................... 4900/9038
2019-09-24T12:09:22.7957802Z .................................................................................................... 5000/9038
2019-09-24T12:09:32.6301470Z ........................................ii.ii....................................................... 5100/9038
2019-09-24T12:09:42.5473779Z .................................................................................................... 5300/9038
2019-09-24T12:09:52.9767076Z .................................................................................................... 5400/9038
2019-09-24T12:10:01.0483410Z .....i.............................................................................................. 5500/9038
2019-09-24T12:10:06.2702993Z .................................................................................................... 5600/9038
2019-09-24T12:10:06.2702993Z .................................................................................................... 5600/9038
2019-09-24T12:10:18.0270886Z .................................................................................................... 5700/9038
2019-09-24T12:10:31.2747519Z ii...i..ii............i............................................................................. 5800/9038
2019-09-24T12:10:52.6217416Z .................................................................................................... 6000/9038
2019-09-24T12:11:01.0137399Z .................................................................................................... 6100/9038
2019-09-24T12:11:01.0137399Z .................................................................................................... 6100/9038
2019-09-24T12:11:15.1424165Z ..i..ii............................................................................................. 6200/9038
2019-09-24T12:11:33.7855844Z ..............................................................i..................................... 6400/9038
2019-09-24T12:11:35.8958349Z .................................................................................................... 6500/9038
2019-09-24T12:11:38.3734125Z ..................................i................................................................. 6600/9038
2019-09-24T12:11:42.4264076Z .................................................................................................... 6700/9038
---
2019-09-24T12:16:12.0848703Z  finished in 5.387
2019-09-24T12:16:12.1033426Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T12:16:12.2870089Z 
2019-09-24T12:16:12.2871589Z running 150 tests
2019-09-24T12:16:15.6024188Z i....iii......iii..iiii....i.............................i..i..................i....i.........ii.i.i 100/150
2019-09-24T12:16:17.6012047Z ..iiii..............i.........iii.i.......ii......
2019-09-24T12:16:17.6012588Z 
2019-09-24T12:16:17.6019930Z  finished in 5.498
2019-09-24T12:16:17.6195210Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T12:16:18.5762004Z 
---
2019-09-24T12:16:19.8285568Z  finished in 2.208
2019-09-24T12:16:19.8483293Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T12:16:20.0102949Z 
2019-09-24T12:16:20.0105582Z running 9 tests
2019-09-24T12:16:20.0106186Z iiiiiiiii
2019-09-24T12:16:20.0106761Z 
2019-09-24T12:16:20.0107501Z  finished in 0.162
2019-09-24T12:16:20.0272038Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T12:16:20.2050828Z 
---
2019-09-24T12:16:38.6325580Z  finished in 18.605
2019-09-24T12:16:38.6553772Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T12:16:38.8430144Z 
2019-09-24T12:16:38.8430451Z running 123 tests
2019-09-24T12:17:03.3131187Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i...ii...i.......ii. 100/123
2019-09-24T12:17:08.0245766Z i.i.i......iii.i.....ii
2019-09-24T12:17:08.0246339Z 
2019-09-24T12:17:08.0250029Z  finished in 29.369
2019-09-24T12:17:08.0257220Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T12:17:08.0260733Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-09-24T12:30:04.9737854Z 
2019-09-24T12:30:04.9740979Z    Doc-tests core
2019-09-24T12:30:10.0437006Z 
2019-09-24T12:30:10.0443160Z running 2405 tests
2019-09-24T12:30:21.2497153Z ......iiiii......................................................................................... 100/2405
2019-09-24T12:30:31.9630482Z ...............................................................................ii................... 200/2405
2019-09-24T12:30:57.5904418Z .i.................................................................................................. 400/2405
2019-09-24T12:30:57.5904418Z .i.................................................................................................. 400/2405
2019-09-24T12:31:08.1483923Z ................................................i..i.................iiii........F.................. 500/2405
2019-09-24T12:31:28.5074739Z .................................................................................................... 700/2405
2019-09-24T12:31:39.0510652Z .................................................................................................... 800/2405
2019-09-24T12:31:49.5737658Z .................................................................................................... 900/2405
2019-09-24T12:32:00.0182417Z .................................................................................................... 1000/2405
---
2019-09-24T12:34:32.4348509Z ..............i..................................................................................... 2400/2405
2019-09-24T12:34:33.0383260Z .....
2019-09-24T12:34:33.0383400Z failures:
2019-09-24T12:34:33.0383435Z 
2019-09-24T12:34:33.0384212Z ---- macros.rs - unimplemented (line 552) stdout ----
2019-09-24T12:34:33.0384301Z error[E0407]: method `qux` is not a member of trait `Foo`
2019-09-24T12:34:33.0384537Z   --> macros.rs:571:5
2019-09-24T12:34:33.0384579Z    |
2019-09-24T12:34:33.0384618Z 21 | /     fn qux(&self) {
2019-09-24T12:34:33.0384878Z 22 | |         let n = self.bar();
2019-09-24T12:34:33.0384952Z 23 | |         // We have some logic here,
2019-09-24T12:34:33.0384999Z 24 | |         // so we can use unimplemented! to display what we have so far.
2019-09-24T12:34:33.0385058Z ...  |
2019-09-24T12:34:33.0385115Z 27 | |         unimplemented!("we need to divide by {}", n);
2019-09-24T12:34:33.0385198Z    | |_____^ not a member of trait `Foo`
2019-09-24T12:34:33.0385246Z 
2019-09-24T12:34:33.0385288Z error[E0053]: method `bar` has an incompatible type for trait
2019-09-24T12:34:33.0386393Z   --> macros.rs:560:22
2019-09-24T12:34:33.0386393Z   --> macros.rs:560:22
2019-09-24T12:34:33.0386470Z    |
2019-09-24T12:34:33.0386513Z 4  |     fn bar(&self);
2019-09-24T12:34:33.0386757Z    |                  - type in trait
2019-09-24T12:34:33.0386814Z ...
2019-09-24T12:34:33.0387060Z 10 |     fn bar(&self) -> u8 {
2019-09-24T12:34:33.0387108Z    |                      ^^ expected (), found u8
2019-09-24T12:34:33.0387149Z    |
2019-09-24T12:34:33.0387207Z    = note: expected type `fn(&MyStruct)`
2019-09-24T12:34:33.0387438Z               found type `fn(&MyStruct) -> u8`
2019-09-24T12:34:33.0387472Z 
2019-09-24T12:34:33.0388223Z error[E0277]: `()` doesn't implement `std::fmt::Display`
2019-09-24T12:34:33.0388466Z   --> macros.rs:577:51
2019-09-24T12:34:33.0388524Z    |
2019-09-24T12:34:33.0388571Z 27 |         unimplemented!("we need to divide by {}", n);
2019-09-24T12:34:33.0388646Z    |                                                   ^ `()` cannot be formatted with the default formatter
2019-09-24T12:34:33.0388755Z    = help: the trait `std::fmt::Display` is not implemented for `()`
2019-09-24T12:34:33.0389065Z    = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
2019-09-24T12:34:33.0389129Z    = note: required by `std::fmt::Display::fmt`
2019-09-24T12:34:33.0389160Z 
2019-09-24T12:34:33.0389160Z 
2019-09-24T12:34:33.0389228Z error[E0599]: no method named `qux` found for type `MyStruct` in the current scope
2019-09-24T12:34:33.0389441Z   --> macros.rs:583:7
2019-09-24T12:34:33.0389527Z 7  | struct MyStruct;
2019-09-24T12:34:33.0389527Z 7  | struct MyStruct;
2019-09-24T12:34:33.0389776Z    | ---------------- method `qux` not found for this
2019-09-24T12:34:33.0389823Z ...
2019-09-24T12:34:33.0389865Z 33 |     s.qux();
2019-09-24T12:34:33.0390159Z    |       ^^^ method not found in `MyStruct`
2019-09-24T12:34:33.0390252Z error: aborting due to 4 previous errors
2019-09-24T12:34:33.0390281Z 
2019-09-24T12:34:33.0390345Z Some errors have detailed explanations: E0053, E0277, E0407, E0599.
2019-09-24T12:34:33.0390652Z For more information about an error, try `rustc --explain E0053`.
---
2019-09-24T12:34:33.0391802Z 
2019-09-24T12:34:33.0414577Z error: test failed, to rerun pass '--doc'
2019-09-24T12:34:33.0428251Z 
2019-09-24T12:34:33.0428353Z 
2019-09-24T12:34:33.0429269Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "core" "--" "--quiet"
2019-09-24T12:34:33.0429416Z 
2019-09-24T12:34:33.0429447Z 
2019-09-24T12:34:33.0439090Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-09-24T12:34:33.0439389Z Build completed unsuccessfully in 1:25:44
2019-09-24T12:34:33.0439389Z Build completed unsuccessfully in 1:25:44
2019-09-24T12:34:33.0489056Z == clock drift check ==
2019-09-24T12:34:33.0505185Z   local time: Tue Sep 24 12:34:33 UTC 2019
2019-09-24T12:34:33.3294955Z   network time: Tue, 24 Sep 2019 12:34:33 GMT
2019-09-24T12:34:33.3299460Z == end clock drift check ==
2019-09-24T12:34:34.0520879Z ##[error]Bash exited with code '1'.
2019-09-24T12:34:34.0576586Z ##[section]Starting: Checkout
2019-09-24T12:34:34.0578693Z ==============================================================================
2019-09-24T12:34:34.0578745Z Task         : Get sources
2019-09-24T12:34:34.0578810Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-09-24T15:08:03.0848908Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-24T15:08:03.1072129Z ##[command]git config gc.auto 0
2019-09-24T15:08:03.1158661Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-24T15:08:03.1228927Z ##[command]git config --get-all http.proxy
2019-09-24T15:08:03.1394548Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64726/merge:refs/remotes/pull/64726/merge
---
2019-09-24T16:11:43.9405781Z .................................................................................................... 1500/9038
2019-09-24T16:11:50.3485488Z .................................................................................................... 1600/9038
2019-09-24T16:12:03.2260613Z .........................................................................i...............i.......... 1700/9038
2019-09-24T16:12:10.3821968Z .................................................................................................... 1800/9038
2019-09-24T16:12:19.1978779Z ................................................................iiiii............................... 1900/9038
2019-09-24T16:12:39.5374034Z .................................................................................................... 2100/9038
2019-09-24T16:12:42.2489316Z .................................................................................................... 2200/9038
2019-09-24T16:12:45.7294843Z .................................................................................................... 2300/9038
2019-09-24T16:12:54.6803186Z .................................................................................................... 2400/9038
---
2019-09-24T16:15:59.3542557Z .....................................................i...............i.............................. 4700/9038
2019-09-24T16:16:09.1588639Z .................................................................................................... 4800/9038
2019-09-24T16:16:17.8439863Z .................................................................................................... 4900/9038
2019-09-24T16:16:25.6002597Z .................................................................................................... 5000/9038
2019-09-24T16:16:35.5751186Z ........................................ii.ii....................................................... 5100/9038
2019-09-24T16:16:46.2575800Z .................................................................................................... 5300/9038
2019-09-24T16:16:57.2851819Z .................................................................................................... 5400/9038
2019-09-24T16:17:05.3641085Z .....i.............................................................................................. 5500/9038
2019-09-24T16:17:10.9276601Z .................................................................................................... 5600/9038
2019-09-24T16:17:10.9276601Z .................................................................................................... 5600/9038
2019-09-24T16:17:23.1811257Z .................................................................................................... 5700/9038
2019-09-24T16:17:36.8353570Z ii...i..ii...........i.............................................................................. 5800/9038
2019-09-24T16:17:59.4992816Z .................................................................................................... 6000/9038
2019-09-24T16:18:06.7429120Z .................................................................................................... 6100/9038
2019-09-24T16:18:06.7429120Z .................................................................................................... 6100/9038
2019-09-24T16:18:21.7066587Z ..i..ii............................................................................................. 6200/9038
2019-09-24T16:18:41.4005866Z ..............................................................i..................................... 6400/9038
2019-09-24T16:18:43.8453485Z .................................................................................................... 6500/9038
2019-09-24T16:18:46.5668796Z ..................................i................................................................. 6600/9038
2019-09-24T16:18:51.0304021Z .................................................................................................... 6700/9038
---
2019-09-24T16:23:31.5979491Z  finished in 5.582
2019-09-24T16:23:31.6185862Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T16:23:31.7892682Z 
2019-09-24T16:23:31.7892963Z running 150 tests
2019-09-24T16:23:35.2783658Z i....iii......iii..iiii....i.............................i..i..................i....i.........ii.i.i 100/150
2019-09-24T16:23:37.3505309Z ..iiii..............i.........iii.i.......ii......
2019-09-24T16:23:37.3509085Z 
2019-09-24T16:23:37.3509780Z  finished in 5.732
2019-09-24T16:23:37.3701698Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T16:23:37.5313520Z 
---
2019-09-24T16:23:39.7631737Z  finished in 2.392
2019-09-24T16:23:39.7829519Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T16:23:39.9435723Z 
2019-09-24T16:23:39.9436012Z running 9 tests
2019-09-24T16:23:39.9436771Z iiiiiiiii
2019-09-24T16:23:39.9437080Z 
2019-09-24T16:23:39.9437118Z  finished in 0.160
2019-09-24T16:23:39.9620434Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T16:23:40.1269094Z 
---
2019-09-24T16:23:59.1176238Z  finished in 19.155
2019-09-24T16:23:59.1402503Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T16:23:59.3097346Z 
2019-09-24T16:23:59.3097583Z running 123 tests
2019-09-24T16:24:25.2751735Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i...ii...i.......ii. 100/123
2019-09-24T16:24:30.2276692Z i.i.i......iii.i.....ii
2019-09-24T16:24:30.2277261Z 
2019-09-24T16:24:30.2282642Z  finished in 31.088
2019-09-24T16:24:30.2295478Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T16:24:30.2295864Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-09-24T16:37:42.4812625Z 
2019-09-24T16:37:42.4813815Z    Doc-tests core
2019-09-24T16:37:47.7522840Z 
2019-09-24T16:37:47.7523875Z running 2405 tests
2019-09-24T16:37:59.6477522Z ......iiiii......................................................................................... 100/2405
2019-09-24T16:38:11.0557043Z ...............................................................................ii................... 200/2405
2019-09-24T16:38:38.2363076Z .i.................................................................................................. 400/2405
2019-09-24T16:38:38.2363076Z .i.................................................................................................. 400/2405
2019-09-24T16:38:49.5119291Z ................................................i..i.................iiii........F.................. 500/2405
2019-09-24T16:39:11.3827867Z .................................................................................................... 700/2405
2019-09-24T16:39:23.0805293Z .................................................................................................... 800/2405
2019-09-24T16:39:34.3446008Z .................................................................................................... 900/2405
2019-09-24T16:39:45.6184852Z .................................................................................................... 1000/2405
---
2019-09-24T16:42:30.8787729Z ---- macros.rs - unimplemented (line 552) stdout ----
2019-09-24T16:42:30.8787822Z error: unused `std::result::Result` that must be used
2019-09-24T16:42:30.8788044Z   --> macros.rs:584:5
2019-09-24T16:42:30.8788106Z    |
2019-09-24T16:42:30.8788144Z 34 |     s.qux();
2019-09-24T16:42:30.8788217Z    |
2019-09-24T16:42:30.8788273Z note: lint level defined here
2019-09-24T16:42:30.8788469Z   --> macros.rs:551:9
2019-09-24T16:42:30.8788508Z    |
2019-09-24T16:42:30.8788508Z    |
2019-09-24T16:42:30.8788562Z 1  | #![deny(warnings)]
2019-09-24T16:42:30.8788600Z    |         ^^^^^^^^
2019-09-24T16:42:30.8788644Z    = note: `#[deny(unused_must_use)]` implied by `#[deny(warnings)]`
2019-09-24T16:42:30.8788955Z    = note: this `Result` may be an `Err` variant, which should be handled
2019-09-24T16:42:30.8789043Z error: aborting due to previous error
2019-09-24T16:42:30.8789069Z 
2019-09-24T16:42:30.8789312Z Couldn't compile the test.
2019-09-24T16:42:30.8791486Z 
---
2019-09-24T16:42:30.8799211Z 
2019-09-24T16:42:30.8847682Z error: test failed, to rerun pass '--doc'
2019-09-24T16:42:30.8867049Z 
2019-09-24T16:42:30.8867366Z 
2019-09-24T16:42:30.8868197Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "core" "--" "--quiet"
2019-09-24T16:42:30.8873659Z 
2019-09-24T16:42:30.8873855Z 
2019-09-24T16:42:30.8885468Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-09-24T16:42:30.8885776Z Build completed unsuccessfully in 1:27:17
2019-09-24T16:42:30.8885776Z Build completed unsuccessfully in 1:27:17
2019-09-24T16:42:30.8940447Z == clock drift check ==
2019-09-24T16:42:30.8958467Z   local time: Tue Sep 24 16:42:30 UTC 2019
2019-09-24T16:42:31.0482350Z   network time: Tue, 24 Sep 2019 16:42:31 GMT
2019-09-24T16:42:31.0482523Z == end clock drift check ==
2019-09-24T16:42:31.7126962Z ##[error]Bash exited with code '1'.
2019-09-24T16:42:31.7167198Z ##[section]Starting: Checkout
2019-09-24T16:42:31.7169296Z ==============================================================================
2019-09-24T16:42:31.7169348Z Task         : Get sources
2019-09-24T16:42:31.7169392Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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.
2019-09-24T16:48:41.7054498Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-24T16:48:41.7263028Z ##[command]git config gc.auto 0
2019-09-24T16:48:41.7349481Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-24T16:48:41.7426326Z ##[command]git config --get-all http.proxy
2019-09-24T16:48:41.7568258Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64726/merge:refs/remotes/pull/64726/merge
---
2019-09-24T17:52:21.0519323Z .................................................................................................... 1500/9038
2019-09-24T17:52:27.2447009Z .................................................................................................... 1600/9038
2019-09-24T17:52:39.6815145Z .........................................................................i...............i.......... 1700/9038
2019-09-24T17:52:46.6809392Z .................................................................................................... 1800/9038
2019-09-24T17:52:55.2928531Z ................................................................iiiii............................... 1900/9038
2019-09-24T17:53:14.9847461Z .................................................................................................... 2100/9038
2019-09-24T17:53:17.5772811Z .................................................................................................... 2200/9038
2019-09-24T17:53:20.9090652Z .................................................................................................... 2300/9038
2019-09-24T17:53:29.4986500Z .................................................................................................... 2400/9038
---
2019-09-24T17:56:29.1627572Z .....................................................i...............i.............................. 4700/9038
2019-09-24T17:56:38.5612674Z .................................................................................................... 4800/9038
2019-09-24T17:56:47.2057982Z .................................................................................................... 4900/9038
2019-09-24T17:56:54.7644837Z .................................................................................................... 5000/9038
2019-09-24T17:57:04.5364929Z ........................................ii.ii....................................................... 5100/9038
2019-09-24T17:57:14.6349897Z .................................................................................................... 5300/9038
2019-09-24T17:57:25.3509498Z .................................................................................................... 5400/9038
2019-09-24T17:57:32.8833885Z .....i.............................................................................................. 5500/9038
2019-09-24T17:57:38.1957656Z .................................................................................................... 5600/9038
2019-09-24T17:57:38.1957656Z .................................................................................................... 5600/9038
2019-09-24T17:57:49.9938253Z .................................................................................................... 5700/9038
2019-09-24T17:58:03.1603574Z ii...i..ii...........i.............................................................................. 5800/9038
2019-09-24T17:58:24.8241699Z .................................................................................................... 6000/9038
2019-09-24T17:58:34.1264930Z .................................................................................................... 6100/9038
2019-09-24T17:58:34.1264930Z .................................................................................................... 6100/9038
2019-09-24T17:58:48.8507138Z ..i..ii............................................................................................. 6200/9038
2019-09-24T17:59:07.7404456Z ..............................................................i..................................... 6400/9038
2019-09-24T17:59:10.0024953Z .................................................................................................... 6500/9038
2019-09-24T17:59:12.5826127Z ..................................i................................................................. 6600/9038
2019-09-24T17:59:16.7379254Z .................................................................................................... 6700/9038
---
2019-09-24T18:03:50.6057174Z  finished in 5.341
2019-09-24T18:03:50.6255638Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T18:03:50.7909472Z 
2019-09-24T18:03:50.7910322Z running 150 tests
2019-09-24T18:03:54.1260442Z i....iii......iii..iiii....i.............................i..i..................i....i.........ii.i.i 100/150
2019-09-24T18:03:56.1401436Z ..iiii..............i.........iii.i.......ii......
2019-09-24T18:03:56.1402943Z 
2019-09-24T18:03:56.1407965Z  finished in 5.515
2019-09-24T18:03:56.1603625Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T18:03:56.3221455Z 
---
2019-09-24T18:03:59.2722683Z  finished in 2.252
2019-09-24T18:03:59.2723260Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T18:03:59.2723339Z 
2019-09-24T18:03:59.2723409Z running 9 tests
2019-09-24T18:03:59.2723971Z iiiiiiiii
2019-09-24T18:03:59.2724330Z 
2019-09-24T18:03:59.2724373Z  finished in 0.164
2019-09-24T18:03:59.2725034Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T18:03:59.2725083Z 
---
2019-09-24T18:04:17.7681713Z  finished in 18.454
2019-09-24T18:04:17.7682199Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T18:04:17.7682401Z 
2019-09-24T18:04:17.7682559Z running 123 tests
2019-09-24T18:04:42.0240855Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i...ii...i.......ii. 100/123
2019-09-24T18:04:46.8112973Z i.i.i......iii.i.....ii
2019-09-24T18:04:46.8117095Z 
2019-09-24T18:04:46.8118132Z  finished in 29.720
2019-09-24T18:04:46.8135332Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-09-24T18:04:46.8381813Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-09-24T18:18:03.5495479Z 
2019-09-24T18:18:03.5496334Z    Doc-tests core
2019-09-24T18:18:08.7784090Z 
2019-09-24T18:18:08.7785017Z running 2405 tests
2019-09-24T18:18:20.4565513Z ......iiiii......................................................................................... 100/2405
2019-09-24T18:18:31.7552201Z ...............................................................................ii................... 200/2405
2019-09-24T18:18:58.5777903Z .i.................................................................................................. 400/2405
2019-09-24T18:18:58.5777903Z .i.................................................................................................. 400/2405
2019-09-24T18:19:09.7062344Z ................................................i..i.................iiii.........F................. 500/2405
2019-09-24T18:19:31.1953637Z .................................................................................................... 700/2405
2019-09-24T18:19:42.2525140Z .................................................................................................... 800/2405
2019-09-24T18:19:53.4574162Z .................................................................................................... 900/2405
2019-09-24T18:20:04.3977887Z .................................................................................................... 1000/2405
---
2019-09-24T18:22:45.7795286Z ---- macros.rs - unimplemented (line 552) stdout ----
2019-09-24T18:22:45.7795352Z Test executable failed (exit code 101).
2019-09-24T18:22:45.7795383Z 
2019-09-24T18:22:45.7795424Z stderr:
2019-09-24T18:22:45.7795779Z thread 'main' panicked at 'not yet implemented: we need to divide by 2', macros.rs:28:9
2019-09-24T18:22:45.7795874Z 
2019-09-24T18:22:45.7795900Z 
2019-09-24T18:22:45.7795944Z 
2019-09-24T18:22:45.7795986Z failures:
2019-09-24T18:22:45.7795986Z failures:
2019-09-24T18:22:45.7796225Z     macros.rs - unimplemented (line 552)
2019-09-24T18:22:45.7796258Z 
2019-09-24T18:22:45.7796325Z test result: FAILED. 2389 passed; 1 failed; 15 ignored; 0 measured; 0 filtered out
2019-09-24T18:22:45.7796358Z 
2019-09-24T18:22:45.7840318Z error: test failed, to rerun pass '--doc'
2019-09-24T18:22:45.7855898Z 
2019-09-24T18:22:45.7856000Z 
2019-09-24T18:22:45.7856822Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "core" "--" "--quiet"
2019-09-24T18:22:45.7856945Z 
2019-09-24T18:22:45.7856992Z 
2019-09-24T18:22:45.7868747Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-09-24T18:22:45.7868833Z Build completed unsuccessfully in 1:26:30
2019-09-24T18:22:45.7868833Z Build completed unsuccessfully in 1:26:30
2019-09-24T18:22:45.7924332Z == clock drift check ==
2019-09-24T18:22:45.7943993Z   local time: Tue Sep 24 18:22:45 UTC 2019
2019-09-24T18:22:45.9459475Z   network time: Tue, 24 Sep 2019 18:22:45 GMT
2019-09-24T18:22:45.9460436Z == end clock drift check ==
2019-09-24T18:22:46.7082814Z ##[error]Bash exited with code '1'.
2019-09-24T18:22:46.7125585Z ##[section]Starting: Checkout
2019-09-24T18:22:46.7127455Z ==============================================================================
2019-09-24T18:22:46.7127530Z Task         : Get sources
2019-09-24T18:22:46.7127577Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@andrewbanchich
Copy link
Contributor Author

r? @hellow554

@JohnCSimon
Copy link
Member

Ping from triage.
This PR has sat idle for the last few days
@hellow554 Can you please review this PR?

@rkruppe @andrewbanchich
Thank you!

@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented Oct 5, 2019

Oops, this slipped under my radar, sorry! I don't think @hellow554 has power over @bors so although their review is much appreciated they ultimately can't merge the PR. I'll take a look now.

Copy link
Contributor

@hanna-kruppe hanna-kruppe left a comment

Choose a reason for hiding this comment

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

I think it's great to be more explicit about what the macro does exactly and to mention how it accepts extra arguments. Thanks for the PR and sorry again for not responding earlier.

But I'm a bit conflicted about other parts of this diff which seem neutral or negative to me (see notes below). On the other hand, some of that is subjective and I certainly don't want a bikeshed out of it. I guess I'll make some suggestions and if you agree you can incorporate them and if not I'll just shrug and merge anyway (for the subjective stuff, there is one small thing I do care strongly about).

src/libcore/macros.rs Show resolved Hide resolved
src/libcore/macros.rs Outdated Show resolved Hide resolved
src/libcore/macros.rs Show resolved Hide resolved
src/libcore/macros.rs Outdated Show resolved Hide resolved
@hanna-kruppe
Copy link
Contributor

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 7, 2019

📌 Commit b7091e4 has been approved by rkruppe

@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 Oct 7, 2019
@andrewbanchich
Copy link
Contributor Author

@rkruppe I think it still needs you to accept the changes in your review.

Centril added a commit to Centril/rust that referenced this pull request Oct 8, 2019
…uppe

rewrite documentation for unimplemented! to clarify use

The current docs for `unimplemented!` seem to miss the point of this macro.

> This can be useful if you are prototyping and are just looking to have your code type-check, or if you're implementing a trait that requires multiple methods, and you're only planning on using one of them.

You could also return a `()` if you just want your code to type-check.

I think `unimplemented!` is useful for when you want your program to exit when it reaches an unimplemented area.

I rewrote the explanation and gave examples of both forms of this macro that I think clarify its use a little better.
bors added a commit that referenced this pull request Oct 8, 2019
Rollup of 8 pull requests

Successful merges:

 - #64726 (rewrite documentation for unimplemented! to clarify use)
 - #65040 (syntax: more cleanups in item and function signature parsing)
 - #65046 (Make `Cell::new` method come first in documentation)
 - #65098 (Add long error explanation for E0561)
 - #65150 (Suggest dereferencing boolean reference when used in 'if' or 'while')
 - #65154 (Fix const generic arguments not displaying in types mismatch diagnostic)
 - #65181 (fix bug in folding for constants)
 - #65187 (use 'invalid argument' for vxWorks)

Failed merges:

 - #65179 (Add long error explanation for E0567)

r? @ghost
@bors bors merged commit b7091e4 into rust-lang:master Oct 8, 2019
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants