Commit Graph

235601 Commits

Author SHA1 Message Date
Michael Howell 6d6fa792ff rustdoc: clean up the layout for annotated version numbers
This should result in a layout for the actual standard library,
when built on CI, that looks like this:

    _____
   /     \ std
   |  R  | 1.74.0-nightly
   \_____/

   (203c57dbe 2023-09-17)

Having the whole version as one string caused it to flex wrap,
because the sidebar isn't wide enough to fit the whole thing.
2023-10-08 20:17:53 -07:00
Michael Howell 957c5db6be compiletest: add a way to specify params with spaces
This use single quotes, because those aren't used in params,
while double quotes are and would be tougher to parse.
2023-10-08 20:17:53 -07:00
Michael Howell 28ee5da4b7 rustdoc: show crate name beside small logo
This commit changes the layout to something a bit less "look at my logo!!!111"
gigantic, and makes it clearer where clicking the logo will actually take you.
It also means the crate name is persistently at the top of the sidebar, even
when in a sub-item page, and clicking that name takes you back to the root.

|         | Short crate name | Long crate name |
|---------|------------------|-----------------|
| Root    | ![short-root]    | ![long-root]
| Subpage | ![short-subpage] | ![long-subpage]

[short-root]: https://github.com/rust-lang/rust/assets/1593513/fe2ce102-d4b8-44e6-9f7b-68636a907f56
[short-subpage]: https://github.com/rust-lang/rust/assets/1593513/29501663-56c0-4151-b7de-d2637e167125
[long-root]: https://github.com/rust-lang/rust/assets/1593513/f6a385c0-b4c5-4a9c-954b-21b38de4192f
[long-subpage]: https://github.com/rust-lang/rust/assets/1593513/97ec47b4-61bf-4ebe-b461-0d2187b8c6ca

https://notriddle.com/rustdoc-html-demo-4/logo-lockup/image/index.html

https://notriddle.com/rustdoc-html-demo-4/logo-lockup/crossbeam_channel/index.html

https://notriddle.com/rustdoc-html-demo-4/logo-lockup/adler/struct.Adler32.html

https://notriddle.com/rustdoc-html-demo-4/logo-lockup/crossbeam_channel/struct.Sender.html

This improves visual information density (the construct with the logo and
crate name is *shorter* than the logo on its own, because it's not
square) and navigation clarity (we can now see what clicking the Rust logo
does, specifically).

Compare this with the layout at [Phoenix's Hexdocs] (which is what this
proposal is closely based on), the old proposal on [Internals Discourse]
(which always says "Rust standard library" in the sidebar, but doesn't do the
side-by-side layout).

