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 13 pull requests #66356

Closed
wants to merge 37 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

ArturKovacs and others added 30 commits November 4, 2019 19:37
One of the links in the docs was being rendered as a literal
open-bracket followed by a single quote, instead of being transformed
into a link. Fix it to match the link earlier in the same paragraph.
This was essentially a "query" previously (with no key, just always run
once when resolving the crate dependencies), and remains so, just now in
a way that isn't on Session. This removes the need for the `Once` as
well.
Similarly to the previous commit, there's no need for this to be in
Session and have a Once around it.
In bootstrap, we set `RUSTC_INSTALL_BINDIR` to `config.bindir`, so
rustdoc can find rustc relative to the toolchain sysroot. However, if a
distro script like Fedora's `%configure` sets an absolute path, then
rustdoc's `sysroot.join(bin_path)` ignores that sysroot altogether.

That would be OK once the toolchain is actually installed, but it breaks
the in-tree doc tests during the build, since `/usr/bin/rustc` is still
the old version. So now we try to make `RUSTC_INSTALL_BINDIR` relative
to the sysroot prefix in the first place.
perf.rlo shows that running the `ConstProp` pass results in
across-the-board wins regardless of debug or opt complilation mode. As a
result, we're turning it on to get the compile time benefits.

`ConstProp` doesn't currently intern the memory used by its `Machine` so
we can't yet propagate allocations which is why
`ConstProp::should_const_prop()` checks if the value being propagated is
a scalar or not.
This makes it easier to add new non-standard constructors, and this also
ensures that we don't forget cases when adding a new constructor.
It counts as an extra constructor for types that are not allowed to be
matched exhaustively.
The single dependency on queries (QueryName) can be fairly easily
abstracted via a trait and this further decouples Session from librustc
(the primary goal).
This helps decouple the lint system from needing the implicit TLS TyCtxt
as well.
…oli-obk

[mir-opt] Turn on the `ConstProp` pass by default

perf.rlo shows that running the `ConstProp` pass results in
across-the-board wins regardless of debug or opt complilation mode. As a
result, we're turning it on to get the compile time benefits.
Fix documentation for `Iterator::count()`.

The documentation of std::core::Iterator::count() stated that the number returned is the number of times `next` is called on the iterator. However this is not true as the number of times `next` is called is exactly one plus the number returned by `count()`.
…c, r=QuietMisdreavus

rename cfg(rustdoc) into cfg(doc)

Needed by rust-lang#61351

r? @QuietMisdreavus
…sh-link, r=Dylan-DPC

docs: Fix link to BufWriter::flush

One of the links in the docs was being rendered as a literal
open-bracket followed by a single quote, instead of being transformed
into a link. Fix it to match the link earlier in the same paragraph.
add Result::map_or

This PR adds this API to make it consistent with `Option::map_or`.

```rust
impl<T, E> Result<T, E> {
    pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U {
        match self {
            Ok(t) => f(t),
            Err(_) => default,
        }
    }
}
```

This API is very small. We already has a similar API for `Option::map_or`.
Add a callback that allows compiler consumers to override queries.

This pull request adds an additional callback that allows compiler consumers such as Prusti and MIRAI to override queries. My hope is that in this way it will be possible to get access to the internal compiler information (e.g. borrow checker) without major changes to the compiler.

This pull request is work in progress because I am still testing if I can get the information which I need.

cc @nikomatsakis

r? @oli-obk
…ulacrum

Use a relative bindir for rustdoc to find rustc

In bootstrap, we set `RUSTC_INSTALL_BINDIR` to `config.bindir`, so
rustdoc can find rustc relative to the toolchain sysroot. However, if a
distro script like Fedora's `%configure` sets an absolute path, then
rustdoc's `sysroot.join(bin_path)` ignores that sysroot altogether.

That would be OK once the toolchain is actually installed, but it breaks
the in-tree doc tests during the build, since `/usr/bin/rustc` is still
the old version. So now we try to make `RUSTC_INSTALL_BINDIR` relative
to the sysroot prefix in the first place.

r? @Mark-Simulacrum
…, r=varkor

