Commit graph

166817 commits

Author SHA1 Message Date
Dylan DPC e50105e3f5
Rollup merge of #95434 - cjgillot:dump-dep-kind, r=oli-obk
Only output DepKind in dump-dep-graph.

When printing the whole DepNode, the output file is simply too massive to
be actually useful for profiling.

This trimmed down version mixes a lot of information together, but it also
allows to ask questions such that "why does this query ever access HIR?".
2022-04-21 20:55:18 +02:00
bors b04c5329e1 Auto merge of #96210 - nnethercote:speed-up-TokenCursor, r=petrochenkov
Speed up `TokenCursor`

Plus a few related clean-ups.

r? `@petrochenkov`
2022-04-21 15:42:50 +00:00
bors 1dec35a1b0 Auto merge of #96003 - aswild:pr/bootstrap-subcommands-cleanup, r=jyn514
bootstrap: consolidate subcommand parsing and matching

There's several places where the x.py command names are matched as
strings, leading to some inconsistencies and opportunities for cleanup.

* Add Format, Clean, and Setup variants to builder::Kind.
* Use Kind to parse the x.py subcommand name (including aliases)
* Match on the subcommand Kind rather than strings when handling
  options and help text.
* Several subcommands don't display any paths when run with `-h -v` even
  though the help text indicates that they should. Fix this and refactor
  so that manually keeping matches in sync isn't necessary.

Fixes #95937
2022-04-21 10:38:43 +00:00
bors 3d3dafb771 Auto merge of #95828 - vacuus:rustdoc-print-where-clause, r=notriddle
rustdoc: Clean up `html::format::print_where_clause`

(Arguably) closes https://github.com/rust-lang/rust/issues/95814
2022-04-21 08:12:38 +00:00
bors 5176945ad4 Auto merge of #95612 - davidtwco:split-debuginfo-in-bootstrap, r=Mark-Simulacrum
bootstrap: add split-debuginfo config

Replace `run-dysutil` option with more general `split-debuginfo` option that works on all platforms.

r? `@Mark-Simulacrum`
2022-04-21 05:24:48 +00:00
Nicholas Nethercote 643e9f707e Introduced Cursor::next_with_spacing_ref.
This lets us clone just the parts within a `TokenTree` that need
cloning, rather than the entire thing. This is a surprisingly large
performance win, up to 4% on `async-std-1.10.0`.
2022-04-21 13:49:40 +10:00
Nicholas Nethercote cc4e3443ec Produce CloseDelim and pop the stack at the same time.
This makes `CloseDelim` handling more like `OpenDelim` handling, which
produces `OpenDelim` and pushes the stack at the same time. It requires
some adjustment to `parse_token_tree` now that we don't remain within
the frame after getting the `CloseDelim`.
2022-04-21 12:34:38 +10:00
bors 7be1da0319 Auto merge of #96263 - Dylan-DPC:rollup-0eofl13, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #90630 (Create real parser for search queries)
 - #96193 ([fuchsia] Add implementation for `current_exe`)
 - #96196 (Remove assertion that all paths in `ShouldRun` exist)
 - #96228 (Fix locations for intrinsics impls and change to links)
 - #96236 (Add an explicit `Span` field to `OutlivesConstraint`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-21 02:16:32 +00:00
Roc Yu 5d59c16c2d
rustdoc: Clean up html::format::print_where_clause 2022-04-20 20:45:30 -04:00
bors 09ccb6c59d Auto merge of #96254 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/96239
r? `@ghost`
2022-04-20 23:51:40 +00:00
Nicholas Nethercote 7a89255b20 Avoid some tuple destructuring.
Surprisingly, this is a non-trivial performance win.
2022-04-21 09:21:45 +10:00
Dylan DPC 463c94a780
Rollup merge of #96236 - Aaron1011:constraint-debug, r=jackh726
Add an explicit `Span` field to `OutlivesConstraint`

Previously, we would retrieve the span from the `Body` using
the `locations` field. However, we may end up changing the
`locations` field when moving a constraint from a promoted
to a different body.