[Phoenix's Hexdocs]: https://hexdocs.pm/phoenix/1.7.7/overview.html
[Internals Discourse]: https://internals.rust-lang.org/t/poc-of-a-new-design-for-the-generated-rustdoc/11018

In newer versions of rustdoc, the crate name and version are always shown in
the sidebar, even in subpages. Clicking the crate name does the same thing
clicking the logo always did: return you to the crate root.

While this actually takes up less screen real estate than the old layout on
desktop, it takes up more HTML. It's also a bit more visually complex.

I could do what the Internals POC did and keep the vertically stacked layout
all the time, instead of doing a horizontal stack where possible. It would
take up more screen real estate, though.

This design is lifted almost verbatim from Hexdocs. It seems to work for them.
[`opentelemetry_process_propagator`], for example, has a long application name.

[`opentelemetry_process_propagator`]: https://hexdocs.pm/opentelemetry_process_propagator/OpentelemetryProcessPropagator.html

Has anyone written the rationale on why the Rust logo shows up on projects that
aren't the standard library? If we turned it off on non-standard crates by
default, it would line wrap crate names a lot less often.

Or maybe we should encourage crate authors to include their own logo more
often? It certainly helps give people a better sense of "place."

I'm not sure of anything that directly follows up this one. Plenty of other
changes could be made to improve the layout, like

* coming up with a less cluttered way to do disclosure (there's a lot of `[-]`
  on the page)
* doing a better job of separating lateral navigation (vec::Vec links to
  vec::IntoIter) and the table of contents (vec::Vec links to vec::Vec::new)
* giving readers more control of how much rustdoc hows them, and giving doc
  authors more control of how much it generates
* better search that reduces the need to browse

But those are mostly orthogonal, not future possibilities unlocked by this change.
2023-10-08 20:17:40 -07:00
bors 37fda989ea Auto merge of #116468 - nnethercote:rustc_serialize, r=Mark-Simulacrum
Streamline `rustc_serialize`

r? `@Mark-Simulacrum`
2023-10-09 00:03:52 +00:00
bors bf9a1c8a19 Auto merge of #116515 - petrochenkov:nolegflavor, r=lqd
linker: Remove unstable legacy CLI linker flavors
2023-10-08 15:18:22 +00:00
bors 4f4a413fe6 Auto merge of #116454 - tmiasko:small-dominators, r=cjgillot
Generalize small dominators optimization

* Use small dominators optimization from 640ede7b0a more generally.
* Merge `DefLocation` and `LocationExtended` since they serve the same purpose.
2023-10-08 12:38:14 +00:00
bors 1e3c8f196b Auto merge of #116183 - cjgillot:debug-dse-always, r=oli-obk
Always preserve DebugInfo in DeadStoreElimination.

This is a version of #106852 that does not check the current crate's debuginfo flag, and always attempts to preserve debuginfo.

I haven't figured out how to handle mixing debuginfo levels for std, the one for the test, and the one for the CI target just right to merge #106852, so this can at least fix the debuginfo issue.

Fixes https://github.com/rust-lang/rust/issues/103655
2023-10-08 10:50:33 +00:00
bors ab039f79b8 Auto merge of #116514 - petrochenkov:nogccld, r=lqd
linker: Remove `-Zgcc-ld` option

It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now.

r? `@lqd`
2023-10-08 09:04:57 +00:00
bors 6d271692b0 Auto merge of #116509 - Enselic:rustc-test-op, r=Mark-Simulacrum
tests/run-make: Move RUSTC_TEST_OP to tools.mk and use in more places
2023-10-08 07:13:19 +00:00
Vadim Petrochenkov b563595c6e linker: Remove `-Zgcc-ld` option
It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now
2023-10-08 10:05:25 +03:00
bors e08de86036 Auto merge of #116487 - tamird:avoid-unwrap-absolute, r=bjorn3
compiler: env/path handling fixes

Please see individual commits. r? `@bjorn3` cf. #116426
2023-10-08 05:24:16 +00:00
bors 1516ca1bc0 Auto merge of #116486 - van-ema:master, r=nikic
Fix to register analysis passes with -Zllvm-plugins at link-time

This PR fixes an unexpected behavior of the `-Zllvm-plugins` flag. It allows to run an out-of-tree pass as part of LTO.
However, analysis passes are registered before the plugin is loaded. As a result an analysis pass, which is passed as a plugin, is not registered. This causes the LLVM PassManager to fail when the analysis pass is queried from a transformation pass  [(here)](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/PassManager.h#L776).

This fix mimics the bahavior in [LLVM LTOBackend.cpp](https://github.com/llvm/llvm-project/blob/main/llvm/lib/LTO/LTOBackend.cpp#L273) by loading the plugin before the analysis passes are registered.

Tested with rustc 1.60 and 1.65 and LLVM-13.0.1.
2023-10-08 03:36:37 +00:00
bors fdf32ee9fc Auto merge of #116450 - Kobzol:automation-try-bors-ci, r=Mark-Simulacrum
Enable new bors try branch to run on CI

Needed to fix [this error](https://github.com/rust-lang/rust/actions/runs/6420044833/job/17431256956). Inspired by https://github.com/rust-lang/rust/pull/99988

Also, removes `try-merge` from the workflow. It shouldn't have been added in https://github.com/rust-lang/rust/pull/116353.

r? `@Mark-Simulacrum`
2023-10-08 01:48:31 +00:00
bors e9addfdecf Auto merge of #114623 - Kobzol:opt-dist-gha-summaries, r=Mark-Simulacrum
Print some information from try builds to GitHub summary

This PR adds some logs from `opt-dist` (the duration of the individual steps of the build pipeline, and the size of the resulting artifacts) to GitHub [job summaries](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/), in order to quickly show useful information right in the GHA CI job page, without needing to read the full log.

[This](https://github.com/rust-lang-ci/rust/actions/runs/5810621086) is how the summary currently looks like.

r? `@ghost`
2023-10-08 00:04:17 +00:00
bors 97c81e1b53 Auto merge of #116416 - Kobzol:ci-host-llvm-17-0-2, r=Mark-Simulacrum
Bump host compiler on x64 dist Linux to LLVM 17.0.2

17.0.0-rc3 had a bunch of miscompilations, and it's probably better in general not to use a RC version of LLVM long term on CI.
2023-10-07 20:59:32 +00:00
bors cf21a0823b Auto merge of #116437 - nnethercote:rustc_features, r=Nilstrieb
Clean up `rustc_features`

Plenty more to be done, but this is a decent start.

r? `@Nilstrieb`
2023-10-07 19:11:17 +00:00
Vadim Petrochenkov 7ecb09d05c linker: Remove unstable legacy CLI linker flavors 2023-10-07 21:57:53 +03:00
bors 598e29bf70 Auto merge of #100806 - timvermeulen:split_inclusive_double_ended_bound, r=dtolnay
Fix generic bound of `str::SplitInclusive`'s `DoubleEndedIterator` impl

`str::SplitInclusive`'s `DoubleEndedIterator` implementation currently uses a `ReverseSearcher` bound for the corresponding searcher. A `DoubleEndedSearcher` bound should have been used instead.

`DoubleEndedIterator` requires that repeated `next_back` calls produce the same items as repeated `next` calls, in opposite order. `ReverseSearcher` lets you search starting from the back of a string, but it makes no guarantees about how its matches correspond to the matches found by a forward search. `DoubleEndedSearcher` is a subtrait of `ReverseSearcher` and does require that the same matches are found in both directions.

This bug fix is a breaking change. Calling `next_back` on `"a+++b".split_inclusive("++")` is currently accepted with repeated calls producing `"b"` and `"a+++"`, while forward iteration yields `"a++"` and `"+b"`. Also see https://github.com/rust-lang/rust/issues/100756#issuecomment-1221307166 for more details.

I believe that this is the only iterator that uses this bound incorrectly — other related iterators such as `str::Split` do have a `DoubleEndedSearcher` bound for their `DoubleEndedIterator` implementation. And `slice::SplitInclusive` doesn't face this problem at all because it doesn't use patterns, only a predicate.

cc `@SkiFire13`
2023-10-07 17:10:02 +00:00
bors 935a091a78 Auto merge of #116330 - RalfJung:dont-key-on-allocid, r=oli-obk
remove Key impls for types that involve an AllocId

I don't understand how but somehow that leads to issues like https://github.com/rust-lang/rust/issues/83085? Anyway removing unused impls doesn't seem like a bad idea. The concerning part is that of course nothing will stop us from having such impls again in the future, alongside re-introducing bugs like #83085.

r? `@oli-obk`
2023-10-07 15:21:05 +00:00
bors 91db3bdc8c Auto merge of #116310 - Enselic:check_fn_args_move_size, r=oli-obk
rustc_monomorphize: Introduce check_fn_args_move_size()

This is in preparation of improving diagnostics of "large moves into functions", a.k.a. passing args.

Note: This PR consists of two self-contained commits that can be reviewed independently.

For https://github.com/rust-lang/rust/issues/83518

Also see https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/arg.20Spans.20for.20TerminatorKind.3A.3ACall.3F

r? `@oli-obk` who is E-mentor
2023-10-07 13:33:19 +00:00
bors 48e24629e9 Auto merge of #115583 - RalfJung:packed-unsized, r=lcnr
fix detecting references to packed unsized fields

Fixes https://github.com/rust-lang/rust/issues/115396

This is a breaking change, but permitted as a soundness fix.
2023-10-07 10:57:18 +00:00
bors d087c6fae2 Auto merge of #116457 - RalfJung:try_eval_scalar_int, r=cjgillot
fix fast-path for try_eval_scalar_int

Cc https://github.com/rust-lang/rust/pull/116281 `@Nadrieril`
2023-10-07 08:58:23 +00:00
Martin Nordholts 56e4715fc6 rustc_monomorphize: Introduce check_fn_args_move_size()
So that we later can improve the accuracy of diagnostics.
2023-10-07 10:29:37 +02:00
Martin Nordholts 41d24ccb49 rustc_monomorphize: Move limit check into check_move_size()
And rename to check_operand_move_size(). Later we will introduce
check_fn_args_move_size().
2023-10-07 10:29:16 +02:00
bors 0f3d72aa7a Auto merge of #116508 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`
2023-10-07 07:10:56 +00:00
Martin Nordholts d9a7afec8b tests/run-make: Use RUSTC_TEST_OP in more places 2023-10-07 08:30:40 +02:00
Martin Nordholts 88966c4773 tests/run-make: Move RUSTC_TEST_OP to tools.mk
To reduce duplication. A follow-up commit will begin using it in even
more places.
2023-10-07 08:30:40 +02:00
Martin Nordholts f96541e9a9 tests/run-make: Remove wrong blessing advice
run-make tests are not special but can be blessed like other tests, like
this:

    ./x.py test --bless tests/run-make/unknown-mod-stdin
2023-10-07 08:27:05 +02:00
Ralf Jung a04b7a3744 allow option-ext as a tool dependency (MPL licensed) 2023-10-07 08:03:45 +02:00
Ralf Jung 5aecfe467b update lockfile 2023-10-07 08:03:44 +02:00
bors fc01a7432b Auto merge of #109214 - tosti007:std_collection_hash_new_rework, r=workingjubilee
Use `HashMap::with_capacity_and_hasher` instead of using base

Cleans up the internal logic for `HashMap::with_capacity` slightly.
2023-10-07 05:26:12 +00:00
bors 1c42857135 Auto merge of #3113 - rust-lang:rustup-2023-10-07, r=saethlin
Automatic sync from rustc
2023-10-07 05:18:45 +00:00
The Miri Conjob Bot 722736ac4a Merge from rustc 2023-10-07 05:10:55 +00:00
The Miri Conjob Bot d322243e38 Preparing for merge from rustc 2023-10-07 05:01:29 +00:00
bors 4ea5190026 Auto merge of #116318 - pitaj:android-backtrace-build, r=workingjubilee
Invoke `backtrace-rs` buildscript in `std` buildscript

Based on #99883 by `@Arc-blroth`
Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
2023-10-07 02:20:50 +00:00
bors 93b6a36568 Auto merge of #116501 - workingjubilee:rollup-fpzov6m, r=workingjubilee
Rollup of 4 pull requests

Successful merges:

 - #116277 (dont call mir.post_mono_checks in codegen)
 - #116400 (Detect missing `=>` after match guard during parsing)
 - #116458 (Properly export function defined in test which uses global_asm!())
 - #116500 (Add tvOS to target_os for register_dtor)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-07 00:27:14 +00:00
Jubilee 4b102b0d8d
Rollup merge of #116500 - simlay:tvos-support-for-register_dtor, r=workingjubilee
Add tvOS to target_os for register_dtor

Closes #116491.
2023-10-06 16:37:48 -07:00
Jubilee 5268120d4a
Rollup merge of #116458 - bjorn3:fix_global_asm_test, r=workingjubilee
Properly export function defined in test which uses global_asm!()

Currently the test passes with the LLVM backend as the codegen unit partitioning logic happens to place both the global_asm!() and the function which calls the function defined by the global_asm!() in the same CGU. With the Cranelift backend it breaks however as it will place all assembly in separate codegen units to be passed to an external linker.
2023-10-06 16:37:47 -07:00
Jubilee 0d68e416a5
Rollup merge of #116400 - estebank:issue-78585, r=WaffleLapkin
Detect missing `=>` after match guard during parsing

```
error: expected one of `,`, `:`, or `}`, found `.`
  --> $DIR/missing-fat-arrow.rs:25:14
   |
LL |         Some(a) if a.value == b {
   |                               - while parsing this struct
LL |             a.value = 1;
   |             -^ expected one of `,`, `:`, or `}`
   |             |
   |             while parsing this struct field
   |
help: try naming a field
   |
LL |             a: a.value = 1;
   |             ++
help: you might have meant to start a match arm after the match guard
   |
LL |         Some(a) if a.value == b => {
   |                                 ++
```

Fix #78585.
2023-10-06 16:37:47 -07:00
Jubilee 6d1c3a40cb
Rollup merge of #116277 - RalfJung:post-mono, r=oli-obk
dont call mir.post_mono_checks in codegen

It seems like all tests are still passing when I remove this... let's see what CI says.
2023-10-06 16:37:46 -07:00
bors 8fdb0a9b57 Auto merge of #114709 - ShE3py:wasi-io-error-more, r=workingjubilee
Use `io_error_more` on WASI

#86442 added many variants to [`io::ErrorKind`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html), but `sys::wasi::decode_error_kind()` wasn't modified to use them.

The preview1 `errno` list:
4712d490fd/legacy/preview1/docs.md (-errno-variant)

Original implementation: #63814

`@rustbot` label +A-error-handling +C-enhancement +O-wasi
2023-10-06 22:39:41 +00:00
Sebastian Imlay 3abef68e63 Add tvOS to target_os for register_dtor 2023-10-06 18:11:49 -04:00
bors 960754090a Auto merge of #116492 - matthiaskrgr:rollup-xzfhmq1, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #114564 (Attempt to describe the intent behind the `From` trait further)
 - #116297 (add some docs to hooks/mod.rs)
 - #116423 (Fix typo in attrs.rs)
 - #116466 (`rustc_transmute` cleanups)
 - #116474 (Assorted small cleanups)
 - #116481 (Reuse existing `Some`s in `Option::(x)or`)
 - #116484 (Minor doc clarification in Once::call_once)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-06 20:51:40 +00:00
Matthias Krüger 7f0cf8c0e4
Rollup merge of #116484 - peterjoel:once-doc-clarify, r=cuviper
Minor doc clarification in Once::call_once
2023-10-06 21:17:51 +02:00
Matthias Krüger f8dae0c20a
Rollup merge of #116481 - scottmcm:tweak-combinators, r=cuviper
Reuse existing `Some`s in `Option::(x)or`

LLVM still has trouble re-using discriminants sometimes when rebuilding a two-variant enum, so when we have the correct variant already built, just use it.

That's shorter in the Rust code, as well as simpler in MIR and the optimized LLVM, so might as well: <https://rust.godbolt.org/z/KhdE8eToW>

Thanks to `@veber-alex` for pointing out this opportunity in https://github.com/rust-lang/rust/issues/101210#issuecomment-1732470941
2023-10-06 21:17:50 +02:00
Matthias Krüger 9796dfdd56
Rollup merge of #116474 - nnethercote:rustc_assorted, r=spastorino
Assorted small cleanups

r? `@spastorino`
2023-10-06 21:17:50 +02:00
Matthias Krüger 25fbd133ea
Rollup merge of #116466 - nnethercote:rustc_transmute, r=oli-obk
`rustc_transmute` cleanups

Just some things I found while poking around this code.

r? `@oli-obk`
2023-10-06 21:17:49 +02:00
Matthias Krüger 81192f2fc4
Rollup merge of #116423 - eltociear:patch-22, r=flip1995
Fix typo in attrs.rs

documenation -> documentation
2023-10-06 21:17:49 +02:00
Matthias Krüger fdb136a83f
Rollup merge of #116297 - RalfJung:hooks, r=oli-obk
add some docs to hooks/mod.rs

r? `@oli-obk`
2023-10-06 21:17:48 +02:00
Matthias Krüger 4dfa5e5dec
Rollup merge of #114564 - scottmcm:when-to-from, r=dtolnay
Attempt to describe the intent behind the `From` trait further

Inspired by the <https://internals.rust-lang.org/t/allow-use-as-and-try-as-for-from-and-tryfrom-traits/19240/26?u=scottmcm> thread.

`@rustbot` label +T-libs-api
2023-10-06 21:17:48 +02:00