Commit Graph

166942 Commits

Author SHA1 Message Date
bors
41ef767806 Auto merge of #96226 - xldenis:thir-clone, r=oli-obk
Make all thir types implement clone

This PR adds `Clone` impl to all of the `Thir<'tcx>` types.

I would like to be able to clone a `Thir` body so that I can make a copy in my rustc driver without breaking further compilation. Without this my driver is forced to run in the `after_expansion` callback and thus doesn't benefit from running all the safety checks that `rustc` usually does, instead i need to do them all myself.
2022-04-22 13:56:10 +00:00
Michael Woerister
8b230086fa debuginfo: Emit ZST struct debuginfo for unit type when CPP-like debuginfo is enabled (instead of custom basic type). 2022-04-22 14:59:35 +02:00
SparrowLii
343523cbf1 Make the lifetime accurate which is used in the region constraints part 2022-04-22 20:05:39 +08:00
bors
a8272f23cc Auto merge of #96197 - erikdesjardins:scalarpairenum, r=oli-obk
Mark payload fields of ScalarPair enums as Scalar::Union when they're not always initialized

Fixes #96158

r? `@RalfJung`
2022-04-22 10:50:23 +00:00
Aron Parker
6cfdeaf1a1 Remove redundant type annotation 2022-04-22 11:42:53 +02:00
Aron Parker
9a9d5534f0 Reduce allocations for path conversions on Windows
Previously, UTF-8 to UTF-16 Path conversions on Windows unnecessarily allocate twice, as described in #96297. This commit fixes that issue.
2022-04-22 11:02:04 +02:00
bors
8d68f2f94f Auto merge of #96207 - nikic:distcheck-dir, r=Mark-Simulacrum
Ensure existance of dist directory when creating tarball

I'm not sure why this works in CI, but this is necessary to make distcheck (including the `x86_64-linux-distcheck` image) run on Fedora 35.
2022-04-22 08:01:28 +00:00
Erik Desjardins
4dcc1aae0a normalize out pref_align (copied from another test) 2022-04-22 01:46:24 -04:00
bors
1158ade996 Auto merge of #96144 - c410-f3r:z-errors, r=petrochenkov
Move some tests to more reasonable places

cc #73494
r? `@petrochenkov`
2022-04-22 05:15:47 +00:00
Joshua Nelson
3bac5c0f39 Use run_build helper consistently across most bootstrap tests
This is not super important to do, but the consistency is nice.

I didn't change any tests that call `configure("dist")` and then override the subcommand - doing
that at all is pretty sketchy, but I don't want to mess with it while already doing a refactor.
2022-04-21 22:18:05 -05:00
Joshua Nelson
7a4a66da3d Add a test for --exclude test::XXX
I didn't know that the `test::` syntax was valid before, and it doesn't
seem to be documented anywhere. Add a test so it doesn't regress accidentally,
and as executable documentation.
2022-04-21 21:30:54 -05:00
bors
8b2393086f Auto merge of #96282 - petrochenkov:unindent, r=GuillaumeGomez
rustdoc: Unindent doc fragments on `Attributes` construction

`Attributes` can be constructed at arbitrary points, even after the `unindent_comments` pass.
`Attributes` that are constructed too late end up unindented.

All doc fragments need to be eventually indented before use, so there are no reasons to not do this immediately during their construction.

Fixes https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60unindent_comments.60.20cannot.20work.20as.20a.20separate.20pass.
I'm not sure how to make a minimized reproduction, but unindenting the fragments during their construction should fix the issue.. by construction, and I also verified that all doc strings now hit the `resolver_caches.markdown_links` cache in https://github.com/rust-lang/rust/pull/94857.
2022-04-22 02:30:27 +00:00
Joshua Nelson
8b94fbea01 Don't checkout submodules in bootstrap tests
This doesn't cause any tests to fail, and can greatly speed them up.
2022-04-21 21:27:15 -05:00
Takayuki Maeda
f5a8ee4dd8 remove an error for type params 2022-04-22 11:25:42 +09:00
SparrowLii
db23e773e3 use references to avoid function calls 2022-04-22 08:42:38 +08:00
Michael Howell
2e7b5abbfd rustdoc: make primitive synthetic impls for correct doc module
This improves the accuracy of libcore primitive docs, which was missing the
blanket and auto impls for most primitive types. To test this, compare nightly
[libcore::str] docs, which lack auto traits like Send, with [std::str] docs,
which show them.

[libcore::str]: https://doc.rust-lang.org/nightly/core/primitive.str.html
[libstd::str]: https://doc.rust-lang.org/nightly/std/primitive.str.html

It also avoids getting synthetic impls for primitive types on crates that
do not actually show them.

<details>

<summary>Before and After trace logs</summary>

Before:

	[notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +nightly test.rs 2>&1 | grep -E 'get_blanket_impls\('
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(isize)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls([T])
	TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8])
	TRACE rustdoc::clean::blanket_impl get_blanket_impls([T])
	TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8])
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(char)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(u128)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(u16)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(i128)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(i16)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(str)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(str)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(u64)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(u8)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(i64)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(i8)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const T)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut T)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const [T])
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut [T])
	TRACE rustdoc::clean::blanket_impl get_blanket_impls([T; N])
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(bool)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(u32)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(usize)
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(i32)

After:

	[notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +dev test.rs 2>&1 | grep -E 'get_blanket_impls\('
	TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever)

</details>
2022-04-21 17:06:33 -07:00
bors
0b3404b01b Auto merge of #96261 - petrochenkov:doclink7, r=GuillaumeGomez
rustdoc: Resolve some more doc links early