Improve non-exhaustiveness handling in usefulness checking

The comments around code paths for the `non_exhaustive` feature mention stuff like "we act as if the type had an extra unmatcheable constructor". So I thought I'd make this explicit by defining a special constructor that does exactly this.
This makes those code paths a bit more legible and less prone to error.
Add some tests for fixed ICEs

Closes rust-lang#30904 (fixed between nightly-2019-07-14 and nightly-2019-07-31)
Closes rust-lang#40231 (example 1 is fixed in 1.32.0, example 2 is fixed in 1.38.0)
Closes rust-lang#52432 (fixed in rustc 1.40.0-beta.1 (76b4053 2019-11-05))
Closes rust-lang#63279 (fixed in rustc 1.40.0-nightly (246be7e 2019-10-25))

r? @Centril
…ochenkov

Move Session fields to CrateStore

`allocator_kind` and `injected_panic_runtime` are both query-like, this moves them out of Session and into CrateStore, avoiding the `Once` they previously had by clearing separating initialization and de-initialization.
…a, r=michaelwoerister

Move self-profile infrastructure to data structures

The single dependency on queries (QueryName) can be fairly easily
abstracted via a trait and this further decouples Session from librustc
(the primary goal).

This is intended as a precursor to moving Session out of librustc, but since that involves lots of smaller steps that move around code I'm splitting it up into separate PRs.
…r=Dylan-DPC

Remove dead code for encoding/decoding lint IDs

This helps decouple the lint system from needing the implicit TLS TyCtxt
as well.
@JohnTitor
Copy link
Member Author

@bors r+ p=13 rollup=never

@bors
Copy link
Contributor

bors commented Nov 13, 2019

📌 Commit 6302a35 has been approved by JohnTitor

@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 Nov 13, 2019
@JohnTitor JohnTitor added the rollup A PR which is a rollup label Nov 13, 2019
@bors
Copy link
Contributor

bors commented Nov 13, 2019

⌛ Testing commit 6302a35 with merge c711bf4aeac3e72b90d8863c6c0b9e2229e0c1cc...

@bors
Copy link
Contributor

bors commented Nov 13, 2019

💥 Test timed out

@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 Nov 13, 2019
@JohnTitor
Copy link
Member Author

@bors retry

@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 Nov 13, 2019
@bors
Copy link
Contributor

bors commented Nov 13, 2019

⌛ Testing commit 6302a35 with merge 688a74b...

bors added a commit that referenced this pull request Nov 13, 2019
Rollup of 13 pull requests

Successful merges:

 - #65932 (download .tar.xz if python3 is used)
 - #66074 ([mir-opt] Turn on the `ConstProp` pass by default)
 - #66094 (Fix documentation for `Iterator::count()`.)
 - #66166 (rename cfg(rustdoc) into cfg(doc))
 - #66227 (docs: Fix link to BufWriter::flush)
 - #66292 (add Result::map_or)
 - #66297 (Add a callback that allows compiler consumers to override queries.)
 - #66317 (Use a relative bindir for rustdoc to find rustc)
 - #66330 (Improve non-exhaustiveness handling in usefulness checking)
 - #66331 (Add some tests for fixed ICEs)
 - #66334 (Move Session fields to CrateStore)
 - #66335 (Move self-profile infrastructure to data structures)
 - #66337 (Remove dead code for encoding/decoding lint IDs)

Failed merges:

