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 #68134

Closed
wants to merge 36 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jan 11, 2020

Successful merges:

Failed merges:

r? @ghost

Mark-Simulacrum and others added 30 commits December 26, 2019 11:14
This allows LLVM to inline the happy path, such that catching unwinding is
zero-cost when no panic occurs. This also allows us to match the code generated
by C++ try/catch.
We execpt the try intrinsic to be a direct call if in -Cpanic=abort mode, and
that catch_unwind optimizes out if calling a function that does not unwind.
This is primarily updating the `curl` dependency, but also went ahead
and applied a few updates for other packages that Cargo depends on.
Also do some cleanup of the interface.
varkor and others added 6 commits January 11, 2020 11:50
…ichton

Optimize catch_unwind to match C++ try/catch

This refactors the implementation of catching unwinds to allow LLVM to inline the "try" closure directly into the happy path, avoiding indirection. This means that the catch_unwind implementation is (after this PR) zero-cost unless a panic is thrown.

https://rust.godbolt.org/z/cZcUSB is an example of the current codegen in a simple case. Notably, the codegen is *exactly the same* if `-Cpanic=abort` is passed, which is clearly not great.

This PR, on the other hand, generates the following assembly:

```asm
# -Cpanic=unwind:
	push   rbx
	mov    ebx,0x2a
	call   QWORD PTR [rip+0x1c53c]        # <happy>
	mov    eax,ebx
	pop    rbx
	ret
	mov    rdi,rax
	call   QWORD PTR [rip+0x1c537]        # cleanup function call
	call   QWORD PTR [rip+0x1c539]        # <unfortunate>
	mov    ebx,0xd
	mov    eax,ebx
	pop    rbx
	ret

# -Cpanic=abort:
	push   rax
	call   QWORD PTR [rip+0x20a1]        # <happy>
	mov    eax,0x2a
	pop    rcx
	ret
```

Fixes rust-lang#64224, and resolves rust-lang#64222.
…rk-Simulacrum

Update some of Cargo's dependencies

This is primarily updating the `curl` dependency, but also went ahead
and applied a few updates for other packages that Cargo depends on.
…lacrum

Move more of `rustc::lint` into `rustc_lint`

Based on rust-lang#67806.

Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes:

- We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`.

- `in_derive_expansion` is, and needs to, be moved as a method on `Span`.

- We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined.

- `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after rust-lang#68133).

- `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints.

- `rustc::context` is moved to `rustc_lint::context`.

- The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
Clean up some diagnostics by making them more consistent

In general:

- Diagnostic should start with a lowercase letter.
- Diagnostics should not end with a full stop.
- Ellipses contain three dots.
- Backticks should encode Rust code.

I also reworded a couple of messages to make them read more clearly.

It might be sensible to create a style guide for diagnostics, so these informal conventions are written down somewhere, after which we could audit the existing diagnostics.

r? @Centril
…ns, r=Centril

Add suggestions when encountering chained comparisons

Ideally, we'd also prevent the type error, which is just extra noise, but that will require moving the error from the parser, and I think the suggestion makes things clear enough for now.

Fixes rust-lang#65659.
@Centril
Copy link
Contributor Author

Centril commented Jan 11, 2020

@bors r+ p=5 rollup=never

@bors
Copy link
Contributor

bors commented Jan 11, 2020

📌 Commit 950c1cf 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 Jan 11, 2020
@Centril Centril added the rollup A PR which is a rollup label Jan 11, 2020
@bors
Copy link
Contributor

bors commented Jan 11, 2020

⌛ Testing commit 950c1cf with merge 743398d5cd7d1666cf0d08c41b0bf123d4bbb96d...

@rust-highfive
Copy link
Collaborator

The job dist-x86_64-apple-alt 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-01-11T20:58:54.2889980Z [RUSTC-TIMING] git_rustfmt test:false 9.865
2020-01-11T20:58:55.9649140Z [RUSTC-TIMING] cargo_fmt test:false 11.543
2020-01-11T20:58:56.0902350Z [RUSTC-TIMING] rustfmt test:false 11.670
2020-01-11T20:58:56.1102760Z     Finished release [optimized] target(s) in 5m 01s
2020-01-11T20:58:56.1489970Z duplicate artifacts found when compiling a tool, this typically means that something was recompiled because a transitive dependency has different features activated than in a previous build:
2020-01-11T20:58:56.1490630Z the following dependencies are duplicated although they have the same features enabled:
2020-01-11T20:58:56.1490930Z the following dependencies have different features:
2020-01-11T20:58:56.1490930Z the following dependencies have different features:
2020-01-11T20:58:56.1492170Z   proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)
2020-01-11T20:58:56.1492970Z     `rustfmt` additionally enabled features {"default"} at "/Users/runner/runners/2.163.1/work/1/s/build/x86_64-apple-darwin/stage1-tools/x86_64-apple-darwin/release/deps/libproc_macro2-fd9e5a07d9968100.rlib"
2020-01-11T20:58:56.1493740Z     `cargo` additionally enabled features {} at "/Users/runner/runners/2.163.1/work/1/s/build/x86_64-apple-darwin/stage1-tools/x86_64-apple-darwin/release/deps/libproc_macro2-b2ae2ec8bf87d4cf.rlib"
2020-01-11T20:58:56.1494350Z   quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)
2020-01-11T20:58:56.1495060Z     `rustfmt` additionally enabled features {"default"} at "/Users/runner/runners/2.163.1/work/1/s/build/x86_64-apple-darwin/stage1-tools/x86_64-apple-darwin/release/deps/libquote-0169323817c75a85.rlib"
2020-01-11T20:58:56.1496150Z     `cargo` additionally enabled features {} at "/Users/runner/runners/2.163.1/work/1/s/build/x86_64-apple-darwin/stage1-tools/x86_64-apple-darwin/release/deps/libquote-422014b721eee20f.rlib"
2020-01-11T20:58:56.1496280Z 
2020-01-11T20:58:56.1497140Z to fix this you will probably want to edit the local src/tools/rustc-workspace-hack/Cargo.toml crate, as that will update the dependency graph to ensure that these crates all share the same feature set
2020-01-11T20:58:56.1497790Z thread 'main' panicked at 'tools should not compile multiple copies of the same crate', src/bootstrap/tool.rs:195:13
2020-01-11T20:58:56.1613620Z failed to run: /Users/runner/runners/2.163.1/work/1/s/build/bootstrap/debug/bootstrap dist
2020-01-11T20:58:56.1613850Z Build completed unsuccessfully in 1:06:45
2020-01-11T20:58:56.1678300Z == clock drift check ==
2020-01-11T20:58:56.1732510Z   local time: Sat Jan 11 20:58:56 UTC 2020
2020-01-11T20:58:56.1732510Z   local time: Sat Jan 11 20:58:56 UTC 2020
2020-01-11T20:58:56.2128810Z   network time: Sat, 11 Jan 2020 20:58:56 GMT
2020-01-11T20:58:56.2135350Z == end clock drift check ==
2020-01-11T20:58:56.2193410Z 
2020-01-11T20:58:56.2375760Z ##[error]Bash exited with code '1'.
2020-01-11T20:58:56.2422500Z ##[section]Starting: Checkout
2020-01-11T20:58:56.2425000Z ==============================================================================
2020-01-11T20:58:56.2425100Z Task         : Get sources
2020-01-11T20:58:56.2425190Z 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 Jan 11, 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 Jan 11, 2020
@Centril Centril closed this Jan 12, 2020
@Centril Centril deleted the rollup-050nv1n branch January 12, 2020 02:25
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.

7 participants