Trying another subset of https://github.com/rust-lang/rust/pull/94857 that is not too expensive.
2022-04-22 00:05:17 +00:00
bors
10baaa6ed2 Auto merge of #96293 - Dylan-DPC:rollup-saipx8c, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #95434 (Only output DepKind in dump-dep-graph.)
 - #96248 (Stop using a string literal as a format argument)
 - #96251 (Update books)
 - #96269 (errors: minor translation-related changes)
 - #96289 (Remove redundant `format!`s)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-21 21:20:14 +00:00
Tomasz Miąsko
9ff5b7ee41 Update validate_uninhabited_zsts.rs test after MIR building changes
to ensure that it still tests validation, instead of failing earlier on
during evaluation.
2022-04-21 21:44:15 +02:00
Dylan DPC
5ebb8b06d6
Rollup merge of #96289 - aDotInTheVoid:redundant-fmt, r=jackh726
Remove redundant `format!`s
2022-04-21 20:55:21 +02:00
Dylan DPC
35ef5c6e4c
Rollup merge of #96269 - davidtwco:diagnostic-translation-minor-changes, r=oli-obk
errors: minor translation-related changes

- For one error in typeck, specifying "suggestion" as the attribute for the only suggestion is unnecessary, it's the default of the derive.
- The documentation comment for the `SessionDiagnostic` derive is out-of-date, it should have been updated in #95512.

r? `@oli-obk`
2022-04-21 20:55:21 +02:00
Dylan DPC
d8fcf538a8
Rollup merge of #96251 - ehuss:update-books, r=ehuss
Update books

## book

3 commits in 765318b844569a642ceef7bf1adab9639cbf6af3..de0dbffc5812fd885700874e8d258dd334733ac4
2022-04-12 21:14:47 -0400 to 2022-04-18 19:29:45 -0400
- Remove duplicate text
- Add missing punctuation mark in ch16-01
- Update main.rs

## rust-by-example

1 commits in c2a98d9fc5d29c481d42052fbeccfde15ed03116..44a80e8d8bfc5881c9bd69a2cb3a570776ee4181
2022-04-08 06:44:18 -0300 to 2022-04-19 07:46:28 -0300
- Use rust 2018 module file hierarchy (rust-lang/rust-by-example#1532)

## rustc-dev-guide

6 commits in eeb5a83c15b6ae60df3e4f19207376b22c6fbc4c..043e60f4f191651e9f8bf52fa32df14defbb23d9
2022-04-11 23:29:48 +0900 to 2022-04-20 18:57:49 +0900
- Fix a small typo (rust-lang/rustc-dev-guide#1343)
- Extend debugging llvm section (rust-lang/rustc-dev-guide#1290)
- Send people doing *library* stabilizations over to the std-dev-guide (rust-lang/rustc-dev-guide#1317)
- Fix typo serious-&gt;series (rust-lang/rustc-dev-guide#1336)
- Minor type fix (rust-lang/rustc-dev-guide#1337)
- sessiondiagnostic: translation (rust-lang/rustc-dev-guide#1333)

## embedded-book

3 commits in a6de8b6e3ea5d4f0de8b7b9a7e5c1405dc2c2ddb..f7cefbb995eec8c6148f213235e9e2e03268e775
2022-03-17 21:21:39 +0000 to 2022-04-20 10:38:51 +0000
- Fix use of unaligned references in example  (rust-embedded/book#317)
- Correct C interop declarations  (rust-embedded/book#315)
- Update index.md  (rust-embedded/book#316)
2022-04-21 20:55:20 +02:00
Dylan DPC
18b6ad327f
Rollup merge of #96248 - TaKO8Ki:remove-unnecessary-format-args, r=compiler-errors
Stop using a string literal as a format argument
2022-04-21 20:55:19 +02:00
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
bjorn3
f2cdd4a78d Rustup to rustc 1.62.0-nightly (879aff385 2022-04-20) 2022-04-21 20:54:50 +02:00
bors
de1bc0008b Auto merge of #96260 - Kobzol:rustdoc-idmap, r=petrochenkov
rustdoc: Optimize IdMap

Slightly optimizes `IdMap`, which is hot in `markdown_links` (context [here](https://github.com/rust-lang/rust/pull/96135#issuecomment-1103539052)). There are more improvements that can be made near this place, but this seemed like an easy win locally (although I tried it on top of https://github.com/rust-lang/rust/pull/94857, so let's see what happens without that PR).

r? `@petrochenkov`
2022-04-21 18:31:57 +00:00
bjorn3
acb32e6eb5 Sync from rust 1dec35a1b0 2022-04-21 20:23:21 +02:00
bjorn3
a177a7f9df Update Cranelift to 0.83.0 2022-04-21 19:22:12 +02:00
Nixon Enraght-Moony
8fa20e01a5 Remove redundant format!s 2022-04-21 16:46:20 +01: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
Caio
0bd4dafab3 Move some tests to more reasonable directories 2022-04-21 12:24:26 -03:00
Vadim Petrochenkov
7803a41151 rustdoc: Unindent doc fragments on Attributes construction 2022-04-21 16:13:02 +03: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
SparrowLii
3d256b3ecb access local_decls through ecx 2022-04-21 18:26:43 +08: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
Takayuki Maeda
547cb2722b make E0117 error clear 2022-04-21 16:47:01 +09: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
David Wood
f79d5e9458 macros: update doc comment for diagnostic derive
The documentation comment for this derive is out-of-date, it should have
been updated in #95512.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-21 04:22:18 +01:00
David Wood
437468daf7 typeck: remove unnecessary fluent attr
Specifying "suggestion" as the attribute for the only suggestion is
unnecessary, it's the default of the derive.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-21 04:03:13 +01: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