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

Rollup of 6 pull requests #69720

Closed
wants to merge 18 commits into from

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

ecstatic-morse and others added 18 commits March 3, 2020 11:26
PR rust-lang#69562, which fixed a bug that was causing clippy to ICE, passed the
place for the *result* of `Rvalue::Discriminant` instead of the
*operand* to `apply_discriminant_switch_effect`. As a result, no effect
was applied at all, and we lost the perf benefits from marking
inactive enum variants as uninitialized.
The Result can be expect-unwrapped directly. (clippy::ok_expect)
…nd anything.

For example:  `if let Some(_) = foo() {}`	can be reduced to	`if foo().is_some() {}`   (clippy::redundant_pattern_matching)
… type.

These were introduced since I last fixed most of these occurences. (clippy::clone_on_copy, clippy::single_char_pattern)
Update books

## nomicon

8 commits in 3e6e1001dc6e095dbd5c88005e80969f60e384e1..9f797e65e6bcc79419975b17aff8e21c9adc039f
2019-12-14 22:08:52 +0000 to 2020-03-04 03:45:13 +0100
- Rustup to latest rustc (rust-lang/nomicon#203)
- (minor) Add backticks around type names (rust-lang/nomicon#197)
- Add book.toml (rust-lang/nomicon#185)
- Rename `Alloc` to `AllocRef` (rust-lang/nomicon#188)
- Lifetimes: explain how to fix destructor example (rust-lang/nomicon#195)
- mention soundness (rust-lang/nomicon#194)
- Fix example in FFI section Calling Rust from C (rust-lang/nomicon#193)
- Removed repeated word (rust-lang/nomicon#191)

## reference

8 commits in 64239df..559e09c
2020-02-10 19:05:13 +0100 to 2020-03-02 01:17:14 +0100
- Syntax error fix (rust-lang/reference#769)
- Fix incorrect pseudocode for #[repr(C)] struct alignment (rust-lang/reference#766)
- Replace "Field-Less" with "Fieldless" (rust-lang/reference#768)
- Removed repeated word (rust-lang/reference#767)
- Update for change in const lint name. (rust-lang/reference#764)
- semantic type -> resolved type (rust-lang/reference#761)
- add behavior change of relative paths without `self` in 2018 edition (rust-lang/reference#757)
- assignment operator expressions -> compound assignment expressions (rust-lang/reference#759)

## rust-by-example

3 commits in 32facd5522ddbbf37baf01e4e4b6562bc55c071a..db57f899ea2a56a544c8d280cbf033438666273d
2020-02-11 09:25:06 -0300 to 2020-02-18 17:46:46 -0300
- Minor typo fix in src/mod/visibility (rust-lang/rust-by-example#1309)
- Don't suggest Into implements a reverse conversion (rust-lang/rust-by-example#1307)
- Improve grammar in example of 'in let' section (rust-lang/rust-by-example#1308)

## embedded-book

2 commits in b2e1092bf67bd4d7686c4553f186edbb7f5f92db..b81ffb7a6f4c5aaed92786e770e99db116aa4ebd
2020-01-30 08:45:46 +0000 to 2020-02-27 08:06:04 +0000
- Setting output to `high` needs a `true` argument  (rust-embedded/book#227)
- Add licence notes to index.md  (rust-embedded/book#226)
…t, r=oli-obk

Pass correct place to `discriminant_switch_effect`

PR rust-lang#69562, which fixed a bug that was causing clippy to ICE, mistakenly passed the place holding the *result* of `Rvalue::Discriminant` instead of the place holding its *operand* to `apply_discriminant_switch_effect` as the enum place. As a result, no effect was applied at all, and we lost the perf benefits from marking inactive enum variants as uninitialized.

This PR corrects that mistake and adds a regression test to `mir-opt`. I fear that the regression test may prove too brittle; the test schema makes hard to test for the *absence* of certain kinds of MIR without exhaustively matching each basic block.

r? @oli-obk
Use associated constants of integer types

Take advantage of rust-lang#68952 in the interpreter and some nearby modules :)
more clippy cleanups

* Don't use .ok() before unwrapping via .expect() on a Result.
* Use .map() to modify data inside Options instead of using .and_then(|x| Some(y))
* Use .as_deref() instead of .as_ref().map(Deref::deref)
* Don't use "if let" bindings to only check a value and not actually bind anything.
* Use single-char patter on {ends,starts}_with and remove clone on copy type.
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Mar 4, 2020

📌 Commit 251ac68 has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 4, 2020
@Dylan-DPC-zz Dylan-DPC-zz added the rollup A PR which is a rollup label Mar 5, 2020
@Dylan-DPC-zz
Copy link
Author

@bors r+

@bors
Copy link
Contributor

bors commented Mar 5, 2020

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Mar 5, 2020

📌 Commit 251ac68 has been approved by Dylan-DPC

@Dylan-DPC-zz
Copy link
Author

@bors r+

@bors
Copy link
Contributor

bors commented Mar 5, 2020

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Mar 5, 2020

📌 Commit 251ac68 has been approved by Dylan-DPC

@bors
Copy link
Contributor

bors commented Mar 5, 2020

⌛ Testing commit 251ac68 with merge 6eb76db0490e6d61deca6ee56ef4b577f525d358...

@rust-highfive
Copy link
Collaborator

The job test-various 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.
2020-03-05T03:42:26.5137563Z test [mir-opt] mir-opt/while-storage.rs ... ok
2020-03-05T03:42:26.5137888Z 
2020-03-05T03:42:26.5138080Z failures:
2020-03-05T03:42:26.5148020Z 
2020-03-05T03:42:26.5148765Z ---- [mir-opt] mir-opt/no-drop-for-inactive-variant.rs stdout ----
2020-03-05T03:42:26.5151034Z thread '[mir-opt] mir-opt/no-drop-for-inactive-variant.rs' panicked at 'Did not find expected line, error: ran out of mir dump to match against
2020-03-05T03:42:26.5152706Z Expected Line: "        switchInt(move _2) -> [0isize: bb2, 1isize: bb4, otherwise: bb3];"
2020-03-05T03:42:26.5153356Z Test Name: rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir
2020-03-05T03:42:26.5153800Z ... (elided)
2020-03-05T03:42:26.5153800Z ... (elided)
2020-03-05T03:42:26.5154237Z fn unwrap(_1: std::option::Option<T>) -> T {
2020-03-05T03:42:26.5154491Z ... (elided)
2020-03-05T03:42:26.5154679Z     bb0: {
2020-03-05T03:42:26.5154853Z ... (elided)
2020-03-05T03:42:26.5155364Z         switchInt(move _2) -> [0isize: bb2, 1isize: bb4, otherwise: bb3];
2020-03-05T03:42:26.5155668Z     }
2020-03-05T03:42:26.5155865Z     bb1 (cleanup): {
2020-03-05T03:42:26.5156069Z         resume;
2020-03-05T03:42:26.5156409Z     bb2: {
2020-03-05T03:42:26.5156597Z ... (elided)
2020-03-05T03:42:26.5156597Z ... (elided)
2020-03-05T03:42:26.5157116Z         const std::rt::begin_panic::<&'static str>(const "explicit panic") -> bb5;
2020-03-05T03:42:26.5157601Z     bb3: {
2020-03-05T03:42:26.5157790Z         unreachable;
2020-03-05T03:42:26.5157978Z     }
2020-03-05T03:42:26.5158137Z     bb4: {
2020-03-05T03:42:26.5158137Z     bb4: {
2020-03-05T03:42:26.5158320Z ... (elided)
2020-03-05T03:42:26.5158498Z         return;
2020-03-05T03:42:26.5158676Z     }
2020-03-05T03:42:26.5158860Z     bb5 (cleanup): {
2020-03-05T03:42:26.5159238Z         drop(_1) -> bb1;
2020-03-05T03:42:26.5159580Z }
2020-03-05T03:42:26.5159721Z Actual:
2020-03-05T03:42:26.5159721Z Actual:
2020-03-05T03:42:26.5160132Z fn  unwrap(_1: std::option::Option<T>) -> T {
2020-03-05T03:42:26.5160407Z     debug opt => _1;
2020-03-05T03:42:26.5160844Z     let mut _2: isize;
2020-03-05T03:42:26.5161053Z     let _3: T;
2020-03-05T03:42:26.5161271Z     let mut _4: !;
2020-03-05T03:42:26.5161489Z     let mut _5: isize;
2020-03-05T03:42:26.5161489Z     let mut _5: isize;
2020-03-05T03:42:26.5161726Z     let mut _6: isize;
2020-03-05T03:42:26.5162268Z     scope 1 {
2020-03-05T03:42:26.5162479Z         debug x => _3;
2020-03-05T03:42:26.5162655Z     }
2020-03-05T03:42:26.5162826Z     bb0: {
2020-03-05T03:42:26.5163040Z         _2 = discriminant(_1);
2020-03-05T03:42:26.5164387Z         switchInt(move _2) -> [0isize: bb1, 1isize: bb3, otherwise: bb2];
2020-03-05T03:42:26.5164869Z     bb1: {
2020-03-05T03:42:26.5165252Z         StorageLive(_4);
2020-03-05T03:42:26.5165252Z         StorageLive(_4);
2020-03-05T03:42:26.5165788Z         const std::rt::begin_panic::<&'static str>(const "explicit panic");
2020-03-05T03:42:26.5166342Z     bb2: {
2020-03-05T03:42:26.5166543Z         unreachable;
2020-03-05T03:42:26.5166717Z     }
2020-03-05T03:42:26.5166887Z     bb3: {
2020-03-05T03:42:26.5166887Z     bb3: {
2020-03-05T03:42:26.5167079Z         StorageLive(_3);
2020-03-05T03:42:26.5167349Z         _3 = move ((_1 as Some).0: T);
2020-03-05T03:42:26.5167614Z         _0 = move _3;
2020-03-05T03:42:26.5167824Z         StorageDead(_3);
2020-03-05T03:42:26.5168064Z         _5 = discriminant(_1);
2020-03-05T03:42:26.5168452Z     }
2020-03-05T03:42:26.5168865Z }', src/tools/compiletest/src/runtest.rs:3133:13
2020-03-05T03:42:26.5169241Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-03-05T03:42:26.5169485Z 
---
2020-03-05T03:42:26.5171169Z 
2020-03-05T03:42:26.5171655Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-03-05T03:42:26.5171938Z 
2020-03-05T03:42:26.5172042Z 
2020-03-05T03:42:26.5175961Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-wasm32-unknown-unknown" "--mode" "mir-opt" "--target" "wasm32-unknown-unknown" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/node-v9.2.0-linux-x64/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "9.0.1-rust-1.43.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-03-05T03:42:26.5178819Z 
2020-03-05T03:42:26.5178924Z 
2020-03-05T03:42:26.5179735Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-unknown src/test/run-make src/test/ui src/test/compile-fail src/test/mir-opt src/test/codegen-units src/libcore
2020-03-05T03:42:26.5180318Z Build completed unsuccessfully in 1:22:27
2020-03-05T03:42:26.5180318Z Build completed unsuccessfully in 1:22:27
2020-03-05T03:42:26.5227014Z == clock drift check ==
2020-03-05T03:42:26.5246792Z   local time: Thu Mar  5 03:42:26 UTC 2020
2020-03-05T03:42:27.0674582Z   network time: Thu, 05 Mar 2020 03:42:27 GMT
2020-03-05T03:42:27.0675047Z == end clock drift check ==
2020-03-05T03:42:29.4035683Z 
2020-03-05T03:42:29.4107198Z ##[error]Bash exited with code '1'.
2020-03-05T03:42:29.4188485Z ##[section]Starting: Checkout rust-lang/rust@auto to s
2020-03-05T03:42:29.4193699Z ==============================================================================
2020-03-05T03:42:29.4194089Z Task         : Get sources
2020-03-05T03:42:29.4194482Z 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 @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Mar 5, 2020

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 5, 2020
@JohnTitor
Copy link
Member

Left a comment to the PR, closing.

@JohnTitor JohnTitor closed this Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.