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 12 pull requests #52001

Closed
wants to merge 35 commits into from

Conversation

Mark-Simulacrum
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

SimonSapin and others added 30 commits June 6, 2018 13:52
Note this isn't useful, yet. More changes will be necessary to be able to
actually codegen for this machine. As such, it is not enabled by default.

This patch is on its own for the benefit of the reviewers.
Most of the time, it's not a problem that the types of the arm bodies in
a desugared-from-`?` match are different (that is, specifically: in `x?`
where x is a `Result<A, B>`, the `Ok` arm body is an `A`, whereas the
`Err` arm diverges to return a `Result<A, B>`), because they're being
assigned to different places. But in tail position, the types do need to
match, and our error message was explicitly referring to "match arms",
which is confusing when there's no `match` in the sweetly sugared
source.

It is not without some misgivings that we pollute the clarity-of-purpose
of `note_error_origin` with the suggestion to wrap with `Ok` (the other
branches are pointing out the odd-arm-out in the HIR that is the origin
of the error; the new branch that issues the `Ok` suggestion is serving
a different purpose), but it's the natural place to do it given that
we're already matching on `ObligationCauseCode::MatchExpressionArm {
arm_span, source }` there.

Resolves rust-lang#51632.
Shipping this tool gives people reliable way to reduce the generated executable size.

I'm not sure if this strip tool is available from the llvm version current rust is built on. But let's take a look. @japaric
nll requires these annotations, I believe because of
rust-lang#29149
Tests should always use "rustc" and "cargo" from config.toml instead
of assuming that stage0 binaries was downloaded to build directory.
…ification, r=oli-obk

Removed `uninitialized_statics` field from `Memory` struct in miri

**IMPORTANT: Do not merge until rust-lang#51110 is merged**

r? @oli-obk

CC @eddyb
…ne, r=alexcrichton

Initialize LLVM's AMDGPU target machine, if available.

Note this isn't useful, yet. More changes will be necessary to be able to
actually codegen for this machine. As such, it is not enabled by default.

This patch is on its own for the benefit of the reviewers.
Implement always-fallible TryFrom for usize/isize conversions that are infallible on some platforms

This reverts commit 837d6c7 "Remove TryFrom impls that might become conditionally-infallible with a portability lint".

This fixes rust-lang#49415 by adding (restoring) missing `TryFrom` impls for integer conversions to or from `usize` or `isize`, by making them always fallible at the type system level (that is, with `Error=TryFromIntError`) even though they happen to be infallible on some platforms (for some values of `size_of::<usize>()`).

They had been removed to allow the possibility to conditionally having some of them be infallible `From` impls instead, depending on the platforms, and have the [portability lint](rust-lang/rfcs#1868) warn when they are used in code that is not already opting into non-portability. For example `#[allow(some_lint)] usize::from(x: u64)` would be valid on code that only targets 64-bit platforms.

This PR gives up on this possiblity for two reasons:

* Based on discussion with @aturon, it seems that the portability lint is not happening any time soon. It’s better to have the conversions be available *at all* than keep blocking them for so long. Portability-lint-gated platform-specific APIs can always be added separately later.

* For code that is fine with fallibility, the alternative would force it to opt into "non-portability" even though there would be no real portability issue.
Add read_exact_at and write_all_at methods to FileExt on unix

This PR adds `FileExt::read_exact_at()` and `FileExt::write_all_at()`, which are to `read_at()` and `write_at()` as `read_exact()` and `write_all()` are to `read()` and `write()`. This allows the user to not have to deal with `ErrorKind::Interrupted` and calling the functions in a loop.

I was unsure as to how to mark these new methods so I marked them `unstable`, please let me know if I should have done it differently.

I asked in Discord and was told that as this change is small it does not require an RFC.
…reemap-annotations, r=gankro

add outlives annotations to `BTreeMap`

NLL requires these annotations, I believe because of <rust-lang#29149>.

Fixes rust-lang#48224

r? @gankro
cc @lqd
…r=nikomatsakis

[NLL] Use better span for initializing a variable twice

Closes rust-lang#51217

When assigning to a (projection from a) local immutable local which starts initialised (everything except `let PATTERN;`):

* Point to the declaration of that local
* Make the error message refer to the local, rather than the projection.

r? @nikomatsakis
…ing_desugar, r=estebank

in which we plug the crack where `?`-desugaring leaked into errors

