Commit Graph

162346 Commits

Author SHA1 Message Date
Matthias Krüger
05bb32dde2
Rollup merge of #92651 - jsha:impl-spacing, r=GuillaumeGomez
Remove "up here" arrow on item-infos

Use spacing to distinguish what is related to a given heading.

This was originally introduced in #53043, in response to #51387. The arrow is a little distracting, and leads the item-info to not be aligned properly with the text below it.

Demo: https://rustdoc.crud.net/jsha/impl-spacing/std/string/struct.String.html

r? ``@GuillaumeGomez``
2022-02-06 04:13:31 +01:00
Matthias Krüger
4a3be6e6e2
Rollup merge of #92383 - lancethepants:armv7-unknown-linux-uclibceabi, r=nagisa
Add new target armv7-unknown-linux-uclibceabi (softfloat)

This adds the new target `armv7-unknown-linux-uclibceabi (softfloat)`. It is of course similar to `armv7-unknown-linux-uclibceabihf (hardfloat)` which was just recently added to rust except that it is `softfloat`.

My interest lies in the Broadcom BCM4707/4708/BCM4709 family, notably found in some Netgear and Asus consumer routers. The armv7 Cortex-A9 cpus found in these devices do not have an fpu or NEON support.

With this patch I've been able to bootstrap rustc, std and host tools `(extended = true)` to run on the target device for native compilation, allowing the target to be used as a development platform.

With the recent addition of `armv7-unknown-linux-uclibceabihf (hardfloat)` it looks like many of the edge cases of using the uclibc c-library are getting worked out nicely. I've been able to compile some complex projects. Some patching still needed in some crates, but getting there for sure.  I think `armv7-unknown-linux-uclibceabi` is ready to be a tier 3 target.

I use a cross-toolchain from my project to bootstrap rust.
https://github.com/lancethepants/tomatoware
The goal of this project is to create a native development environment with support for various languages.
2022-02-06 04:13:30 +01:00
Matthias Krüger
0eda3fa761
Rollup merge of #92300 - Itus-Shield:mips64-openwrt, r=nagisa
mips64-openwrt-linux-musl: Add Tier 3 target

Tier 3 tuple for Mips64 OpenWrt toolchain.

This add first-time support for OpenWrt.  Future Tier3 targets will be added as I test them.

Signed-off-by: Donald Hoskins <grommish@gmail.com>
2022-02-06 04:13:29 +01:00
Matthias Krüger
58bfe72f52
Rollup merge of #91939 - GKFX:feature-91866, r=cjgillot
Clarify error on casting larger integers to char

Closes #91836 with changes to E0604.md and a `span_help`.
2022-02-06 04:13:29 +01:00
bors
88fb06a1f3 Auto merge of #93539 - petrochenkov:doclink, r=camelid,michaelwoerister
rustdoc: Collect traits in scope for foreign inherent impls

