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 5 pull requests #63412

Closed
wants to merge 32 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Aug 9, 2019

Successful merges:

Failed merges:

r? @ghost

RalfJung and others added 30 commits August 6, 2019 23:11
Hard-float (unlike mips32 musl targets but consistent with any other
musl target), MIPS64r2, n64 ABI.
…ichton

Add builtin targets for mips64(el)-unknown-linux-musl

This is prerequisite for rust-lang/libc#1449.

Tested locally to produce working static and dynamic binaries, ~~but CI config is untested for now~~ CI is to be added in a follow-up PR.

*edit: dynamic binaries also confirmed working!*
Tweak mismatched types error

- Change expected/found for type mismatches in `break`
- Be more accurate when talking about diverging match arms
- Tweak wording of function without a return value
- Suggest calling bare functions when their return value can be coerced to the expected type
- Give more parsing errors when encountering `foo(_, _, _)`

Fix rust-lang#51767, fix rust-lang#62677, fix rust-lang#63136, cc rust-lang#37384, cc rust-lang#35241.
Lint on some incorrect uses of mem::zeroed / mem::uninitialized

Cc rust-lang#62825 and https://internals.rust-lang.org/t/make-mem-uninitialized-and-mem-zeroed-panic-for-some-types-where-0-is-a-niche/10605

This does not yet handle `NonNull`/`NonZero*`, but it is a start.

I also improved some doc issues I hit on the way, and added a useful helper to `TyS`.
…s, r=Centril

Use associated_type_bounds where applicable - closes rust-lang#61738
…vink

Add test for issue 36804

I slightly reduced the repro that ICEs on nightly-2017-01-20.

Closes rust-lang#36804
@Centril
Copy link
Contributor Author

Centril commented Aug 9, 2019

@bors r+ p=5 rollup=never

@bors
Copy link
Contributor

bors commented Aug 9, 2019

📌 Commit 56d3742 has been approved by Centril

@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 Aug 9, 2019
@bors
Copy link
Contributor

bors commented Aug 9, 2019

⌛ Testing commit 56d3742 with merge f514b9d29859bb40a0554f49b11e4541fd97088a...

@bors
Copy link
Contributor

bors commented Aug 9, 2019