We now store the original `Span` in a dedication field, so that
changes to the `locations` do not affect the quality of our
diagnostics.
2022-04-21 01:14:17 +02:00
Dylan DPC e2543d7a4e
Rollup merge of #96228 - mbartlett21:patch-4, r=thomcc
Fix locations for intrinsics impls and change to links

These still referred to `rustc_mir`.
2022-04-21 01:14:16 +02:00
Dylan DPC 0179aacfc1
Rollup merge of #96196 - jyn514:no-assertion, r=Mark-Simulacrum
Remove assertion that all paths in `ShouldRun` exist

This breaks on submodules (see #96188). Disable the assertion for now until I can think of a proper
fix.

This doesn't revert any of the changes in `Step`s themselves, only what
`ShouldRun::paths` does.
2022-04-21 01:14:15 +02:00
Dylan DPC 1e43aae0ef
Rollup merge of #96193 - djkoloski:fuchsia_current_exe, r=tmandry
[fuchsia] Add implementation for `current_exe`

This implementation returns a best attempt at the current exe path. On
fuchsia, fdio will always use `argv[0]` as the process name and if it is
not set then an error will be returned. Because this is not guaranteed
to be the case, this implementation returns an error if `argv` does not
contain any elements.
2022-04-21 01:14:14 +02:00
Dylan DPC 976c6b2d19
Rollup merge of #90630 - GuillaumeGomez:improve-rustdoc-search, r=notriddle
Create real parser for search queries

You can test it [here](https://rustdoc.crud.net/imperio/improve-rustdoc-search/std/index.html).

This PR adds a real parser for the query engine in rustdoc. The parser is quite simple but it allows to makes query handling much easier. I added a new testsuite to ensure it works as expected and ran fuzzing checks on it for a few hours without problems.

So about the parser: as you can see in the screenshot, it handles recursive generics parsing. It also allows to set which item should use exact matching by adding double-quotes around it (look for `exact_search` in the screenshot).

Now about the query engine itself: I simplified it a lot thanks to the parsed query. It behaves mostly the same when there is only one argument, but is much more powerful when there are more than one.

When making this change, we also removed the support for multi-query.

PS: A big part of the PR is tests and test-related code. :)

r? `@camelid`
2022-04-21 01:14:13 +02:00
Ralf Jung 1b01d65d6f update Miri 2022-04-20 18:25:23 -04:00
bors 879aff385a Auto merge of #96187 - GuillaumeGomez:potential-intra-doc-links-filtering, r=notriddle
Prevent `<>` links to be interpreted for intra-doc links

As discussed in [this thread](https://github.com/rust-lang/rust/pull/96135#discussion_r852107956). As mentioned, the intra-doc RFC states that `<>` links shouldn't be potential intra-doc links:  https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html#no-autolinks-style.

I renamed `markdown_links` into `potential_intra_doc_markdown_links` to make it more obvious what it's doing.

cc `@petrochenkov`
r? `@notriddle`
2022-04-20 21:32:01 +00:00
Guillaume Gomez 4d26bde4f0 Extend handleSingleArg documentation 2022-04-20 21:11:39 +02:00
bors 51ea9bb29b Auto merge of #96253 - Dylan-DPC:rollup-87hpds5, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #93313 (Check if call return type is visibly uninhabited when building MIR)
 - #96160 (Miri/interpreter debugging tweaks)
 - #96167 (Replace sys/unix/weak AtomicUsize with AtomicPtr)
 - #96168 (Improve AddrParseError description)
 - #96206 (Use sys::unix::locks::futex* on wasm+atomics.)
 - #96234 (remove_dir_all_recursive: treat ELOOP the same as ENOTDIR)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-20 18:40:13 +00:00
Guillaume Gomez f988f86cdc Remove <> links to be potential intra-doc links 2022-04-20 20:28:15 +02:00
Dylan DPC 2443cf2c6a
Rollup merge of #96234 - goffrie:eloop, r=thomcc
remove_dir_all_recursive: treat ELOOP the same as ENOTDIR

On older Linux kernels (I tested on 4.4, corresponding to Ubuntu 16.04), opening a symlink using `O_DIRECTORY | O_NOFOLLOW` returns `ELOOP` instead of `ENOTDIR`. We should handle it the same, since a symlink is still not a directory and needs to be `unlink`ed.
2022-04-20 18:26:06 +02:00
Dylan DPC 41235ef98a
Rollup merge of #96206 - m-ou-se:wasm-futex-locks, r=alexcrichton
Use sys::unix::locks::futex* on wasm+atomics.

This removes the wasm-specific lock implementations and instead re-uses the implementations from sys::unix.

Tracking issue: https://github.com/rust-lang/rust/issues/93740

cc ``@alexcrichton``
2022-04-20 18:26:05 +02:00
Dylan DPC 01d4731735
Rollup merge of #96168 - chris-morgan:AddrParseError-description-improvements, r=joshtriplett
Improve AddrParseError description

The existing description was incorrect for socket addresses, and misleading: users would see “invalid IP address syntax” and suppose they were supposed to provide an IP address rather than a socket address.

I contemplated making it two variants (IP, socket), but realised we can do still better for the IPv4 and IPv6 types, so here it is as six.

I contemplated more precise error descriptions (e.g. “invalid IPv6 socket address syntax: expected a decimal scope ID after %”), but that’s a more invasive change, and probably not worthwhile anyway.
2022-04-20 18:26:04 +02:00
Dylan DPC 53f028d790
Rollup merge of #96167 - CAD97:weak-dlsym-less-ptr-crime, r=thomcc
Replace sys/unix/weak AtomicUsize with AtomicPtr

Should fix #96163. Can't easily test on Windows though...
2022-04-20 18:26:03 +02:00
Dylan DPC 72cb094611
Rollup merge of #96160 - RalfJung:interpret-debug, r=oli-obk
Miri/interpreter debugging tweaks

Some changes I made to make debugging Miri with trace logging less terrible.

r? ``@oli-obk``
2022-04-20 18:26:02 +02:00
Dylan DPC 38e3f523c0
Rollup merge of #93313 - tmiasko:uninhabited, r=tmandry
Check if call return type is visibly uninhabited when building MIR

The main motivation behind the change is to expose information about diverging
calls to the generator transform and match the precision of drop range tracking
which already understands that call expressions with visibly uninhabited types
diverges.

This change should also accept strictly more programs than before. That is
programs that were previously rejected due to errors raised by control-flow
sensitive checks in a code that is no longer considered reachable.

Fixes #93161.
2022-04-20 18:26:01 +02:00
bors 3e69bda8ce Auto merge of #96250 - ehuss:update-cargo, r=ehuss
Update cargo

7 commits in dba5baf4345858c591517b24801902a062c399f8..edffc4ada3d77799e5a04eeafd9b2f843d29fc23
2022-04-13 21:58:27 +0000 to 2022-04-19 17:38:29 +0000
- Document cargo-add (rust-lang/cargo#10578)
- feat: Support '-F' as an alias for '--features' (rust-lang/cargo#10576)
- Completion support for `cargo-add` (rust-lang/cargo#10577)
- Add a link to the document in the timings report (rust-lang/cargo#10492)
- feat: Import cargo-add into cargo (rust-lang/cargo#10472)
- Part 8 of RFC2906 - Keep `InheritableFields` in a `LazyCell` inside `… (rust-lang/cargo#10568)
- Part 7 of RFC2906 - Add support for inheriting `exclude` and `include` (rust-lang/cargo#10565)
2022-04-20 16:15:54 +00:00
Eric Huss 3a6fc80445 Update cargo 2022-04-20 06:50:39 -07:00
bors d39864d64e Auto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomez
rustdoc: Optimize and refactor doc link resolution

One more subset of https://github.com/rust-lang/rust/pull/94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it.
It's better to read individual commits and their descriptions to understand the changes.
The `may_have_doc_links` optimization is not *very* useful here, but it's much more important for https://github.com/rust-lang/rust/pull/94857.

Closes https://github.com/rust-lang/rust/issues/96079
2022-04-20 13:34:48 +00:00
bors 0034bbca26 Auto merge of #96022 - martingms:inline-const-getters, r=nnethercote
Inline `ty::Const::ty()` and `ty::Const::val()` getters

These were not inlined into `super_relate_consts`, which is one of the hottest functions in a callgrind profile of compiling `bitmaps-3.1.0`.

Yields some small speedups across various benchmarks locally:

#### Primary benchmarks

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
unicode-normalization-0.1.19 | check | full | -0.56% | 2.78x
unicode-normalization-0.1.19 | check | incr-full | -0.43% | 2.15x
unicode-normalization-0.1.19 | opt | full | -0.35% | 1.77x
unicode-normalization-0.1.19 | debug | incr-full | -0.31% | 1.56x
unicode-normalization-0.1.19 | debug | full | -0.30% | 1.51x

#### Secondary benchmarks

Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
bitmaps-3.1.0 | check | full | -1.88% | 9.39x
bitmaps-3.1.0 | debug | full | -1.79% | 8.96x
bitmaps-3.1.0 | opt | full | -1.69% | 8.43x
bitmaps-3.1.0 | check | incr-full | -1.54% | 7.68x
bitmaps-3.1.0 | debug | incr-full | -1.45% | 7.27x
bitmaps-3.1.0 | opt | incr-full | -1.39% | 6.96x
tt-muncher | opt | full | 1.28% | 6.38x
nalgebra-0.30.1 | check | full | -0.96% | 4.81x
nalgebra-0.30.1 | debug | full | -0.91% | 4.54x
nalgebra-0.30.1 | opt | full | -0.90% | 4.52x
nalgebra-0.30.1 | check | incr-full | -0.77% | 3.86x
nalgebra-0.30.1 | opt | incr-full | -0.76% | 3.79x
nalgebra-0.30.1 | debug | incr-full | -0.74% | 3.72x
hex-0.4.3 | check | full | -0.70% | 3.50x
hex-0.4.3 | debug | full | -0.59% | 2.95x
hex-0.4.3 | check | incr-full | -0.56% | 2.80x
hex-0.4.3 | opt | full | -0.56% | 2.78x
wf-projection-stress-65510 | opt | full | -0.48% | 2.42x
hex-0.4.3 | opt | incr-full | -0.48% | 2.40x
hex-0.4.3 | debug | incr-full | -0.45% | 2.24x
wf-projection-stress-65510 | check | full | -0.44% | 2.18x
wf-projection-stress-65510 | debug | full | -0.42% | 2.08x
wf-projection-stress-65510 | check | incr-full | -0.40% | 2.01x
deep-vector | debug | incr-patched: add vec item | -0.38% | 1.88x
wf-projection-stress-65510 | debug | incr-full | -0.37% | 1.86x
wf-projection-stress-65510 | opt | incr-full | -0.36% | 1.81x
deep-vector | debug | incr-patched: println | 0.33% | 1.63x

r? `@nnethercote`
2022-04-20 11:12:55 +00:00
Nicholas Nethercote 880318c70a Remove Eof sanity check in Parser::inlined_bump_with.
A Google search of the error message fails to return any relevant
resuts, suggesting this has never occurred in practice. And removeing it
reduces instruction counts by up to 2% on some benchmarks.
2022-04-20 14:52:54 +10:00
Nicholas Nethercote d2b9bbbf78 Inline Parser::nonterminal_may_begin_with. 2022-04-20 14:13:49 +10:00
Nicholas Nethercote f9235db37e Inline Parser::parse_nonterminal. 2022-04-20 14:08:59 +10:00
Nicholas Nethercote 9e6879fdba Only record fallback_span when necessary. 2022-04-20 14:04:22 +10:00
bors 27af517549 Auto merge of #96082 - michaelwoerister:less_impl_stable_hash_via_hash, r=compiler-errors
incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it.

Fixes https://github.com/rust-lang/rust/issues/96013.
2022-04-20 03:51:09 +00:00
Aaron Hill 611a06a375
Add an explicit Span field to OutlivesConstraint
Previously, we would retrieve the span from the `Body` using
the `locations` field. However, we may end up changing the
`locations` field when moving a constraint from a promoted
to a different body.

We now store the original `Span` in a dedication field, so that
changes to the `locations` do not affect the quality of our
diagnostics.
2022-04-19 23:42:20 -04:00
mbartlett21 4879875c76
Change file locations to be links to GitHub 2022-04-20 13:14:32 +10:00
Nicholas Nethercote 5b653c1a43 Inline Cursor::next_with_spacing. 2022-04-20 12:43:25 +10:00
Nicholas Nethercote b09522a634 Remove the loop from Parser::bump().
The loop is there to handle a `NoDelim` open/close token. This commit
changes `TokenCursor::inlined_next` so it never returns such a token.
This is a performance win because the conditional test in `bump()` is
removed.

If the parser needs changing in the future to handle `NoDelim` tokens,
then `inlined_next()` can easily be changed to return them.
2022-04-20 12:28:26 +10:00
Nicholas Nethercote 3cd5e34617 Remove TokenCursorFrame::open_delim.
Because it's now always true.
2022-04-20 12:28:26 +10:00
Nicholas Nethercote 86723d3d46 Use true for open_delim/close_delim in one spot.
The `DelimToken` here is `NoDelim`, which means the returned delim
tokens will just be ignored by `Parser::bump()`. This commit changes
things so the delim tokens won't be returned.
2022-04-20 12:26:49 +10:00
David Wood 65cc0ad455 bootstrap: non-bootstrap windows split debuginfo
Temporarily, only enable split debuginfo on Windows if not building with
the boostrap compiler as there is a bug that isn't fixed in the
bootstrap compiler which would result in `thorin` being run on Windows.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-20 02:55:18 +01:00
Nicholas Nethercote 804103b0ae Add a size assertion for Parser. 2022-04-20 11:48:07 +10:00
bors a2df8baea6 Auto merge of #96224 - Dylan-DPC:rollup-h2h3j93, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #95740 (asm: Add a kreg0 register class on x86 which includes k0)
 - #95813 (Remove extra space before a where clause)
 - #96029 (Refactor loop into iterator; simplify negation logic.)
 - #96162 (interpret: Fix writing uninit to an allocation)
 - #96165 (Miri provenance cleanup)
 - #96205 (Use futex locks on emscripten.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-20 01:34:43 +00:00
Geoffry Song cff3f1e8d5 remove_dir_all_recursive: treat ELOOP the same as ENOTDIR 2022-04-20 00:50:03 +00:00
mbartlett21 671a8723c6
Fix locations for intrinsics impls 2022-04-20 09:28:07 +10:00
Nicholas Nethercote f1c32c10c4 Move desugaring code into its own function.
It's not hot, so shouldn't be within the always inlined part.
2022-04-20 08:33:25 +10:00
Dylan DPC da1ddf371c
Rollup merge of #96205 - m-ou-se:emscripten-futex-locks, r=thomcc
Use futex locks on emscripten.

This switches Emscripten to the futex-based lock implementations, away from pthread.

Tracking issue: https://github.com/rust-lang/rust/issues/93740
2022-04-19 22:57:44 +02:00
Dylan DPC 9d9d5910af
Rollup merge of #96165 - RalfJung:miri-provenance-cleanup, r=oli-obk
Miri provenance cleanup

Reviewing https://github.com/rust-lang/rust/pull/95826 by ``@carbotaniuman`` made me realize that we could clean things up a little here.

``@carbotaniuman`` please let me know if you're okay with landing this (it will create a lot of conflicts with your PR), or if you'd prefer incorporating the ideas from this PR into yours. I think we want to end up in a situation where the function you called `ptr_reify_alloc` returns just two things, a concrete tag and an offset. Getting an `AllocId` from a concrete tag should be infallible like now. However a concrete tag and `Tag` don't have to be the same type.

r? ``@oli-obk``
2022-04-19 22:57:43 +02:00