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 11 pull requests #80439

Merged
merged 64 commits into from
Dec 28, 2020
Merged

Rollup of 11 pull requests #80439

merged 64 commits into from
Dec 28, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

bjorn3 and others added 30 commits November 27, 2020 20:48
This includes bytecodealliance/wasmtime#2403 which enables hotswapping with SimpleJIT
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Directly use raw pointers in `AtomicPtr` store/load

I was unable to find any reason for this limitation in the latest source of LLVM or in the documentation [here](http://llvm.org/docs/Atomics.html#libcalls-atomic).

fixes rust-lang/miri#1574
LICM in Cranelift has been fixed recently
This commit makes minor changes to the cranelift backend so that it can
build given changes in cg_ssa for Split DWARF.

Signed-off-by: David Wood <david@davidtw.co>
…omatsakis

Move binder for dyn to each list item

This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`.

This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.`

r? `@nikomatsakis`
bjorn3 and others added 19 commits December 25, 2020 12:19
This should not matter right now, but if we ever parallelize rustbuild
this will avoid tarball contents being merged together.
…n_backend, r=oli-obk

Move some more code out of CodegenBackend::{codegen_crate,link}

Kind of a follow up to rust-lang#77795
…Simulacrum

Update RELEASES.md for 1.49.0

### [Rendered](https://github.com/XAMPPRocky/rust/tree/relnotes-1.49.0/RELEASES.md)

r? ``@Mark-Simulacrum``
cc ``@rust-lang/release``
…arkor

Suggest fn ptr rather than fn item and suggest to use `Fn` trait bounds rather than the unique closure type in E0121

Previously, using `_` as a return type in a function that returned a function/closure would provide a diagnostic that would cause a papercut. For example:
```rust
fn f() -> i32 { 0 }
fn fn_ptr() -> _ { f }
fn closure() -> _ { || 0 }
```
would result in this diagnostic:
```rust
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> <anon>:2:16
  |
2 | fn fn_ptr() -> _ { f }
  |                ^
  |                |
  |                not allowed in type signatures
  |                help: replace with the correct return type: `fn() -> i32 {f}`

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> <anon>:3:17
  |
3 | fn closure() -> _ { || 0 }
  |                 ^
  |                 |
  |                 not allowed in type signatures
  |                 help: replace with the correct return type: `[closure@<anon>:3:21: 3:25]`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0121`.
```
As can be seen, it was suggested to use the function definition return type `fn() -> i32 { f }` which is not valid syntax as a return type. Additionally, closures cause a papercut as unique closure types (notated in this case as `[closure@<anon>:3:21: 3:25]`) are not valid syntax either.

Instead, this PR implements this version of the diagnostic (this example is for the same code featured above):
```rust
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> <anon>:2:16
  |
2 | fn fn_ptr() -> _ { f }
  |                ^
  |                |
  |                not allowed in type signatures
  |                help: replace with the correct return type: `fn() -> i32`

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> <anon>:3:17
  |
3 | fn closure() -> _ { || 0 }
  |                 ^ not allowed in type signatures
  |
  = help: consider using an `Fn`, `FnMut`, or `FnOnce` trait bound
  = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0121`.
```
As can be seen in this diagnostic, the papercut for returning a function item is fixed by suggesting the usage of a function pointer as the return type. As for closures, it's suggested to use an `Fn`, `FnMut`, or `FnOnce` trait bound (with further reading on closures and `Fn` traits in *The Book* for beginners). I did not implement a suggestion to use `impl Fn() -> i32` syntax as that was out-of-scope for my abilities at the moment, therefore someone in the future may want to implement that. Also, it's possible to use either `impl Trait` syntax, generics, or generics with a `where` clause, and some users may not want to use `impl Trait` syntax for their own reasons.

This PR fixes rust-lang#80179.
Add more comments to trait queries

This also adds back a comment that was mistakenly removed in
ac9dfc3.
…k-Simulacrum

BTreeMap: test split_off (and append) more thoroughly

Using DeterministicRng as a poor man's property based testing rig.
r? ``@Mark-Simulacrum``
Remove FIXME in rustc_privacy

rust-lang#71104 has been fixed.

r? ``@marmeladema`` if you have time, otherwise ``@petrochenkov``
…jorn3

Sync rustc_codegen_cranelift

The highlight of this sync are two JIT mode improvements. The first is that it is now possible to use JIT mode when using `-Zcodegen-backend` instead of the custom driver using `-Cllvm-args=mode=jit`. The second one is a new JIT mode that lazily compiles functions when they are called the first time: https://github.com/bjorn3/rustc_codegen_cranelift/pull/1120

In addition this includes a few small runtime performance improvements and various fixes for rustc changes that didn't cause compilation to fail.

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler
…sper

rustc_span: Remove `Symbol::with`

A subset of rust-lang#79425 that is a pure refactoring.
…rk-Simulacrum

bootstrap: put the component name in the tarball temp dir path

This should not matter right now, but if we ever parallelize rustbuild this will avoid tarball contents being merged together.

r? `@Mark-Simulacrum`
@rustbot rustbot added the rollup A PR which is a rollup label Dec 28, 2020
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Dec 28, 2020

📌 Commit a4a59a0 has been approved by Dylan-DPC

@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 Dec 28, 2020
@bors
Copy link
Contributor

bors commented Dec 28, 2020

⌛ Testing commit a4a59a0 with merge 2987785...

@bors
Copy link
Contributor

bors commented Dec 28, 2020

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 2987785 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 28, 2020
@bors bors merged commit 2987785 into rust-lang:master Dec 28, 2020
@rustbot rustbot added this to the 1.51.0 milestone Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.