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 16 pull requests #66365

Closed
wants to merge 51 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

SimonSapin and others added 30 commits October 25, 2019 18:13
This skips the loop when the element type is known not to have drop glue, even in debug mode.
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.
RalfJung and others added 17 commits November 13, 2019 09:31
Use `drop_in_place` in `array::IntoIter::drop`

This skips the loop when the element type is known not to have drop glue, even in debug mode.
…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
…-E0623, r=Dylan-DPC

Add long error explanation for E0623

Part of rust-lang#61137.

r? @Dylan-DPC
…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.
…onSapin

add raw ptr variant of UnsafeCell::get

This has come up recently in rust-lang#66051 (Cc @Centril @pitdicker) as well as in discussion with @nikomatsakis and in unrelated discussion with @withoutboats.
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=16 rollup=never

@bors
Copy link
Contributor

bors commented Nov 13, 2019

📌 Commit 96a9511 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 96a9511 with merge 87e79738f69be0188d64532e4ae21ec30c42654a...

@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-11-13T13:07:25.3403235Z [RUSTC-TIMING] tidy test:false 0.581
2019-11-13T13:07:25.3415977Z     Finished release [optimized] target(s) in 1m 17s
2019-11-13T13:07:25.3515420Z [TIMING] ToolBuild { compiler: Compiler { stage: 0, host: "x86_64-unknown-linux-gnu" }, target: "x86_64-unknown-linux-gnu", tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, is_optional_tool: false, source_type: InTree, extra_features: [] } -- 77.817
2019-11-13T13:07:25.3518434Z tidy check
2019-11-13T13:07:26.1108805Z tidy error: /checkout/src/libcore/array/iter.rs:100: undocumented unsafe
2019-11-13T13:07:26.1108996Z tidy error: /checkout/src/libcore/array/iter.rs:196: undocumented unsafe
2019-11-13T13:07:27.7288846Z Found 485 error codes
2019-11-13T13:07:27.7289267Z Found 0 error codes with no tests
2019-11-13T13:07:27.7289385Z Done!
2019-11-13T13:07:27.7289461Z some tidy checks failed
2019-11-13T13:07:27.7289461Z some tidy checks failed
2019-11-13T13:07:27.7289506Z 
2019-11-13T13:07:27.7289540Z 
2019-11-13T13:07:27.7290783Z 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-11-13T13:07:27.7290964Z 
2019-11-13T13:07:27.7290997Z 
2019-11-13T13:07:27.7295774Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-11-13T13:07:27.7295866Z Build completed unsuccessfully in 0:01:21
2019-11-13T13:07:27.7295866Z Build completed unsuccessfully in 0:01:21
2019-11-13T13:07:27.7342506Z == clock drift check ==
2019-11-13T13:07:27.7357044Z   local time: Wed Nov 13 13:07:27 UTC 2019
2019-11-13T13:07:27.8072462Z   network time: Wed, 13 Nov 2019 13:07:27 GMT
2019-11-13T13:07:27.8072807Z == end clock drift check ==
2019-11-13T13:07:29.1221563Z 
2019-11-13T13:07:29.1322722Z ##[error]Bash exited with code '1'.
2019-11-13T13:07:29.1350885Z ##[section]Starting: Checkout
2019-11-13T13:07:29.1353066Z ==============================================================================
2019-11-13T13:07:29.1353141Z Task         : Get sources
2019-11-13T13:07:29.1353227Z 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 JohnTitor closed this Nov 13, 2019
@JohnTitor JohnTitor deleted the rollup-yiifria branch November 13, 2019 13:09
@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-11-13T13:00:02.6833105Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-13T13:00:02.7022873Z ##[command]git config gc.auto 0
2019-11-13T13:00:02.7058503Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-13T13:00:02.7120465Z ##[command]git config --get-all http.proxy
2019-11-13T13:00:02.7245654Z ##[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/66365/merge:refs/remotes/pull/66365/merge
---
2019-11-13T13:05:38.1818103Z    Compiling serde_json v1.0.40
2019-11-13T13:05:39.8461476Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-11-13T13:05:50.2530817Z     Finished release [optimized] target(s) in 1m 22s
2019-11-13T13:05:50.2639374Z tidy check
2019-11-13T13:05:51.0363396Z tidy error: /checkout/src/libcore/array/iter.rs:100: undocumented unsafe
2019-11-13T13:05:51.0364315Z tidy error: /checkout/src/libcore/array/iter.rs:196: undocumented unsafe
2019-11-13T13:05:52.6559746Z some tidy checks failed
2019-11-13T13:05:52.6559837Z Found 485 error codes
2019-11-13T13:05:52.6559873Z Found 0 error codes with no tests
2019-11-13T13:05:52.6559930Z Done!
2019-11-13T13:05:52.6559930Z Done!
2019-11-13T13:05:52.6559952Z 
2019-11-13T13:05:52.6559972Z 
2019-11-13T13:05:52.6560761Z 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-11-13T13:05:52.6560870Z 
2019-11-13T13:05:52.6560891Z 
2019-11-13T13:05:52.6567514Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-11-13T13:05:52.6568188Z Build completed unsuccessfully in 0:01:26
2019-11-13T13:05:52.6568188Z Build completed unsuccessfully in 0:01:26
2019-11-13T13:05:52.6618128Z == clock drift check ==
2019-11-13T13:05:52.6627606Z   local time: Wed Nov 13 13:05:52 UTC 2019
2019-11-13T13:05:52.7773642Z   network time: Wed, 13 Nov 2019 13:05:52 GMT
2019-11-13T13:05:52.7803566Z == end clock drift check ==
2019-11-13T13:05:54.1822218Z 
2019-11-13T13:05:54.1901053Z ##[error]Bash exited with code '1'.
2019-11-13T13:05:54.1927162Z ##[section]Starting: Checkout
2019-11-13T13:05:54.1928636Z ==============================================================================
2019-11-13T13:05:54.1928699Z Task         : Get sources
2019-11-13T13:05:54.1928736Z 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)

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.