Commit Graph

1374 Commits

Author SHA1 Message Date
est31
3cb7618f58 Remove unused dep from rustc_arena 2022-02-02 17:37:14 +01:00
Matthias Krüger
019c140244
Rollup merge of #93436 - dcsommer:master, r=Mark-Simulacrum
Update compiler_builtins to fix duplicate symbols in `armv7-linux-androideabi` rlib

I ran `./x.py dist --host= --target=armv7-linux-androideabi` before this diff:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-3d9661a82c59c66a.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
2
```
And after:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-ffd2745070943321.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
1
```
Fixes #93310

See also https://github.com/rust-lang/compiler-builtins/issues/449 and https://github.com/rust-lang/compiler-builtins/pull/450
2022-02-01 16:08:06 +01:00
Eric Huss
91aee65c99 Update cargo 2022-02-01 03:26:30 -08:00
bors
bb549e5afe Auto merge of #93270 - klensy:sec-up, r=Mark-Simulacrum
update vulnerable/yanked deps

tokio v1.8.2 -> v1.8.4: https://rustsec.org/advisories/RUSTSEC-2021-0124
ammonia v3.1.0 -> v3.1.3: https://rustsec.org/advisories/RUSTSEC-2022-0003
thread_local v1.0.1 -> v1.1.4: https://rustsec.org/advisories/RUSTSEC-2022-0006

pin-project-lite v0.2.4 -> v0.2.8: yanked: https://github.com/taiki-e/pin-project-lite/blob/main/CHANGELOG.md#024---2021-01-11
2022-01-31 04:23:21 +00:00
Daniel Sommermann
746b3d87b3 Update compiler_builtins to fix duplicate symbols in armv7-linux-androideabi rlib
I ran `./x.py dist --host= --target=armv7-linux-androideabi` before this diff:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-3d9661a82c59c66a.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
2
```
And after:
```
$ nm build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/armv7-linux-androideabi/lib/libcompiler_builtins-ffd2745070943321.rlib 2> /dev/null | grep __sync_fetch_and_add_4 | wc -l
1
```
Fixes #93310
2022-01-29 08:28:52 -08:00
Matthias Krüger
c866ae5e93
Rollup merge of #93431 - lqd:remove-jemallocator, r=Mark-Simulacrum
remove unused `jemallocator` crate

When it was noticed that the rustc binary wasn't actually using jemalloc via `#[global_allocator]` and that was removed, the dependency remained.

Tests pass locally with a `jemalloc = true` build, but I'll trigger a try build to ensure I haven't missed an edge-case somewhere.

r? ```@ghost``` until that completes
2022-01-29 14:46:34 +01:00
bors
ca43894e0e Auto merge of #93351 - anp:fuchsia-remove-dir-all, r=tmandry
Bump libc and fix remove_dir_all on Fuchsia after CVE fix

With the previous `is_dir` impl, we would attempt to unlink
a directory in the None branch, but Fuchsia supports returning
ENOTEMPTY from unlinkat() without the AT_REMOVEDIR flag because
we don't currently differentiate unlinking files and directories
by default.

On the Fuchsia side I've opened https://fxbug.dev/92273 to discuss
whether this is the correct behavior, but it doesn't seem like
addressing the error code is necessary to make our tests happy.

Depends on https://github.com/rust-lang/libc/pull/2654 since we
apparently haven't needed to reference DT_UNKNOWN before this.
2022-01-29 09:01:01 +00:00
Adam Perry
8c9944c50d Fix remove_dir_all on Fuchsia after CVE fix.
With the previous `is_dir` impl, we would attempt to unlink
a directory in the None branch, but Fuchsia supports returning
ENOTEMPTY from unlinkat() without the AT_REMOVEDIR flag because
we don't currently differentiate unlinking files and directories
by default.

On the Fuchsia side I've opened https://fxbug.dev/92273 to discuss
whether this is the correct behavior, but it doesn't seem like
addressing the error code is necessary to make our tests happy.

Updates std's libc crate to include DT_UNKNOWN for Fuchsia.
2022-01-28 20:38:39 +00:00
Rémy Rakic
f9e0eb3b94 remove unused jemallocator crate 2022-01-28 16:56:05 +01:00
Harald Hoyer
00cbc8d0c8 wasi: update to wasi 0.11.0
To make use of `sock_accept()`, update the wasi crate to `0.11.0`.