💔 Test failed - checks-azure

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed (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-08-09T15:56:03.3741410Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-09T15:56:03.3741619Z 
2019-08-09T15:56:03.3741988Z   git checkout -b <new-branch-name>
2019-08-09T15:56:03.3742154Z 
2019-08-09T15:56:03.3742607Z HEAD is now at f514b9d29 Auto merge of #63412 - Centril:rollup-5lvzexh, r=Centril
2019-08-09T15:56:03.3890421Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-09T15:56:03.3893189Z ==============================================================================
2019-08-09T15:56:03.3893288Z Task         : Bash
2019-08-09T15:56:03.3893351Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-09T17:42:11.3691386Z [RUSTC-TIMING] mdbook_linkcheck test:false 5.659
2019-08-09T17:42:11.3696863Z    Compiling rustbook v0.1.0 (/checkout/src/tools/rustbook)
2019-08-09T17:42:16.0070923Z [RUSTC-TIMING] rustbook test:false 4.367
2019-08-09T17:42:16.0072549Z     Finished release [optimized] target(s) in 8m 10s
2019-08-09T17:42:16.0073258Z [TIMING] ToolBuild { compiler: Compiler { stage: 0, host: "x86_64-unknown-linux-gnu" }, target: "x86_64-unknown-linux-gnu", tool: "rustbook", path: "src/tools/rustbook", mode: ToolBootstrap, is_optional_tool: false, source_type: InTree, extra_features: ["linkcheck"] } -- 490.572
2019-08-09T17:43:57.9346027Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-08-09T17:43:57.9346469Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
2019-08-09T17:43:57.9392880Z Building stage2 tool clippy-driver (x86_64-unknown-linux-gnu)
2019-08-09T17:43:58.2786309Z    Compiling proc-macro2 v0.4.30
---
2019-08-09T18:03:47.8670755Z    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8670830Z    |
2019-08-09T18:03:47.8671190Z    = help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
2019-08-09T18:03:47.8671263Z 
2019-08-09T18:03:47.8671524Z error: the type `&T` does not permit zero-initialization
2019-08-09T18:03:47.8671834Z    |
2019-08-09T18:03:47.8671900Z LL |     let ref_zero: &T = std::mem::zeroed(); // warning
2019-08-09T18:03:47.8671990Z    |                        ^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8672053Z    |
2019-08-09T18:03:47.8672053Z    |
2019-08-09T18:03:47.8672312Z    = note: `-D invalid-value` implied by `-D warnings`
2019-08-09T18:03:47.8672398Z    = note: this means that this code causes undefined behavior when executed
2019-08-09T18:03:47.8672531Z 
2019-08-09T18:03:47.8672531Z 
2019-08-09T18:03:47.8672898Z error: the type `&T` does not permit zero-initialization
2019-08-09T18:03:47.8673208Z    |
2019-08-09T18:03:47.8673271Z LL |     let ref_zero: &T = core::mem::zeroed(); // warning
2019-08-09T18:03:47.8673455Z    |                        ^^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8673528Z    |
2019-08-09T18:03:47.8673528Z    |
2019-08-09T18:03:47.8673609Z    = note: this means that this code causes undefined behavior when executed
2019-08-09T18:03:47.8673683Z    = help: use `MaybeUninit` instead
2019-08-09T18:03:47.8673723Z 
2019-08-09T18:03:47.8673801Z error: the type `&T` does not permit being left uninitialized
2019-08-09T18:03:47.8674144Z    |
2019-08-09T18:03:47.8674208Z LL |     let ref_uninit: &T = std::mem::uninitialized(); // warning
2019-08-09T18:03:47.8674299Z    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8674361Z    |
2019-08-09T18:03:47.8674361Z    |
2019-08-09T18:03:47.8674441Z    = note: this means that this code causes undefined behavior when executed
2019-08-09T18:03:47.8674512Z    = help: use `MaybeUninit` instead
2019-08-09T18:03:47.8674577Z 
2019-08-09T18:03:47.8674639Z error: the type `&T` does not permit being left uninitialized
2019-08-09T18:03:47.8674957Z    |
2019-08-09T18:03:47.8675037Z LL |     let ref_uninit: &T = core::mem::uninitialized(); // warning
2019-08-09T18:03:47.8675113Z    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8675190Z    |
---
2019-08-09T18:03:47.8686598Z     |
2019-08-09T18:03:47.8686922Z     = help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html
2019-08-09T18:03:47.8687025Z  
2019-08-09T18:03:47.8687250Z -error: aborting due to 5 previous errors
2019-08-09T18:03:47.8687511Z +error: the type `&T` does not permit zero-initialization
2019-08-09T18:03:47.8687821Z +   |
2019-08-09T18:03:47.8687884Z +LL |     let ref_zero: &T = std::mem::zeroed(); // warning
2019-08-09T18:03:47.8688045Z +   |                        ^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8688116Z +   |
2019-08-09T18:03:47.8688116Z +   |
2019-08-09T18:03:47.8688391Z +   = note: `-D invalid-value` implied by `-D warnings`
2019-08-09T18:03:47.8688471Z +   = note: this means that this code causes undefined behavior when executed
2019-08-09T18:03:47.8688619Z +
2019-08-09T18:03:47.8688619Z +
2019-08-09T18:03:47.8688994Z +error: the type `&T` does not permit zero-initialization
2019-08-09T18:03:47.8689419Z +   |
2019-08-09T18:03:47.8689484Z +LL |     let ref_zero: &T = core::mem::zeroed(); // warning
2019-08-09T18:03:47.8689571Z +   |                        ^^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8689635Z +   |
2019-08-09T18:03:47.8689635Z +   |
2019-08-09T18:03:47.8689716Z +   = note: this means that this code causes undefined behavior when executed
2019-08-09T18:03:47.8689799Z +   = help: use `MaybeUninit` instead
2019-08-09T18:03:47.8689873Z +
2019-08-09T18:03:47.8689945Z +error: the type `&T` does not permit being left uninitialized
2019-08-09T18:03:47.8690275Z +   |
2019-08-09T18:03:47.8690356Z +LL |     let ref_uninit: &T = std::mem::uninitialized(); // warning
2019-08-09T18:03:47.8690448Z +   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8690514Z +   |
2019-08-09T18:03:47.8690514Z +   |
2019-08-09T18:03:47.8690595Z +   = note: this means that this code causes undefined behavior when executed
2019-08-09T18:03:47.8690669Z +   = help: use `MaybeUninit` instead
2019-08-09T18:03:47.8690744Z +
2019-08-09T18:03:47.8690810Z +error: the type `&T` does not permit being left uninitialized
2019-08-09T18:03:47.8691131Z +   |
2019-08-09T18:03:47.8691210Z +LL |     let ref_uninit: &T = core::mem::uninitialized(); // warning
2019-08-09T18:03:47.8691290Z +   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
2019-08-09T18:03:47.8691462Z +   |
---
2019-08-09T18:03:47.8700498Z {"message":"reference to zeroed memory","code":{"code":"clippy::invalid_ref","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/invalid_ref.rs","byte_start":598,"byte_end":617,"line_start":27,"line_end":27,"column_start":24,"column_end":43,"is_primary":true,"text":[{"text":"    let ref_zero: &T = core::mem::zeroed(); // warning","highlight_start":24,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: reference to zeroed memory\n  --> tests/ui/invalid_ref.rs:27:24\n   |\nLL |     let ref_zero: &T = core::mem::zeroed(); // warning\n   |                        ^^^^^^^^^^^^^^^^^^^\n   |\n   = help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html\n\n"}
2019-08-09T18:03:47.8702403Z {"message":"reference to zeroed memory","code":{"code":"clippy::invalid_ref","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/invalid_ref.rs","byte_start":705,"byte_end":728,"line_start":31,"line_end":31,"column_start":24,"column_end":47,"is_primary":true,"text":[{"text":"    let ref_zero: &T = std::intrinsics::init(); // warning","highlight_start":24,"highlight_end":47}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: reference to zeroed memory\n  --> tests/ui/invalid_ref.rs:31:24\n   |\nLL |     let ref_zero: &T = std::intrinsics::init(); // warning\n   |                        ^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html\n\n"}
2019-08-09T18:03:47.8704390Z {"message":"reference to uninitialized memory","code":{"code":"clippy::invalid_ref","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/invalid_ref.rs","byte_start":817,"byte_end":842,"line_start":35,"line_end":35,"column_start":26,"column_end":51,"is_primary":true,"text":[{"text":"    let ref_uninit: &T = std::mem::uninitialized(); // warning","highlight_start":26,"highlight_end":51}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: reference to uninitialized memory\n  --> tests/ui/invalid_ref.rs:35:26\n   |\nLL |     let ref_uninit: &T = std::mem::uninitialized(); // warning\n   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html\n\n"}
2019-08-09T18:03:47.8706361Z {"message":"reference to uninitialized memory","code":{"code":"clippy::invalid_ref","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/invalid_ref.rs","byte_start":932,"byte_end":958,"line_start":39,"line_end":39,"column_start":26,"column_end":52,"is_primary":true,"text":[{"text":"    let ref_uninit: &T = core::mem::uninitialized(); // warning","highlight_start":26,"highlight_end":52}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: reference to uninitialized memory\n  --> tests/ui/invalid_ref.rs:39:26\n   |\nLL |     let ref_uninit: &T = core::mem::uninitialized(); // warning\n   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: Creation of a null reference is undefined behavior; see https://doc.rust-lang.org/reference/behavior-considered-undefined.html\n\n"}
2019-08-09T18:03:47.8708852Z {"message":"the type `&T` does not permit zero-initialization","code":{"code":"invalid_value","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/invalid_ref.rs","byte_start":492,"byte_end":510,"line_start":23,"line_end":23,"column_start":24,"column_end":42,"is_primary":true,"text":[{"text":"    let ref_zero: &T = std::mem::zeroed(); // warning","highlight_start":24,"highlight_end":42}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`-D invalid-value` implied by `-D warnings`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"this means that this code causes undefined behavior when executed","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"use `MaybeUninit` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: the type `&T` does not permit zero-initialization\n  --> tests/ui/invalid_ref.rs:23:24\n   |\nLL |     let ref_zero: &T = std::mem::zeroed(); // warning\n   |                        ^^^^^^^^^^^^^^^^^^\n   |\n   = note: `-D invalid-value` implied by `-D warnings`\n   = note: this means that this code causes undefined behavior when executed\n   = help: use `MaybeUninit` instead\n\n"}
2019-08-09T18:03:47.8711489Z {"message":"the type `&T` does not permit zero-initialization","code":{"code":"invalid_value","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/invalid_ref.rs","byte_start":598,"byte_end":617,"line_start":27,"line_end":27,"column_start":24,"column_end":43,"is_primary":true,"text":[{"text":"    let ref_zero: &T = core::mem::zeroed(); // warning","highlight_start":24,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this means that this code causes undefined behavior when executed","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"use `MaybeUninit` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: the type `&T` does not permit zero-initialization\n  --> tests/ui/invalid_ref.rs:27:24\n   |\nLL |     let ref_zero: &T = core::mem::zeroed(); // warning\n   |                        ^^^^^^^^^^^^^^^^^^^\n   |\n   = note: this means that this code causes undefined behavior when executed\n   = help: use `MaybeUninit` instead\n\n"}
2019-08-09T18:03:47.8713850Z {"message":"the type `&T` does not permit being left uninitialized","code":{"code":"invalid_value","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/invalid_ref.rs","byte_start":817,"byte_end":842,"line_start":35,"line_end":35,"column_start":26,"column_end":51,"is_primary":true,"text":[{"text":"    let ref_uninit: &T = std::mem::uninitialized(); // warning","highlight_start":26,"highlight_end":51}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this means that this code causes undefined behavior when executed","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"use `MaybeUninit` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: the type `&T` does not permit being left uninitialized\n  --> tests/ui/invalid_ref.rs:35:26\n   |\nLL |     let ref_uninit: &T = std::mem::uninitialized(); // warning\n   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: this means that this code causes undefined behavior when executed\n   = help: use `MaybeUninit` instead\n\n"}
2019-08-09T18:03:47.8715814Z {"message":"the type `&T` does not permit being left uninitialized","code":{"code":"invalid_value","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/invalid_ref.rs","byte_start":932,"byte_end":958,"line_start":39,"line_end":39,"column_start":26,"column_end":52,"is_primary":true,"text":[{"text":"    let ref_uninit: &T = core::mem::uninitialized(); // warning","highlight_start":26,"highlight_end":52}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"this means that this code causes undefined behavior when executed","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"use `MaybeUninit` instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: the type `&T` does not permit being left uninitialized\n  --> tests/ui/invalid_ref.rs:39:26\n   |\nLL |     let ref_uninit: &T = core::mem::uninitialized(); // warning\n   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: this means that this code causes undefined behavior when executed\n   = help: use `MaybeUninit` instead\n\n"}
2019-08-09T18:03:47.8716557Z 
2019-08-09T18:03:47.8716846Z ------------------------------------------
2019-08-09T18:03:47.8716908Z 
2019-08-09T18:03:47.8717266Z thread '[ui] ui/invalid_ref.rs' panicked at 'explicit panic', /cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.22/src/runtest.rs:2632:9
---
2019-08-09T18:40:45.1080820Z [RUSTC-TIMING] proc_macro test:false 21.013
2019-08-09T18:40:45.1086747Z    Compiling test v0.0.0 (/checkout/src/libtest)
2019-08-09T18:40:57.4278729Z [RUSTC-TIMING] test test:false 12.316
2019-08-09T18:40:57.4284214Z     Finished release [optimized] target(s) in 33.75s
2019-08-09T18:40:57.5544396Z [RUSTC-TIMING] miri_xargo test:false 0.048
2019-08-09T18:40:57.5568015Z A libstd for Miri is now available in `/home/user/.cache/miri/HOST`.
2019-08-09T18:40:58.4260372Z    Compiling compiletest_rs v0.3.22
2019-08-09T18:40:58.8283139Z [RUSTC-TIMING] build_script_build test:false 0.398
2019-08-09T18:40:58.8324981Z    Compiling lazy_static v0.2.11
2019-08-09T18:40:58.9480190Z [RUSTC-TIMING] lazy_static test:false 0.111
---
2019-08-09T18:43:05.1754314Z Verifying status of rustc-guide...
2019-08-09T18:43:05.1876012Z Cloning into 'rust-toolstate'...
2019-08-09T18:43:06.1255494Z The state of "clippy-driver" has changed from "test-pass" to "test-fail"
2019-08-09T18:43:06.1389656Z The state of "clippy-driver" has regressed from "test-pass" to "test-fail"
2019-08-09T18:43:06.7117377Z ##[error]Bash exited with code '1'.
2019-08-09T18:43:06.7160640Z ##[section]Starting: Upload CPU usage statistics
2019-08-09T18:43:06.7170332Z ==============================================================================
2019-08-09T18:43:06.7170441Z Task         : Bash
2019-08-09T18:43:06.7170510Z Description  : Run a Bash script on macOS, Linux, or Windows

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)

@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 Aug 9, 2019
@Centril
Copy link
Contributor Author

Centril commented Aug 9, 2019

Ping @RalfJung

@RalfJung
Copy link
Member

RalfJung commented Aug 9, 2019

Looks like my lint fires in clippy's tests. Will investigate.

@Centril Centril closed this Aug 9, 2019
@Centril Centril deleted the rollup-5lvzexh branch August 9, 2019 20:35
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
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.

Cleanup: Use #![feature(associated_type_bounds)] where applicable
8 participants