Inherent impls can be inlined for variety of reasons (impls of reexported types, impls available through `Deref`, impls inlined for unclear reasons like in https://github.com/rust-lang/rust/pull/88679#issuecomment-1023929480).
If an impl is inlined, then doc links in its comments are resolved and we may need the set of traits that are in scope at that impl's definition point.
So in this PR we simply collect traits in scope for *all* inherent impls from other crates if their `Self` type is public, which is very similar for the strategy for trait impls previously used in https://github.com/rust-lang/rust/pull/88679.

Fixes https://github.com/rust-lang/rust/issues/93476
Fixes https://github.com/rust-lang/rust/pull/88679#issuecomment-1026520300
Fixes https://github.com/rust-lang/rust/pull/88679#issuecomment-1023929480
2022-02-05 18:27:06 +00:00
bors
291bf94cfd Auto merge of #93597 - GuillaumeGomez:update-browser-ui-test, r=jsha
Update browser-ui-test version

The puppeteer version update is limited because new versions has some "interesting" flaws.

r? `@jsha`
2022-02-05 15:46:24 +00:00
bors
4c55c8362d Auto merge of #93655 - matthiaskrgr:rollup-dm88b02, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #90132 (Stabilize `-Z instrument-coverage` as `-C instrument-coverage`)
 - #91589 (impl `Arc::unwrap_or_clone`)
 - #93495 (kmc-solid: Fix off-by-one error in `SystemTime::now`)
 - #93576 (Emit more valid HTML from rustdoc)
 - #93608 (Clean up `find_library_crate`)
 - #93612 (doc: use U+2212 for minus sign in integer MIN/MAX text)
 - #93615 (Fix `isize` optimization in `StableHasher` for big-endian architectures)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-02-05 01:47:59 +00:00
lancethepants
8c6f7fd5e1 Add new target armv7-unknown-linux-uclibceabi (softfloat) 2022-02-04 11:45:00 -07:00
Matthias Krüger
2d62bd00ff
Rollup merge of #93615 - Kobzol:stable-hash-opt-endianness, r=the8472
Fix `isize` optimization in `StableHasher` for big-endian architectures

This PR fixes a problem with the stable hash optimization introduced in https://github.com/rust-lang/rust/pull/93432. As `@michaelwoerister` has [found out](https://github.com/rust-lang/rust/pull/93432#issuecomment-1028756212), the original implementation wouldn't produce the same hash on little/big architectures.

r? `@the8472`
2022-02-04 18:42:18 +01:00
Matthias Krüger
9ba09f976c
Rollup merge of #93612 - tspiteri:master, r=m-ou-se
doc: use U+2212 for minus sign in integer MIN/MAX text

Closes #90793.
2022-02-04 18:42:17 +01:00
Matthias Krüger
9b7f1f5649
Rollup merge of #93608 - nnethercote:speed-up-find_library_crate, r=petrochenkov
Clean up `find_library_crate`

Some clean-ups.

r? `@petrochenkov`
2022-02-04 18:42:16 +01:00
Matthias Krüger
3edec80551
Rollup merge of #93576 - jsha:fix-rustdoc-html, r=GuillaumeGomez
Emit more valid HTML from rustdoc

Previously, tidy-html5 (`tidy`) would complain about a few things in our HTML. The main thing is that `<summary>` tags can't contain `<div>`s. That's easily fixed by changing out the `<div>`s for `<span>`s with `display: block`.

However, there's also a rule that `<span>`s can't contain heading elements. `<span>` permits only "phrasing content" https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span, and `<h3>` (and friends) are "Flow content, heading content, palpable content". https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements

We have a wrapping `<div>` that goes around each `<h3>`/`<h4>`, etc. We turn that into a `<section>` rather than a `<span>` because `<section>` permits "flow content". https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section

After this change we get only three warnings from tidy, run on struct.String.html:

line 6 column 10790 - Warning: trimming empty <span>
line 1 column 1118 - Warning: <link> proprietary attribute "disabled"
line 1 column 1193 - Warning: <link> proprietary attribute "disabled"

The empty `<span>` is a known issue - there's a span in front of the search box to work around a strange Safari issue.

The `<link>` attributes are the non-default stylesheets. We can probably refactor theme application to avoid using this proprietary "disabled" attribute.

We can suppress those warnings with flags to tidy, and get a run that returns 0 (success):

```
tidy -o /dev/null -quiet --drop-empty-elements no --warn-proprietary-attributes no build/x86_64-unknown-linux-gnu/doc/std/string/trait.ToString.html
```

Note: this requires the latest version of tidy-html5, built from https://github.com/htacg/tidy-html5. Older versions (including the default version on Ubuntu 21.10) think `<section>` can't occur inside `<summary>`.

Demo: https://rustdoc.crud.net/jsha/fix-rustdoc-html/std/string/struct.String.html

r? `@GuillaumeGomez`
2022-02-04 18:42:15 +01:00
Matthias Krüger
af2886eef9
Rollup merge of #93495 - solid-rs:fix-kmc-solid-rtc-month, r=yaahc
kmc-solid: Fix off-by-one error in `SystemTime::now`

Fixes a miscalculation of `SystemTime`  on the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets.

Unlike the identically-named libc counterpart `tm::tm_mon`, `SOLID_RTC_TIME::tm_mon` contains a 1-based month number.
2022-02-04 18:42:14 +01:00
Matthias Krüger
6f03bd09ff
Rollup merge of #91589 - derekdreery:arc_unwrap_or_clone, r=m-ou-se
impl `Arc::unwrap_or_clone`

The function gets the inner value, cloning only if necessary. The conversation started on [`irlo`](https://internals.rust-lang.org/t/arc-into-inner/15707). If the reviewer think the PR has potential to be merged, and does not need an RFC, then I will create the corresponding tracking issues and update the PR.

## Alternative names

 - `into_inner`
 - `make_owned`
 - `make_unique`
 - `take_*` (`take_inner`?)
2022-02-04 18:42:13 +01:00
Matthias Krüger
2fe9a32ed2
Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser
Stabilize `-Z instrument-coverage` as `-C instrument-coverage`

(Tracking issue for `instrument-coverage`: https://github.com/rust-lang/rust/issues/79121)

This PR stabilizes support for instrumentation-based code coverage, previously provided via the `-Z instrument-coverage` option. (Continue supporting `-Z instrument-coverage` for compatibility for now, but show a deprecation warning for it.)

Many, many people have tested this support, and there are numerous reports of it working as expected.

Move the documentation from the unstable book to stable rustc documentation. Update uses and documentation to use the `-C` option.

Addressing questions raised in the tracking issue:

> If/when stabilized, will the compiler flag be updated to -C instrument-coverage? (If so, the -Z variant could also be supported for some time, to ease migrations for existing users and scripts.)

This stabilization PR updates the option to `-C` and keeps the `-Z` variant to ease migration.

> The Rust coverage implementation depends on (and automatically turns on) -Z symbol-mangling-version=v0. Will stabilizing this feature depend on stabilizing v0 symbol-mangling first? If so, what is the current status and timeline?

This stabilization PR depends on https://github.com/rust-lang/rust/pull/90128 , which stabilizes `-C symbol-mangling-version=v0` (but does not change the default symbol-mangling-version).

> The Rust coverage implementation implements the latest version of LLVM's Coverage Mapping Format (version 4), which forces a dependency on LLVM 11 or later. A compiler error is generated if attempting to compile with coverage, and using an older version of LLVM.

Given that LLVM 13 has now been released, requiring LLVM 11 for coverage support seems like a reasonable requirement. If people don't have at least LLVM 11, nothing else breaks; they just can't use coverage support. Given that coverage support currently requires a nightly compiler and LLVM 11 or newer, allowing it on a stable compiler built with LLVM 11 or newer seems like an improvement.

The [tracking issue](https://github.com/rust-lang/rust/issues/79121) and the [issue label A-code-coverage](https://github.com/rust-lang/rust/labels/A-code-coverage) link to a few open issues related to `instrument-coverage`, but none of them seem like showstoppers. All of them seem like improvements and refinements we can make after stabilization.

The original `-Z instrument-coverage` support went through a compiler-team MCP at https://github.com/rust-lang/compiler-team/issues/278 . Based on that, `@pnkfelix` suggested that this needed a stabilization PR and a compiler-team FCP.
2022-02-04 18:42:13 +01:00
bors
71226d717a Auto merge of #93654 - RalfJung:miri, r=RalfJung
update miri

Fixes https://github.com/rust-lang/rust/issues/93355
r? `@ghost`
2022-02-04 17:40:02 +00:00
Ralf Jung
5f91c89a04 update miri 2022-02-04 18:26:16 +01:00
Trevor Spiteri
d6e1df8d59 doc: use U+2212 for minus sign in integer MIN/MAX text 2022-02-04 17:59:53 +01:00
bors
cb18e83e85 Auto merge of #93645 - matthiaskrgr:rollup-eua2621, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #92735 (Add crate filter parameter in URL)
 - #93402 (Windows: Disable LLVM crash dialog boxes.)
 - #93508 (Add rustdoc info to jsondocck output)
 - #93551 (Add package.json in gitignore)
 - #93555 (Link `try_exists` docs to `Path::exists`)
 - #93585 (Missing tests for #92630)
 - #93593 (Fix ret > 1 bound if shadowed by const)
 - #93630 (clippy::perf fixes)
 - #93631 (rustc_mir_dataflow: use iter::once instead of Some().into_iter)
 - #93632 (rustdoc: clippy::complexity fixes)
 - #93638 (rustdoc: remove unused Hash impl)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-02-04 14:33:00 +00:00
Vadim Petrochenkov
afc0030ed3 rustdoc: Collect traits in scope for foreign inherent impls 2022-02-04 22:26:33 +08:00
Matthias Krüger
1426f0e6f0
Rollup merge of #93638 - notriddle:notriddle/unused-hash, r=GuillaumeGomez
rustdoc: remove unused Hash impl
2022-02-04 14:59:08 +01:00
Matthias Krüger
9351d311d4
Rollup merge of #93632 - matthiaskrgr:rustdoclippy2, r=GuillaumeGomez
rustdoc: clippy::complexity fixes

clippy::map_flatten
clippy::clone_on_copy
clippy::useless_conversion
clippy::needless_arbitrary_self_type
2022-02-04 14:59:07 +01:00
Matthias Krüger
4b7035918c
Rollup merge of #93631 - notriddle:notriddle/cleanup-some-into-iter, r=oli-obk
rustc_mir_dataflow: use iter::once instead of Some().into_iter
2022-02-04 14:59:06 +01:00
Matthias Krüger
03cad867a6
Rollup merge of #93630 - matthiaskrgr:clipperf, r=oli-obk
clippy::perf fixes

single_char_pattern and to_string_in_format_args
2022-02-04 14:59:05 +01:00
Matthias Krüger
92a7f5fa07
Rollup merge of #93593 - JulianKnodt:master, r=oli-obk
Fix ret > 1 bound if shadowed by const

Prior to a change, it would only look at types in bounds. When it started looking for consts,
shadowing type variables with a const would cause an ICE, so now defer looking at consts only if
there are no types present.

cc ``````@compiler-errors``````
Should Fix #93553
2022-02-04 14:59:04 +01:00
Matthias Krüger
ca2ef71e96
Rollup merge of #93585 - tamaroning:add_tests_for_92630, r=m-ou-se
Missing tests for #92630

fixes #93143
2022-02-04 14:59:03 +01:00
Matthias Krüger
f070e0b5a6
Rollup merge of #93555 - ChrisDenton:fs-try-exists-doc, r=Mark-Simulacrum
Link `try_exists` docs to `Path::exists`

Links to the existing `Path::exists` method from both `std::Path::try_exists` and `std::fs:try_exists`.

Tracking issue for `path_try_exists`: #83186
2022-02-04 14:59:02 +01:00
Matthias Krüger
3876cb6b8e
Rollup merge of #93551 - GuillaumeGomez:ignore-package-json, r=Mark-Simulacrum
Add package.json in gitignore

It happened a few times (last one is https://github.com/rust-lang/rust/pull/93537/files#r796757998) so I think it's fine to ignore this file to prevent it to happen again in the future. :)

r? ```@Mark-Simulacrum```
2022-02-04 14:59:00 +01:00
Matthias Krüger
c77f0a42d3
Rollup merge of #93508 - CraftSpider:jsondocck-runtest-output, r=Mark-Simulacrum
Add rustdoc info to jsondocck output

Makes debugging issues in the generated output simpler by handling emitted logs and etc.
2022-02-04 14:58:59 +01:00
Matthias Krüger
f7e0f97631
Rollup merge of #93402 - ehuss:llvm-dialog, r=michaelwoerister
Windows: Disable LLVM crash dialog boxes.

This disables the crash dialog box on Windows. When LLVM hits an assertion, it will open a dialog box with Abort/Retry/Ignore. This is annoying on CI because CI will just hang until it times out (which can take hours).

Instead of opening a dialog box, it will print a message like this:

```
Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file D:\Proj\rust\rust\src\llvm-project\llvm\include\llvm/Support/Casting.h, line 255
```

Closes #92829
2022-02-04 14:58:57 +01:00
Matthias Krüger
f2721fab23
Rollup merge of #92735 - GuillaumeGomez:crate-filter-url-param, r=jsha
Add crate filter parameter in URL

Fixes #92621.

r? `@jsha`
2022-02-04 14:58:56 +01:00
Guillaume Gomez
ef00e3bee7 Add comment in GUI test 2022-02-04 11:11:03 +01:00
Guillaume Gomez
925ff53fef Update browser-ui-test version 2022-02-04 11:10:37 +01:00
Nicholas Nethercote
2826586b91 Add a comment about possible mismatches. 2022-02-04 13:10:05 +11:00
Nicholas Nethercote
2b8d3dea63 Remove staticlibs local variable. 2022-02-04 13:10:00 +11:00
Wesley Wiser
3187f4136a Fix some tests to use -Cinstrument-coverage 2022-02-03 20:01:55 -05:00
Michael Howell
cdd22547f0 rustdoc: remove unused Hash impl 2022-02-03 17:01:32 -07:00
Nicholas Nethercote
6dcda2aaec Clean up find_library_crate.
By introducing prefix and suffix variables for all file types, and
renaming some variables.
2022-02-04 10:55:32 +11:00
Matthias Krüger
f1a399abaa rustdoc: clippy::complexity fixes
clippy::map_flatten
clippy::clone_on_copy
clippy::useless_conversion
clippy::needless_arbitrary_self_type
2022-02-03 23:17:13 +01:00
Guillaume Gomez
829a0471d0 Add GUI test for crate filter URL parameter 2022-02-03 22:59:34 +01:00
Guillaume Gomez
17fe3068d2 Update tester to have FILTER_CRATE set to null if undefined. 2022-02-03 22:59:33 +01:00
Guillaume Gomez
cfa677666c Add filter-crate URL parameter 2022-02-03 22:59:33 +01:00
Michael Howell
a2a4cababe rustc_mir_dataflow: use iter::once instead of Some().into_iter 2022-02-03 13:52:26 -07:00
Matthias Krüger
de2abc29e9 clippy::perf fixes
single_char_pattern and to_string_in_format_args
2022-02-03 21:45:51 +01:00
bors
4e8fb743cc Auto merge of #93621 - JohnTitor:rollup-1bcud0x, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #92310 (rustdoc: Fix ICE report)
 - #92802 (Deduplicate lines in long const-eval stack trace)
 - #93515 (Factor convenience functions out of main printer implementation)
 - #93566 (Make rustc use `RUST_BACKTRACE=full` by default)
 - #93589 (Use Option::then in two places)
 - #93600 (fix: Remove extra newlines from junit output)
 - #93606 (Correct incorrect description of preorder traversals)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-02-03 15:49:30 +00:00
kadmin
2dfd77d675 Fix ret > 1 bound if shadowed by const
Prior to a change, it would only look at types in bounds. When it started looking for consts,
shadowing type variables with a const would cause an ICE, so now defer looking at consts only if
there are no types present.
2022-02-03 15:17:51 +00:00
Eric Huss
c64d6bf5af Only disable dialogs on CI.
The "CI" environment var isn't universal (for example, I think Azure
uses TF_BUILD). However, we are mostly concerned with rust-lang/rust's
own CI which currently is GitHub Actions which does set "CI". And I
think most other providers use "CI" as well.
2022-02-03 07:03:44 -08:00
Yuki Okushi
38adea96c5
Rollup merge of #93606 - JakobDegen:mischaracterized-preorder, r=oli-obk
Correct incorrect description of preorder traversals

The internal documentation for the `Preorder` type gave an incorrect description (the description is not even correct for the example provided, since C is visited after one of its successors). This corrects the description, and adds in a sentence explaining more precisely how the traversals are performed.
2022-02-03 22:20:29 +09:00
Yuki Okushi
95efb2b578
Rollup merge of #93600 - last-partizan:fix-junit-formatter, r=yaahc
fix: Remove extra newlines from junit output

This PR fixes extra newline in junit output https://github.com/rust-lang/rust/issues/93454
2022-02-03 22:20:28 +09:00
Yuki Okushi
7712dfd46e
Rollup merge of #93589 - est31:option_then, r=cjgillot
Use Option::then in two places
2022-02-03 22:20:27 +09:00