Most of the time, it's not a problem that the types of the arm bodies in
a desugared-from-`?` match are different (that is, specifically: in `x?`
where x is a `Result<A, B>`, the `Ok` arm body is an `A`, whereas the
`Err` arm diverges to return a `Result<A, B>`), because they're being
assigned to different places. But in tail position, the types do need to
match, and our error message was explicitly referring to "match arms",
which is confusing when there's no `match` in the sweetly sugared
source.

It is not without some misgivings that we pollute the clarity-of-purpose
of `note_error_origin` with the suggestion to wrap with `Ok` (the other
branches are pointing out the odd-arm-out in the HIR that is the origin
of the error; the new branch that issues the `Ok` suggestion is serving
a different purpose), but it's the natural place to do it given that
we're already matching on `ObligationCauseCode::MatchExpressionArm {
arm_span, source }` there.

Resolves rust-lang#51632.
Provide llvm-strip in llvm-tools component

Shipping this tool gives people reliable way to reduce the generated executable size.

I'm not sure if this strip tool is available from the llvm version current rust is built on. But let's take a look. @japaric
…=estebank

Fix various issues with control-flow statements inside anonymous constants

Fixes rust-lang#51761.
Fixes rust-lang#51963 (and the host of other reported issues there).
(Might be easiest to review per commit, as they should be standalone.)

r? @estebank
…tage0, r=simulacrum

bootstrap: tests should use rustc from config.toml

Tests should always use "rustc" and "cargo" from config.toml instead of assuming that stage0 binaries was downloaded to build directory.

Without this change `./x.py test src/bootstrap` will always try to use `build/ARCH/stage0/bin/rustc` file as compiler, but when we use local compiler to bootstrap this file does not exist.
Do not suggest changes to str literal if it isn't one

Fix rust-lang#48364.
@Mark-Simulacrum
Copy link
Member Author

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Jul 2, 2018

📌 Commit 4dcaf90 has been approved by Mark-Simulacrum

@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 Jul 2, 2018
@bors
Copy link
Contributor

bors commented Jul 2, 2018

⌛ Testing commit 4dcaf90 with merge 1a112bda5d5642961ca8f5209ff4efa418a63473...

@bors
Copy link
Contributor

bors commented Jul 2, 2018

💔 Test failed - status-travis

@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 Jul 2, 2018
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-freebsd 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.

[01:00:52] [TIMING] ToolBuild { compiler: Compiler { stage: 2, host: "x86_64-unknown-linux-gnu" }, target: "x86_64-unknown-freebsd", tool: "rls", path: "src/tools/rls", mode: ToolRustc, is_ext_tool: true, extra_features: [] } -- 82.679
[01:00:52] Unable to build RLS, skipping dist
[01:00:52] Dist LlvmTools stage2 (x86_64-unknown-freebsd)
[01:00:52] thread 'main' panicked at 'fs::File::open(&src) failed with No such file or directory (os error 2)', bootstrap/lib.rs:1202:25
[01:00:52] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-freebsd --target x86_64-unknown-freebsd
[01:00:52] Build completed unsuccessfully in 0:57:50
travis_time:end:23fadbb4:start=1530571675165482599,finish=1530575328137977874,duration=3652972495275

---
travis_time:end:0a706b54:start=1530575328637018483,finish=1530575328642793800,duration=5775317
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:001e815d
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:06416808
$ dmesg | grep -i kill

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)

1 similar comment
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-freebsd 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.

[01:00:52] [TIMING] ToolBuild { compiler: Compiler { stage: 2, host: "x86_64-unknown-linux-gnu" }, target: "x86_64-unknown-freebsd", tool: "rls", path: "src/tools/rls", mode: ToolRustc, is_ext_tool: true, extra_features: [] } -- 82.679
[01:00:52] Unable to build RLS, skipping dist
[01:00:52] Dist LlvmTools stage2 (x86_64-unknown-freebsd)
[01:00:52] thread 'main' panicked at 'fs::File::open(&src) failed with No such file or directory (os error 2)', bootstrap/lib.rs:1202:25
[01:00:52] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-freebsd --target x86_64-unknown-freebsd
[01:00:52] Build completed unsuccessfully in 0:57:50
travis_time:end:23fadbb4:start=1530571675165482599,finish=1530575328137977874,duration=3652972495275

---
travis_time:end:0a706b54:start=1530575328637018483,finish=1530575328642793800,duration=5775317
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:001e815d
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:06416808
$ dmesg | grep -i kill

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

bors commented Jul 3, 2018

☔ The latest upstream changes (presumably #51428) made this pull request unmergeable. Please resolve the merge conflicts.

@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.