Signed-off-by: Harald Hoyer <harald@profian.com>
2022-01-28 13:27:29 +01:00
Matthias Krüger
4276626299
Rollup merge of #93338 - GuillaumeGomez:update-minifier, r=notriddle
Update minifier crate version to 0.0.42

Some issues on the CSS minification.

r? `@notriddle`
2022-01-26 23:45:24 +01:00
Guillaume Gomez
91f39315e8 Update minifier crate version to 0.0.42 2022-01-26 17:24:34 +01:00
Eric Huss
af8048b21d Update cargo 2022-01-25 16:24:21 -08:00
klensy
9f621ae696 update vulnerable/yanked deps 2022-01-24 20:19:21 +03:00
pierwill
4f89224f7f Use an indexmap to avoid sorting LocalDefIds
Update `indexmap` to 1.8.0.

Bless test
2022-01-22 22:34:16 -06:00
bors
10c4c4afec Auto merge of #92998 - Amanieu:hashbrown12, r=Mark-Simulacrum
Update hashbrown to 0.12.0

[Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md#v0120---2022-01-17)
2022-01-22 23:39:21 +00:00
Matthias Krüger
f8335d96fa
Rollup merge of #93012 - GuillaumeGomez:pulldown-list, r=camelid
Update pulldown-cmark version to fix markdown list issue

Fixes #92971.

r? ```@camelid```
2022-01-22 15:32:50 +01:00
Amanieu d'Antras
88149d13e3 Update hashbrown to 0.12.0 2022-01-21 17:20:38 +00:00
bors
84e918971d Auto merge of #92896 - lqd:update-deps, r=Mark-Simulacrum
Update some rustc dependencies to deduplicate them

This PR updates `rand` and `itertools` in rustc (not the whole workspace) in order to deduplicate them (and hopefully slightly improve compile times).

~~Currently, `object` is still duplicated, but https://github.com/rust-lang/thorin/pull/15 and updating `thorin` in the future will remove the use of version 0.27.~~  Update: Thorin 0.2 has now been released, and this PR updates `rustc_codegen_ssa` to use it and deduplicate the `object` crate.

There's a final tiny rustc dependency, `cfg-if`, which will be left: as both versions 0.1.x and 1.0 looked to be heavily depended on, they will require a few cascading updates to be removed.
2022-01-21 10:38:30 +00:00
Matthias Krüger
b1a405df19
Rollup merge of #93091 - pierwill:chalk-0.76, r=jackh726
⬆ chalk to 0.76.0

This update contains https://github.com/rust-lang/chalk/pull/740, which is needed for work on #90317.
2022-01-20 23:37:37 +01:00
Matthias Krüger
3d10c64b26
Rollup merge of #91032 - eholk:generator-drop-tracking, r=nikomatsakis
Introduce drop range tracking to generator interior analysis

This PR addresses cases such as this one from #57478:
```rust
struct Foo;
impl !Send for Foo {}

let _: impl Send = || {
    let guard = Foo;
    drop(guard);
    yield;
};
```

Previously, the `generator_interior` pass would unnecessarily include the type `Foo` in the generator because it was not aware of the behavior of `drop`. We fix this issue by introducing a drop range analysis that finds portions of the code where a value is guaranteed to be dropped. If a value is dropped at all suspend points, then it is no longer included in the generator type. Note that we are using "dropped" in a generic sense to include any case in which a value has been moved. That is, we do not only look at calls to the `drop` function.

There are several phases to the drop tracking algorithm, and we'll go into more detail below.
1. Use `ExprUseVisitor` to find values that are consumed and borrowed.
2. `DropRangeVisitor` uses consume and borrow information to gather drop and reinitialization events, as well as build a control flow graph.
3. We then propagate drop and reinitialization information through the CFG until we reach a fix point (see `DropRanges::propagate_to_fixpoint`).
4. When recording a type (see `InteriorVisitor::record`), we check the computed drop ranges to see if that value is definitely dropped at the suspend point. If so, we skip including it in the type.

## 1. Use `ExprUseVisitor` to find values that are consumed and borrowed.

We use `ExprUseVisitor` to identify the places where values are consumed. We track both the `hir_id` of the value, and the `hir_id` of the expression that consumes it. For example, in the expression `[Foo]`, the `Foo` is consumed by the array expression, so after the array expression we can consider the `Foo` temporary to be dropped.

In this process, we also collect values that are borrowed. The reason is that the MIR transform for generators conservatively assumes anything borrowed is live across a suspend point (see `rustc_mir_transform::generator::locals_live_across_suspend_points`). We match this behavior here as well.

## 2. Gather drop events, reinitialization events, and control flow graph

After finding the values of interest, we perform a post-order traversal over the HIR tree to find the points where these values are dropped or reinitialized. We use the post-order index of each event because this is how the existing generator interior analysis refers to the position of suspend points and the scopes of variables.

During this traversal, we also record branching and merging information to handle control flow constructs such as `if`, `match`, and `loop`. This is necessary because values may be dropped along some control flow paths but not others.

## 3. Iterate to fixed point

The previous pass found the interesting events and locations, but now we need to find the actual ranges where things are dropped. Upon entry, we have a list of nodes ordered by their position in the post-order traversal. Each node has a set of successors. For each node we additionally keep a bitfield with one bit per potentially consumed value. The bit is set if we the value is dropped along all paths entering this node.

To compute the drop information, we first reverse the successor edges to find each node's predecessors. Then we iterate through each node, and for each node we set its dropped value bitfield to the intersection of all incoming dropped value bitfields.

If any bitfield for any node changes, we re-run the propagation loop again.

## 4. Ignore dropped values across suspend points

At this point we have a data structure where we can ask whether a value is guaranteed to be dropped at any post order index for the HIR tree. We use this information in `InteriorVisitor` to check whether a value in question is dropped at a particular suspend point. If it is, we do not include that value's type in the generator type.

Note that we had to augment the region scope tree to include all yields in scope, rather than just the last one as we did before.

r? `@nikomatsakis`
2022-01-20 23:37:29 +01:00
Rémy Rakic
820fd05e29 Update thorin-dwp to deduplicate object 2022-01-20 15:09:05 +01:00
pierwill
8d27c28e39 ⬆ chalk to 0.76.0 2022-01-19 13:44:43 -06:00
Guillaume Gomez
48f5dcad10 Move back templates into html folder 2022-01-19 11:13:24 +01:00
Guillaume Gomez
80b26bd401 Update dependencies 2022-01-19 11:02:24 +01:00
Eric Huss
bfacc5cc73 Update cargo 2022-01-18 19:14:33 -08:00
Eric Holk
b39fb9bb7b Fix control flow handling in generator_interior
All tests pass now! The issue was that we weren't handling all edges
correctly, but now they are handled consistently.

This includes code to dump a graphviz file for the CFG we built for drop
tracking.

Also removes old DropRanges tests.
2022-01-18 14:25:26 -08:00
Eric Holk
ff0e8f4ba2 Revamped DropRange data structure
Not currently working. Need to flow drop information.
2022-01-18 14:25:26 -08:00
Eric Holk
aa029d4bbe Support conditional drops
This adds support for branching and merging control flow and uses this
to correctly handle the case where a value is dropped in one branch of
an if expression but not another.

There are other cases we need to handle, which will come in follow up
patches.

Issue #57478
2022-01-18 14:25:24 -08:00
David Tolnay
fe86dcf0cc
Delete pretty printer tracing 2022-01-18 12:33:42 -08:00
Guillaume Gomez
ecd39aae0e Update pulldown-cmark version to fix markdown list issue 2022-01-17 20:58:42 +01:00
kadmin
67f56671d0 Use Term in ProjectionPredicate
ProjectionPredicate should be able to handle both associated types and consts so this adds the
first step of that. It mainly just pipes types all the way down, not entirely sure how to handle
consts, but hopefully that'll come with time.
2022-01-17 17:44:56 +00:00
Matthias Krüger
681271e045
Rollup merge of #92819 - euclio:atty, r=CraftSpider
rustdoc: remove hand-rolled isatty

This PR replaces bindings to the platform-specific isatty APIs with the `isatty` crate, as done elsewhere in the repository.
2022-01-17 06:08:14 +01:00
Igor Matuszewski
69c3b723d2 Use new Racer from crates.io 2022-01-16 15:30:47 +01:00
Igor Matuszewski
d83c44a03b Update RLS and drop rustc-ap-packages 2022-01-16 15:30:46 +01:00
bors
42852d7857 Auto merge of #92740 - cuviper:update-rayons, r=Mark-Simulacrum
Update rayon and rustc-rayon

This updates rayon for various tools and rustc-rayon for the compiler's parallel mode.

- rayon v1.3.1 -> v1.5.1
- rayon-core v1.7.1 -> v1.9.1
- rustc-rayon v0.3.1 -> v0.3.2
- rustc-rayon-core v0.3.1 -> v0.3.2

... and indirectly, this updates all of crossbeam-* to their latest versions.

Fixes #92677 by removing crossbeam-queue, but there's still a lingering question about how tidy discovers "runtime" dependencies. None of this is truly in the standard library's dependency tree at all.
2022-01-16 08:12:23 +00:00
Rémy Rakic
3713562c6a Update rand to deduplicate it 2022-01-14 13:05:27 +01:00
Rémy Rakic
5928056af2 Update itertools to deduplicate it 2022-01-14 12:33:54 +01:00
Matthias Krüger
ccfee3d53b
Rollup merge of #92849 - flip1995:clippyup, r=Manishearth
Clippyup

r? ```@Manishearth```
2022-01-14 07:47:37 +01:00
Andy Russell
51d7665be1
rustdoc: remove hand-rolled isatty 2022-01-13 11:13:01 -05:00
flip1995
159d6c356e
Update Cargo.lock 2022-01-13 13:18:51 +01:00
Matthias Krüger
a9fe2b95da
Rollup merge of #92807 - ehuss:update-cargo, r=ehuss
Update cargo

6 commits in 358e79fe56fe374649275ca7aebaafd57ade0e8d..06b9d31743210b788b130c8a484c2838afa6fc27
2022-01-04 18:39:45 +0000 to 2022-01-11 23:47:29 +0000
- Port cargo to clap3 (rust-lang/cargo#10265)
- feat: support rustflags per profile (rust-lang/cargo#10217)
- Make bors ignore the PR template so it doesn't end up in merge messages (rust-lang/cargo#10267)
- Be resilient to most IO error and filesystem loop while walking dirs (rust-lang/cargo#10214)
- Remove the option to disable pipelining (rust-lang/cargo#10258)
- Always ask rustc for messages about artifacts, and always process them (rust-lang/cargo#10255)
2022-01-13 08:11:22 +01:00
Matthias Krüger
c7ada001ec
Rollup merge of #90001 - Fearyncess:master, r=alexcrichton
Make rlib metadata strip works with MIPSr6 architecture

Because MIPSr6 has many differences with previous MIPSr2 arch, the previous rlib metadata stripping code in `rustc_codegen_ssa` is only for MIPSr2/r3/r5 (which share the same elf e_flags).

This commit fixed this problem. It makes `rustc_codegen_ssa` happy when compiling rustc for MIPSr6 target or hosts.

e_flags REF: e356027016/llvm/include/llvm/BinaryFormat/ELF.h (L562)
2022-01-13 08:11:16 +01:00
Eric Huss
66f1e322c6 Update cargo 2022-01-11 20:18:29 -08:00
Josh Stone
f3b8812f24 Update rayon and rustc-rayon 2022-01-10 11:34:07 -08:00
Dirkjan Ochtman
93a16cb7e2 Migrate rustdoc from Tera to Askama
See #84419.
2022-01-10 18:40:54 +01:00
Lain Yang
9a337b6fe0 update Cargo.lock and gimli-rs/object for rustc_codegen_ssa 2022-01-07 13:33:20 +08:00
David Wood
2dc1a8a779 cg: use thorin instead of llvm-dwp
`thorin` is a Rust implementation of a DWARF packaging utility that
supports reading DWARF objects from archive files (i.e. rlibs) and
therefore is better suited for integration into rustc.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-01-06 09:32:42 +00:00
Matthias Krüger
a0673468ae
Rollup merge of #92579 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/92527
2022-01-05 11:26:09 +01:00
Matthias Krüger
d83dd85253
Rollup merge of #92545 - dtolnay:rustlog, r=petrochenkov
Extract init_env_logger to crate

I've been doing some work on rustc_ast_pretty using an out-of-tree main.rs and Cargo.toml with the following:

```toml
[dependencies]
rustc_ast = { path = "../rust/compiler/rustc_ast" }
rustc_ast_pretty = { path = "../rust/compiler/rustc_ast_pretty" }
rustc_span = { path = "../rust/compiler/rustc_span" }
```

Rustc_ast_pretty helpfully uses `tracing::debug!` but I found that in order to enable the debug output, my test crate must depend on rustc_driver which is an enormously bigger dependency than what I have been using so far, and slows down iteration time because an enormous dependency tree between rustc_ast and rustc_driver must now be rebuilt after every ast change.

I pulled out the tracing initialization to a new minimal rustc_log crate so that projects depending on the other rustc crates, like rustc_ast_pretty, can access the `debug!` messages in them without building all the rest of rustc.
2022-01-05 11:26:08 +01:00