r? @ghost
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-mingw 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-11-13T11:00:13.2341678Z do so (now or later) by using -b with the checkout command again. Example:
2019-11-13T11:00:13.2342156Z 
2019-11-13T11:00:13.2342615Z   git checkout -b <new-branch-name>
2019-11-13T11:00:13.2343166Z 
2019-11-13T11:00:13.2343529Z HEAD is now at 688a74bc3 Auto merge of #66356 - JohnTitor:rollup-1mh7jsr, r=JohnTitor
2019-11-13T11:00:13.2883198Z ##[section]Starting: Decide whether to run this job
2019-11-13T11:00:13.2988816Z ==============================================================================
2019-11-13T11:00:13.2988910Z Task         : Bash
2019-11-13T11:00:13.2989007Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-11-13T11:00:14.6036261Z 
2019-11-13T11:00:14.6036401Z 
2019-11-13T11:00:14.6036524Z 
2019-11-13T11:00:14.6036823Z 
2019-11-13T11:00:14.6037022Z  - #65932 (download .tar.xz if python3 is used)
2019-11-13T11:00:14.6037235Z  - #66074 ([mir-opt] Turn on the `ConstProp` pass by default)
2019-11-13T11:00:14.6038048Z  - #66094 (Fix documentation for `Iterator::count()`.)
2019-11-13T11:00:14.6038359Z  - #66166 (rename cfg(rustdoc) into cfg(doc))
2019-11-13T11:00:14.6038560Z  - #66227 (docs: Fix link to BufWriter::flush)
2019-11-13T11:00:14.6038751Z  - #66292 (add Result::map_or)
2019-11-13T11:00:14.6038935Z  - #66297 (Add a callback that allows compiler consumers to override queries.)
2019-11-13T11:00:14.6039161Z  - #66317 (Use a relative bindir for rustdoc to find rustc)
2019-11-13T11:00:14.6039397Z  - #66330 (Improve non-exhaustiveness handling in usefulness checking)
2019-11-13T11:00:14.6040162Z  - #66334 (Move Session fields to CrateStore)
2019-11-13T11:00:14.6043678Z  - #66335 (Move self-profile infrastructure to data structures)
2019-11-13T11:00:14.6043678Z  - #66335 (Move self-profile infrastructure to data structures)
2019-11-13T11:00:14.6048089Z  - #66337 (Remove dead code for encoding/decoding lint IDs)
2019-11-13T11:00:14.6067626Z AGENT_DISABLELOGPLUGIN_TESTFILEPUBLISHERPLUGIN=true
2019-11-13T11:00:14.6068132Z AGENT_DISABLELOGPLUGIN_TESTRESULTLOGPLUGIN=true
2019-11-13T11:00:14.6068332Z AGENT_HOMEDIRECTORY=C:\agents\2.160.0
2019-11-13T11:00:14.6068505Z AGENT_ID=509
---
2019-11-13T11:00:14.6086098Z BUILD_SOURCEBRANCHNAME=auto
2019-11-13T11:00:14.6086262Z BUILD_SOURCESDIRECTORY=D:\a\1\s
2019-11-13T11:00:14.6086474Z BUILD_SOURCEVERSION=688a74bc3317dfa642732205e7eeecdd0590fb34
2019-11-13T11:00:14.6086666Z BUILD_SOURCEVERSIONAUTHOR=bors
2019-11-13T11:00:14.6111577Z BUILD_SOURCEVERSIONMESSAGE=Auto merge of #66356 - JohnTitor:rollup-1mh7jsr, r=JohnTitor
2019-11-13T11:00:14.6267209Z COBERTURA_HOME=C:\cobertura-2.1.1
2019-11-13T11:00:14.6269102Z COMMONPROGRAMFILES=C:\Program Files\Common Files
2019-11-13T11:00:14.6269228Z COMMON_TESTRESULTSDIRECTORY=D:\a\1\TestResults
2019-11-13T11:00:14.6269305Z COMPUTERNAME=fv-az433
---
2019-11-13T12:51:08.9013053Z [RUSTC-TIMING] vec_map test:false 0.304
2019-11-13T12:51:08.9064305Z    Compiling hex v0.3.2
2019-11-13T12:51:09.1056234Z [RUSTC-TIMING] semver_parser test:false 2.285
2019-11-13T12:51:09.1134450Z    Compiling hex v0.4.0
2019-11-13T12:51:12.7602993Z memory allocation of 4294967304 bytes failed[RUSTC-TIMING] hex test:false 3.624
2019-11-13T12:51:12.7604424Z error: could not compile `hex`.
2019-11-13T12:51:12.7605225Z Caused by:
2019-11-13T12:51:12.7605225Z Caused by:
2019-11-13T12:51:12.7605749Z   process didn't exit successfully: `D:\a\1\s\build\bootstrap/debug/rustc --edition=2018 --crate-name hex C:\Users\VssAdministrator\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\hex-0.4.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C debuginfo=0 --cfg "feature=\"default\"" --cfg "feature=\"std\"" -C metadata=b3cb7a0e06fa5820 -C extra-filename=-b3cb7a0e06fa5820 --out-dir D:\a\1\s\build\x86_64-pc-windows-gnu\stage1-tools\x86_64-pc-windows-gnu\release\deps --target x86_64-pc-windows-gnu -L dependency=D:\a\1\s\build\x86_64-pc-windows-gnu\stage1-tools\x86_64-pc-windows-gnu\release\deps -L dependency=D:\a\1\s\build\x86_64-pc-windows-gnu\stage1-tools\release\deps --cap-lints allow -Zexternal-macro-backtrace -Zbinary-dep-depinfo` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
2019-11-13T12:51:12.7606573Z warning: build failed, waiting for other jobs to finish...
2019-11-13T12:51:12.7853194Z memory allocation of 536870920 bytes failed[RUSTC-TIMING] hex test:false 3.862
2019-11-13T12:51:12.8015107Z error: could not compile `hex`.
2019-11-13T12:51:12.8015825Z Caused by:
2019-11-13T12:51:12.8015825Z Caused by:
2019-11-13T12:51:12.8016371Z   process didn't exit successfully: `D:\a\1\s\build\bootstrap/debug/rustc --crate-name hex C:\Users\VssAdministrator\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\hex-0.3.2\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C debuginfo=0 -C metadata=c9ae03471b0a6bfa -C extra-filename=-c9ae03471b0a6bfa --out-dir D:\a\1\s\build\x86_64-pc-windows-gnu\stage1-tools\x86_64-pc-windows-gnu\release\deps --target x86_64-pc-windows-gnu -L dependency=D:\a\1\s\build\x86_64-pc-windows-gnu\stage1-tools\x86_64-pc-windows-gnu\release\deps -L dependency=D:\a\1\s\build\x86_64-pc-windows-gnu\stage1-tools\release\deps --cap-lints allow -Zexternal-macro-backtrace -Zbinary-dep-depinfo` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
2019-11-13T12:51:12.8054298Z command did not execute successfully: "D:\\a\\1\\s\\build\\x86_64-pc-windows-gnu\\stage0\\bin\\cargo.exe" "build" "-Zconfig-profile" "--target" "x86_64-pc-windows-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--manifest-path" "D:\\a\\1\\s\\src/tools/cargo\\Cargo.toml" "--features" "rustc-workspace-hack/all-static" "--message-format" "json-render-diagnostics"
2019-11-13T12:51:12.9533696Z failed to run: D:\a\1\s\build\bootstrap\debug\bootstrap dist
2019-11-13T12:51:12.9533930Z Build completed unsuccessfully in 1:41:58
2019-11-13T12:51:12.9901212Z == clock drift check ==
2019-11-13T12:51:13.0848028Z   local time: Wed Nov 13 12:51:13 CUT 2019
2019-11-13T12:51:13.0848028Z   local time: Wed Nov 13 12:51:13 CUT 2019
2019-11-13T12:51:13.5543018Z   network time: Wed, 13 Nov 2019 12:51:13 GMT
2019-11-13T12:51:13.5551469Z == end clock drift check ==
2019-11-13T12:51:13.6204686Z 
2019-11-13T12:51:13.9576848Z ##[error]Bash exited with code '1'.
2019-11-13T12:51:14.0368445Z ##[section]Starting: Checkout
2019-11-13T12:51:14.1319249Z ==============================================================================
2019-11-13T12:51:14.1319368Z Task         : Get sources
2019-11-13T12:51:14.1319466Z 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)

@bors
Copy link
Contributor

bors commented Nov 13, 2019

💔 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 Nov 13, 2019
@JohnTitor
Copy link
Member Author

Uhmm, it's odd
@bors retry

@JohnTitor JohnTitor closed this Nov 13, 2019
@JohnTitor JohnTitor deleted the rollup-1mh7jsr branch November 13, 2019 12:56
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.