]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoUpdate src/test/ui/proc-macro/expand-expr.rs
clubby789 [Mon, 14 Nov 2022 19:44:30 +0000 (19:44 +0000)]
Update src/test/ui/proc-macro/expand-expr.rs

Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
19 months agoFix using `include_bytes` in pattern position
clubby789 [Mon, 14 Nov 2022 17:43:21 +0000 (17:43 +0000)]
Fix using `include_bytes` in pattern position

19 months agoAuto merge of #104387 - Manishearth:rollup-9e551p5, r=Manishearth
bors [Mon, 14 Nov 2022 06:30:18 +0000 (06:30 +0000)]
Auto merge of #104387 - Manishearth:rollup-9e551p5, r=Manishearth

Rollup of 9 pull requests

Successful merges:

 - #103709 (ci: Upgrade dist-x86_64-netbsd to NetBSD 9.0)
 - #103744 (Upgrade cc for working is_flag_supported on cross-compiles)
 - #104105 (llvm: dwo only emitted when object code emitted)
 - #104158 (Return .efi extension for EFI executable)
 - #104181 (Add a few known-bug tests)
 - #104266 (Regression test for coercion of mut-ref to dyn-star)
 - #104300 (Document `Path::parent` behavior around relative paths)
 - #104304 (Enable profiler in dist-s390x-linux)
 - #104362 (Add `delay_span_bug` to `AttrWrapper::take_for_recovery`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoAuto merge of #104188 - jyn514:download-config-only, r=Mark-Simulacrum
bors [Mon, 14 Nov 2022 03:15:03 +0000 (03:15 +0000)]
Auto merge of #104188 - jyn514:download-config-only, r=Mark-Simulacrum

Make all download functions need only Config, not Builder

This also adds a new `mod download` instead of scattering the download code across `config.rs` and `native.rs`.

This is the simplest and also most bit-rotty part of https://github.com/rust-lang/rust/pull/102282. Opening it earlier so it's not mixed in with behavior changes and to avoid rebase hell.

cc https://github.com/rust-lang/rust/issues/94829 (which nows has the hackmd linked).

r? `@Mark-Simulacrum`

19 months agoMake all download functions need only Config, not Builder
Joshua Nelson [Sun, 30 Oct 2022 22:29:51 +0000 (17:29 -0500)]
Make all download functions need only Config, not Builder

This also adds a new `mod download` instead of scattering the download code
across `config.rs` and `native.rs`.

19 months agoRollup merge of #104362 - WaffleLapkin:span_bug_won't_come_on_time_today, r=Aaron1011
Manish Goregaokar [Mon, 14 Nov 2022 02:49:27 +0000 (21:49 -0500)]
Rollup merge of #104362 - WaffleLapkin:span_bug_won't_come_on_time_today, r=Aaron1011

Add `delay_span_bug` to `AttrWrapper::take_for_recovery`

`take_for_recovery` should only be used for recovery (when we should already have an error), so using `delay_span_bug` seems appropriate.

cc `@Aaron1011` (you've added the `FIXME` that this pr fixes)

19 months agoRollup merge of #104304 - uweigand:s390x-profiler, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:27 +0000 (21:49 -0500)]
Rollup merge of #104304 - uweigand:s390x-profiler, r=Mark-Simulacrum

Enable profiler in dist-s390x-linux

Build the profiler runtime to allow using -C profile-generate and -C instrument-coverage on s390x-linux.

I've verified in a local build that the runtime builds and the profiler is working fine on the platform.

19 months agoRollup merge of #104300 - tbu-:pr_path_parent_caveats, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:27 +0000 (21:49 -0500)]
Rollup merge of #104300 - tbu-:pr_path_parent_caveats, r=Mark-Simulacrum

Document `Path::parent` behavior around relative paths

A relative path with just one component will return `Some("")` as its parent, which wasn't clear to me from the documentation.

The parent of `""` is `None`, which was missing from the documentation as well.

19 months agoRollup merge of #104266 - compiler-errors:issue-102430, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:26 +0000 (21:49 -0500)]
Rollup merge of #104266 - compiler-errors:issue-102430, r=Mark-Simulacrum

Regression test for coercion of mut-ref to dyn-star

Closes #102430

19 months agoRollup merge of #104181 - jackh726:known-bug-tests, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:26 +0000 (21:49 -0500)]
Rollup merge of #104181 - jackh726:known-bug-tests, r=Mark-Simulacrum

Add a few known-bug tests

The labels of these tests should be changed from `S-bug-has-mcve` to `S-bug-has-test` once this is merged.

cc:
#101518
#99492
#90950
#89196
#104034
#101350
#103705
#103899

I couldn't reproduce the failures in #101962 and #100772 (so either these have started passing, or I didn't repro properly), so leaving those out for now.

#102065 was a bit more complicated, since it uses `rustc_private` and I didn't want to mess with that.

19 months agoRollup merge of #104158 - Ayush1325:executable, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:25 +0000 (21:49 -0500)]
Rollup merge of #104158 - Ayush1325:executable, r=Mark-Simulacrum

Return .efi extension for EFI executable

Originally part of https://github.com/rust-lang/rust/pull/100316

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoRollup merge of #104105 - davidtwco:split-dwarf-lto, r=michaelwoerister
Manish Goregaokar [Mon, 14 Nov 2022 02:49:25 +0000 (21:49 -0500)]
Rollup merge of #104105 - davidtwco:split-dwarf-lto, r=michaelwoerister

llvm: dwo only emitted when object code emitted

Fixes #103932.

`CompiledModule` should not think a DWARF object was emitted when a bitcode-only compilation has happened, this can confuse archive file creation (which expects to create an archive containing non-existent dwo files).

r? ``````@michaelwoerister``````

19 months agoRollup merge of #103744 - palfrey:unwind-upgrade-cc, r=Mark-Simulacrum
Manish Goregaokar [Mon, 14 Nov 2022 02:49:24 +0000 (21:49 -0500)]
Rollup merge of #103744 - palfrey:unwind-upgrade-cc, r=Mark-Simulacrum

Upgrade cc for working is_flag_supported on cross-compiles

https://github.com/rust-lang/rust/pull/85806 fixed unwind v.s gcc support on later Android ndks using `is_flag_supported`. However, due to https://github.com/rust-lang/cc-rs/issues/675, this didn't work properly on cross-compiles. https://github.com/rust-lang/cc-rs/commit/3eeb50b391a7543a6fed96276ee9388b5430a50d fixes this, and was released in cc 1.0.74, hence the upgrade

19 months agoRollup merge of #103709 - cuviper:netbsd-9, r=pietroalbini
Manish Goregaokar [Mon, 14 Nov 2022 02:49:24 +0000 (21:49 -0500)]
Rollup merge of #103709 - cuviper:netbsd-9, r=pietroalbini

ci: Upgrade dist-x86_64-netbsd to NetBSD 9.0

This is another step in toolchain upgrades for LLVM 16, which will need at least GCC 7.1.

Our previous NetBSD 8.0 cross-toolchain used its system GCC 5.5. While there are newer versions available in pkgsrc, I could not get those working for cross-compilation. Upgrading to NetBSD 9.0 gets us GCC 7.4, which is sufficient for now.

This will affect the compatibility of the build we ship for `x86_64-unknown-netbsd`, but others may still build their own from source if that is needed. It is expected that NetBSD 8 will reach EOL soon anyway, approximately one month after 10 is released, but there is no firm date for that.

19 months agoAuto merge of #103858 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini
bors [Mon, 14 Nov 2022 00:07:19 +0000 (00:07 +0000)]
Auto merge of #103858 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini

Bump bootstrap compiler to 1.66

This PR:

- Bumps version placeholders to release
- Bumps to latest beta
- cfg-steps code

r? `@pietroalbini`

19 months agoAdd a few known-bug tests
Jack Huey [Wed, 9 Nov 2022 03:15:02 +0000 (22:15 -0500)]
Add a few known-bug tests

19 months agoAuto merge of #103894 - mati865:gnullvm-libunwind-changes, r=thomcc
bors [Sun, 13 Nov 2022 21:12:48 +0000 (21:12 +0000)]
Auto merge of #103894 - mati865:gnullvm-libunwind-changes, r=thomcc

Change the way libunwind is linked for *-windows-gnullvm targets

I have no idea why previous way works for `x86_64-fortanix-unknown-sgx` (assuming it actually works...) but not for `gnullvm`. It fails when linking libtest during Rust build (unless somebody adds `RUSTFLAGS='-Clinkarg=-lunwind'`).
Also fixes exception handling on AArch64.

19 months agoAuto merge of #104370 - matthiaskrgr:rollup-c3b38sm, r=matthiaskrgr
bors [Sun, 13 Nov 2022 18:13:08 +0000 (18:13 +0000)]
Auto merge of #104370 - matthiaskrgr:rollup-c3b38sm, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #103996 (Add small clarification around using pointers derived from references)
 - #104315 (Improve spans with `use crate::{self}`)
 - #104320 (Use `derive_const` and rm manual StructuralEq impl)
 - #104357 (add is_sized method on Abi and Layout, and use it)
 - #104365 (Add x tool to triagebot)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoRollup merge of #104365 - albertlarsan68:add-x-tool-to-triagebot, r=Mark-Simulacrum
Matthias Krüger [Sun, 13 Nov 2022 16:37:38 +0000 (17:37 +0100)]
Rollup merge of #104365 - albertlarsan68:add-x-tool-to-triagebot, r=Mark-Simulacrum

Add x tool to triagebot

Assign the A-bootstrap label when a pr modifies the x tool.

Happened in #104350.

19 months agoRollup merge of #104357 - RalfJung:is-sized, r=cjgillot
Matthias Krüger [Sun, 13 Nov 2022 16:37:38 +0000 (17:37 +0100)]
Rollup merge of #104357 - RalfJung:is-sized, r=cjgillot

add is_sized method on Abi and Layout, and use it

This avoids the double negation of `!is_unsized()` that we have quite a lot.

19 months agoRollup merge of #104320 - fee1-dead-contrib:use-derive-const-in-std, r=oli-obk
Matthias Krüger [Sun, 13 Nov 2022 16:37:37 +0000 (17:37 +0100)]
Rollup merge of #104320 - fee1-dead-contrib:use-derive-const-in-std, r=oli-obk

Use `derive_const` and rm manual StructuralEq impl

This does not change any semantics of the impl except for the const stability. It should be fine because trait methods and const bounds can never be used in stable without enabling `const_trait_impl`.

cc `@oli-obk`

19 months agoRollup merge of #104315 - SparkyPotato:fix-104276, r=cjgillot
Matthias Krüger [Sun, 13 Nov 2022 16:37:37 +0000 (17:37 +0100)]
Rollup merge of #104315 - SparkyPotato:fix-104276, r=cjgillot

Improve spans with `use crate::{self}`

Fixes #104276.

The error becomes:
```
error: crate root imports need to be explicitly named: `use crate as name;`
 --> src/lib.rs.rs:1:13
  |
1 | use crate::{self};
  |             ^^^^

warning: unused import: `self`
 --> src/lib.rs:1:13
  |
1 | use crate::{self};
  |             ^^^^
  |
  = note: `#[warn(unused_imports)]` on by default
```

19 months agoRollup merge of #103996 - SUPERCILEX:docs, r=RalfJung
Matthias Krüger [Sun, 13 Nov 2022 16:37:36 +0000 (17:37 +0100)]
Rollup merge of #103996 - SUPERCILEX:docs, r=RalfJung

Add small clarification around using pointers derived from references

r? `@RalfJung`

One question about your example from https://github.com/rust-lang/libs-team/issues/122: at what point does UB arise? If writing 0 does not cause UB and the reference `x` is never read or written to (explicitly or implicitly by being wrapped in another data structure) after the call to `foo`, does UB only arise when dropping the value? I don't really get that since I thought references were always supposed to point to valid data?

```rust
fn foo(x: &mut NonZeroI32)  {
  let ptr = x as *mut NonZeroI32;
  unsafe { ptr.cast::<i32>().write(0); } // no UB here
  // What now? x is considered garbage when?
}
```

19 months agoMake it also assign correct people
Albert Larsan [Sun, 13 Nov 2022 15:09:15 +0000 (16:09 +0100)]
Make it also assign correct people

19 months agoAuto merge of #104292 - GuillaumeGomez:fix-missing-reexports-doc-comments, r=notriddle
bors [Sun, 13 Nov 2022 15:02:10 +0000 (15:02 +0000)]
Auto merge of #104292 - GuillaumeGomez:fix-missing-reexports-doc-comments, r=notriddle

Fix missing reexports' doc comments

Fixes #81893.

The issue was that an import directly "links" to the target without the intermediate imports. Unfortunately, to fix this bug we need to go through them one by one. To do so, I take the import path direct parent (so `b` in `a::b::c`) and then look for `c` into it.

r? `@notriddle`

19 months agoAdd x tool to triagebot
Albert Larsan [Sun, 13 Nov 2022 14:31:49 +0000 (15:31 +0100)]
Add x tool to triagebot

Assign the A-bootstrap label when a pr modifies the x tool.

19 months agoAdd `delay_span_bug` to `AttrWrapper::take_for_recovery`
Maybe Waffle [Sun, 13 Nov 2022 13:08:58 +0000 (13:08 +0000)]
Add `delay_span_bug` to `AttrWrapper::take_for_recovery`

19 months agoAuto merge of #93563 - ibraheemdev:crossbeam-channel, r=Amanieu
bors [Sun, 13 Nov 2022 12:08:42 +0000 (12:08 +0000)]
Auto merge of #93563 - ibraheemdev:crossbeam-channel, r=Amanieu

Merge crossbeam-channel into `std::sync::mpsc`

This PR imports the [`crossbeam-channel`](https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel#crossbeam-channel) crate into the standard library as a private module, `sync::mpmc`. `sync::mpsc` is now implemented as a thin wrapper around `sync::mpmc`. The primary purpose of this PR is to resolve https://github.com/rust-lang/rust/issues/39364. The public API intentionally remains the same.

The reason https://github.com/rust-lang/rust/issues/39364 has not been fixed in over 5 years is that the current channel is *incredibly* complex. It was written many years ago and has sat mostly untouched since. `crossbeam-channel` has become the most popular alternative on crates.io, amassing over 30 million downloads. While crossbeam's channel is also complex, like all fast concurrent data structures, it avoids some of the major issues with the current implementation around dynamic flavor upgrades. The new implementation decides on the datastructure to be used when the channel is created, and the channel retains that structure until it is dropped.

Replacing `sync::mpsc` with a simpler, less performant implementation has been discussed as an alternative. However, Rust touts itself as enabling *fearless concurrency*, and having the standard library feature a subpar implementation of a core concurrency primitive doesn't feel right. The argument is that slower is better than broken, but this PR shows that we can do better.

As mentioned before, the primary purpose of this PR is to fix https://github.com/rust-lang/rust/issues/39364, and so the public API intentionally remains the same. *After* that problem is fixed, the fact that `sync::mpmc` now exists makes it easier to fix the primary limitation of `mpsc`, the fact that it only supports a single consumer. spmc and mpmc are two other common concurrency patterns, and this change enables a path to deprecating `mpsc` and exposing a general `sync::channel` module that supports multiple consumers. It also implements other useful methods such as `send_timeout`. That said, exposing MPMC and other new functionality is mostly out of scope for this PR, and it would be helpful if discussion stays on topic :)

For what it's worth, the new implementation has also been shown to be more performant in [some basic benchmarks](https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel/benchmarks#results).

cc `@taiki-e`

r? rust-lang/libs

19 months agoadd is_sized method on Abi and Layout, and use it
Ralf Jung [Sun, 13 Nov 2022 11:14:59 +0000 (12:14 +0100)]
add is_sized method on Abi and Layout, and use it

19 months agoAuto merge of #104351 - JohnTitor:rollup-ikh2dzr, r=JohnTitor
bors [Sun, 13 Nov 2022 09:13:41 +0000 (09:13 +0000)]
Auto merge of #104351 - JohnTitor:rollup-ikh2dzr, r=JohnTitor

Rollup of 5 pull requests

Successful merges:

 - #103650 (rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`)
 - #104177 (rustdoc: use consistent "popover" styling for notable traits)
 - #104318 (Move tests)
 - #104323 (rustdoc: remove no-op CSS `.scrape-help { background: transparent }`)
 - #104345 (Fix up a Fluent message)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agomove span to `self` instead of `crate`
SparkyPotato [Sun, 13 Nov 2022 08:16:11 +0000 (13:46 +0530)]
move span to `self` instead of `crate`

19 months agoRollup merge of #104345 - fmease:fix-up-a-fluent-message, r=compiler-errors
Yuki Okushi [Sun, 13 Nov 2022 07:41:46 +0000 (16:41 +0900)]
Rollup merge of #104345 - fmease:fix-up-a-fluent-message, r=compiler-errors

Fix up a Fluent message

Fix up a Fluent message which contained arrows `->` after [selectors](https://projectfluent.org/fluent/guide/selectors.html). The original author probably thought that they were required as part of the selector syntax but in reality they were interpreted as literal text and actually showed up in the emitted diagnostic.

This wasn't caught during the diagnostic migration since the branch constructing the diagnostic in question (`rustc_infer::errors::LifetimeMismatchLabels::Normal`) was not exercised by the UI test suite. I've added two more test cases to do so (one testing `LifetimeMismatchLabels::Normal` where `hir_equal == true` and one where `hir_equal == false`).

Diff visualizing the `->` bug (`master` vs `fix-up-a-fluent-message`):

```diff
 error[E0623]: lifetime mismatch
   --> src/test/ui/implied-bounds/hrlt-implied-trait-bounds-guard.rs:39:30
    |
 39 | fn badboi3<'in_, 'out, T>(a: Foo<'in_, 'out, (&'in_ T, &'out T)>, sadness: &'in_ T) {
    |                              ^^^^^^^^^^^^^^^^^-------^^-------^^
    |                              |                |
    |                              |                these two types are declared with different lifetimes...
-   |                              ...but data->  from `a` flows->  into `a` here
+   |                              ...but data from `a` flows into `a` here
```

19 months agoRollup merge of #104323 - notriddle:notriddle/scrape-help-background, r=GuillaumeGomez
Yuki Okushi [Sun, 13 Nov 2022 07:41:45 +0000 (16:41 +0900)]
Rollup merge of #104323 - notriddle:notriddle/scrape-help-background, r=GuillaumeGomez

rustdoc: remove no-op CSS `.scrape-help { background: transparent }`

It's a link. This is the default CSS for it.

19 months agoRollup merge of #104318 - c410-f3r:moar-errors, r=petrochenkov
Yuki Okushi [Sun, 13 Nov 2022 07:41:45 +0000 (16:41 +0900)]
Rollup merge of #104318 - c410-f3r:moar-errors, r=petrochenkov

Move tests

r? `@petrochenkov`

https://github.com/rust-lang/rust/pull/46521 -> enum-discriminant

19 months agoRollup merge of #104177 - notriddle:notriddle/js-notable-trait-v2, r=GuillaumeGomez
Yuki Okushi [Sun, 13 Nov 2022 07:41:44 +0000 (16:41 +0900)]
Rollup merge of #104177 - notriddle:notriddle/js-notable-trait-v2, r=GuillaumeGomez

rustdoc: use consistent "popover" styling for notable traits

Follow-up to #104129
Fixes https://github.com/rust-lang/rust/issues/104313.

Preview: https://notriddle.com/notriddle-rustdoc-demos/js-notable-trait-v2/std/iter/trait.Iterator.html#method.step_by

## Before

![image](https://user-images.githubusercontent.com/1593513/200710372-d2d992ce-0bdc-4437-9a2e-379a29df09cf.png)

![image](https://user-images.githubusercontent.com/1593513/200711266-e372b176-daa9-45f3-a022-738ef0a77d3c.png)

## After

![image](https://user-images.githubusercontent.com/1593513/200710601-09b3b717-116f-43c6-b14f-34a8b02b33c0.png)

![image](https://user-images.githubusercontent.com/1593513/200711288-3978cdc1-a6c2-47f6-9216-e22e3c1f5bdf.png)

19 months agoRollup merge of #103650 - notriddle:notriddle/line-anchors, r=GuillaumeGomez
Yuki Okushi [Sun, 13 Nov 2022 07:41:44 +0000 (16:41 +0900)]
Rollup merge of #103650 - notriddle:notriddle/line-anchors, r=GuillaumeGomez

rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`

Example: https://notriddle.com/notriddle-rustdoc-demos/line-anchors/test_dingus/fn.test.html

This allows people to treat them like real links, such as right-click to copy URL, and makes the line numbers in a scraped example work at all, when before this commit was added, they had the clickable pointer cursor but did not actually do anything when clicked.

19 months agoAuto merge of #104282 - cjgillot:intern-span, r=compiler-errors
bors [Sun, 13 Nov 2022 06:23:18 +0000 (06:23 +0000)]
Auto merge of #104282 - cjgillot:intern-span, r=compiler-errors

Hash spans when interning types

Ignoring hash for spans creates an inconsistency between the `Hash` impl for `WithStableHash`, which takes them into account, and the `HashStable` impl which does not.

cc `@compiler-errors`

Fixes https://github.com/rust-lang/rust/issues/104271
Fixes https://github.com/rust-lang/rust/issues/104255
Fixes https://github.com/rust-lang/rust/issues/104238

19 months agoavoid using channels in thread-local tests
Ibraheem Ahmed [Sun, 13 Nov 2022 04:44:52 +0000 (23:44 -0500)]
avoid using channels in thread-local tests

19 months agoavoid calling `thread::current` in channel destructor
Ibraheem Ahmed [Sun, 13 Nov 2022 04:13:58 +0000 (23:13 -0500)]
avoid calling `thread::current` in channel destructor

19 months agoAuto merge of #104078 - jyn514:dry-run-progress, r=Mark-Simulacrum
bors [Sun, 13 Nov 2022 03:38:31 +0000 (03:38 +0000)]
Auto merge of #104078 - jyn514:dry-run-progress, r=Mark-Simulacrum

Print "Checking/Building ..." message even when --dry-run is passed

Print "Checking/Building ..." message even when --dry-run is passed

This makes it a lot easier to understand what commands will be run without
having to parse the `-vv` output, which isn't meant to be user facing.

I also want to change these messages at some point (https://github.com/rust-lang/rust/issues/102003) and this change will make it easier to paste a before/after comparison without having to actually build a stage 2 compiler.

19 months agofix up a fluent message
León Orell Valerian Liehr [Sun, 13 Nov 2022 03:10:56 +0000 (04:10 +0100)]
fix up a fluent message

19 months agoAuto merge of #103311 - petrochenkov:pblfix, r=bjorn3
bors [Sat, 12 Nov 2022 23:29:11 +0000 (23:29 +0000)]
Auto merge of #103311 - petrochenkov:pblfix, r=bjorn3

linker: Refactoring and fixes to native library linking

This PR contains a bunch of code cleanup and comment rearrangements + 2 fixes for `-Zpacked-bundled-libs`.
It's better to look at individual commits.

19 months agoPrint "Checking/Building ..." message even when --dry-run is passed
Joshua Nelson [Sun, 6 Nov 2022 23:00:58 +0000 (17:00 -0600)]
Print "Checking/Building ..." message even when --dry-run is passed

This makes it a lot easier to understand what commands will be run without
having to parse the `-vv` output, which isn't meant to be user facing.

19 months agoDistinguish `--dry-run` from the automatic dry run check
Joshua Nelson [Sun, 6 Nov 2022 22:59:43 +0000 (16:59 -0600)]
Distinguish `--dry-run` from the automatic dry run check

19 months agoAuto merge of #103913 - Neutron3529:patch-1, r=thomcc
bors [Sat, 12 Nov 2022 20:48:27 +0000 (20:48 +0000)]
Auto merge of #103913 - Neutron3529:patch-1, r=thomcc

Improve performance of `rem_euclid()` for signed integers

such code is copy from
https://github.com/rust-lang/rust/blob/master/library/std/src/f32.rs and
https://github.com/rust-lang/rust/blob/master/library/std/src/f64.rs
using `r+rhs.abs()` is faster than calc it with an if clause. Bench result:
```
$ cargo bench
   Compiling div-euclid v0.1.0 (/me/div-euclid)
    Finished bench [optimized] target(s) in 1.01s
     Running unittests src/lib.rs (target/release/deps/div_euclid-7a4530ca7817d1ef)

running 7 tests
test tests::it_works ... ignored
test tests::bench_aaabs     ... bench:  10,498,793 ns/iter (+/- 104,360)
test tests::bench_aadefault ... bench:  11,061,862 ns/iter (+/- 94,107)
test tests::bench_abs       ... bench:  10,477,193 ns/iter (+/- 81,942)
test tests::bench_default   ... bench:  10,622,983 ns/iter (+/- 25,119)
test tests::bench_zzabs     ... bench:  10,481,971 ns/iter (+/- 43,787)
test tests::bench_zzdefault ... bench:  11,074,976 ns/iter (+/- 29,633)

test result: ok. 0 passed; 0 failed; 1 ignored; 6 measured; 0 filtered out; finished in 19.35s
```
It seems that, default `rem_euclid` triggered a branch prediction, thus `bench_default` is faster than `bench_aadefault` and `bench_aadefault`, which shuffles the order of calculations. but all of them slower than what it was in `f64`'s and `f32`'s `rem_euclid`, thus I submit this PR.

bench code:
```rust
#![feature(test)]
extern crate test;

fn rem_euclid(a:i32,rhs:i32)->i32{
    let r = a % rhs;
    if r < 0 { r + rhs.abs() } else { r }
}

#[cfg(test)]
mod tests {
    use super::*;
    use test::Bencher;
    use rand::prelude::*;
    use rand::rngs::SmallRng;
    const N:i32=1000;
    #[test]
    fn it_works() {
        let a: i32 = 7; // or any other integer type
        let b = 4;

        let d:Vec<i32>=(-N..=N).collect();
        let n:Vec<i32>=(-N..0).chain(1..=N).collect();

        for i in &d {
            for j in &n {
                assert_eq!(i.rem_euclid(*j),rem_euclid(*i,*j));
            }
        }

        assert_eq!(rem_euclid(a,b), 3);
        assert_eq!(rem_euclid(-a,b), 1);
        assert_eq!(rem_euclid(a,-b), 3);
        assert_eq!(rem_euclid(-a,-b), 1);
    }

    #[bench]
    fn bench_aaabs(b: &mut Bencher) {
        let mut d:Vec<i32>=(-N..=N).collect();
        let mut n:Vec<i32>=(-N..0).chain(1..=N).collect();
        let mut rng=SmallRng::from_seed([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,21]);
        n.shuffle(&mut rng);
        d.shuffle(&mut rng);
        n.shuffle(&mut rng);
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=rem_euclid(*i,*j);
                }
            }
            res
        });
    }
    #[bench]
    fn bench_aadefault(b: &mut Bencher) {
        let mut d:Vec<i32>=(-N..=N).collect();
        let mut n:Vec<i32>=(-N..0).chain(1..=N).collect();
        let mut rng=SmallRng::from_seed([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,21]);
        n.shuffle(&mut rng);
        d.shuffle(&mut rng);
        n.shuffle(&mut rng);
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=i.rem_euclid(*j);
                }
            }
            res
        });
    }

    #[bench]
    fn bench_abs(b: &mut Bencher) {
        let d:Vec<i32>=(-N..=N).collect();
        let n:Vec<i32>=(-N..0).chain(1..=N).collect();
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=rem_euclid(*i,*j);
                }
            }
            res
        });
    }
    #[bench]
    fn bench_default(b: &mut Bencher) {
        let d:Vec<i32>=(-N..=N).collect();
        let n:Vec<i32>=(-N..0).chain(1..=N).collect();
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=i.rem_euclid(*j);
                }
            }
            res
        });
    }

    #[bench]
    fn bench_zzabs(b: &mut Bencher) {
        let mut d:Vec<i32>=(-N..=N).collect();
        let mut n:Vec<i32>=(-N..0).chain(1..=N).collect();
        let mut rng=SmallRng::from_seed([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,21]);
        d.shuffle(&mut rng);
        n.shuffle(&mut rng);
        d.shuffle(&mut rng);
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=rem_euclid(*i,*j);
                }
            }
            res
        });
    }
    #[bench]
    fn bench_zzdefault(b: &mut Bencher) {
        let mut d:Vec<i32>=(-N..=N).collect();
        let mut n:Vec<i32>=(-N..0).chain(1..=N).collect();
        let mut rng=SmallRng::from_seed([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,21]);
        d.shuffle(&mut rng);
        n.shuffle(&mut rng);
        d.shuffle(&mut rng);
        b.iter(||{
            let mut res=0;
            for i in &d {
                for j in &n {
                    res+=i.rem_euclid(*j);
                }
            }
            res
        });
    }
}
```

19 months agolinker: Link `profiler_builtins` even if it's marked as `NotLinked`
Vadim Petrochenkov [Sat, 12 Nov 2022 20:02:15 +0000 (23:02 +0300)]
linker: Link `profiler_builtins` even if it's marked as `NotLinked`

19 months agoUpdate run-make-fulldeps tests
Vadim Petrochenkov [Sun, 6 Nov 2022 11:44:07 +0000 (15:44 +0400)]
Update run-make-fulldeps tests

Adjacent identical native libraries are no longer deduplicated if they come from different crates

19 months agolinker: Support mixing crates built with different values of `-Zpacked_bundled_libs`
Vadim Petrochenkov [Sun, 6 Nov 2022 10:11:17 +0000 (14:11 +0400)]
linker: Support mixing crates built with different values of `-Zpacked_bundled_libs`

So you can change the value of `-Zpacked_bundled_libs` without rebuilding standard library

19 months agolinker: Move some inner functions to the outside
Vadim Petrochenkov [Thu, 20 Oct 2022 15:46:43 +0000 (19:46 +0400)]
linker: Move some inner functions to the outside

Inline `fn unlib`

19 months agolinker: Simplify linking of `compiler_builtins` and `profiler_builtins`
Vadim Petrochenkov [Thu, 20 Oct 2022 14:57:47 +0000 (18:57 +0400)]
linker: Simplify linking of `compiler_builtins` and `profiler_builtins`

This also fixes linking of native libraries bundled into these crates when `-Zpacked-bundled-libs` is enabled

19 months agolinker: Factor out native library linking to a separate function
Vadim Petrochenkov [Thu, 20 Oct 2022 10:11:59 +0000 (14:11 +0400)]
linker: Factor out native library linking to a separate function

19 months agoAuto merge of #104325 - GuillaumeGomez:rollup-19bzwoa, r=GuillaumeGomez
bors [Sat, 12 Nov 2022 17:39:11 +0000 (17:39 +0000)]
Auto merge of #104325 - GuillaumeGomez:rollup-19bzwoa, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #104110 (prevent uninitialized access in black_box for zero-sized-types)
 - #104117 (Mark `trait_upcasting` feature no longer incomplete.)
 - #104144 (Suggest removing unnecessary `.` to use a floating point literal)
 - #104250 (Migrate no result page link color to CSS variables)
 - #104261 (More accurately report error when formal and expected signature types differ)
 - #104263 (Add a reference to ilog2 in leading_zeros integer docs)
 - #104308 (Remove the old `ValidAlign` name)
 - #104319 (Fix non clickable source link)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoRollup merge of #104319 - GuillaumeGomez:fix-non-clickable-source-link, r=notriddle
Guillaume Gomez [Sat, 12 Nov 2022 16:25:04 +0000 (17:25 +0100)]
Rollup merge of #104319 - GuillaumeGomez:fix-non-clickable-source-link, r=notriddle

Fix non clickable source link

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

It was also fixed in https://github.com/rust-lang/rust/pull/104177. If https://github.com/rust-lang/rust/pull/104177 is merged first, I'll simply remove the first commit to keep the test.

r? ``@notriddle``

19 months agoRollup merge of #104308 - scottmcm:no-more-validalign, r=thomcc
Guillaume Gomez [Sat, 12 Nov 2022 16:25:03 +0000 (17:25 +0100)]
Rollup merge of #104308 - scottmcm:no-more-validalign, r=thomcc

Remove the old `ValidAlign` name

Since it looks like there won't be any reverts needed in `Layout` for https://github.com/rust-lang/rust/issues/101899#issuecomment-1290805223, finish off this change that I'd left out of #102072.

r? ``@thomcc``
cc tracking issue #102070

19 months agoRollup merge of #104263 - albertlarsan68:add-ilog2-to-leading-zeroes-docs, r=scottmcm
Guillaume Gomez [Sat, 12 Nov 2022 16:25:03 +0000 (17:25 +0100)]
Rollup merge of #104263 - albertlarsan68:add-ilog2-to-leading-zeroes-docs, r=scottmcm

Add a reference to ilog2 in leading_zeros integer docs

Fixes #104248

19 months agoRollup merge of #104261 - compiler-errors:formal-and-expected-differ, r=estebank
Guillaume Gomez [Sat, 12 Nov 2022 16:25:02 +0000 (17:25 +0100)]
Rollup merge of #104261 - compiler-errors:formal-and-expected-differ, r=estebank

More accurately report error when formal and expected signature types differ

Fixes #104242

19 months agoRollup merge of #104250 - GuillaumeGomez:migrate-not-found-link-color, r=notriddle
Guillaume Gomez [Sat, 12 Nov 2022 16:25:02 +0000 (17:25 +0100)]
Rollup merge of #104250 - GuillaumeGomez:migrate-not-found-link-color, r=notriddle

Migrate no result page link color to CSS variables

r? ``@notriddle``

19 months agoRollup merge of #104144 - TaKO8Ki:suggest-removing-unnecessary-dot, r=fee1-dead
Guillaume Gomez [Sat, 12 Nov 2022 16:25:01 +0000 (17:25 +0100)]
Rollup merge of #104144 - TaKO8Ki:suggest-removing-unnecessary-dot, r=fee1-dead

Suggest removing unnecessary `.` to use a floating point literal

Fixes a part of #101883

19 months agoRollup merge of #104117 - crlf0710:update_feature_gate, r=jackh726
Guillaume Gomez [Sat, 12 Nov 2022 16:25:01 +0000 (17:25 +0100)]
Rollup merge of #104117 - crlf0710:update_feature_gate, r=jackh726

Mark `trait_upcasting` feature no longer incomplete.

This marks the `trait_upcasting` feature no longer incomplete since #101336 has been settled for a little while.

r? ``````@jackh726``````

19 months agoRollup merge of #104110 - krasimirgg:msan-16, r=nagisa
Guillaume Gomez [Sat, 12 Nov 2022 16:25:00 +0000 (17:25 +0100)]
Rollup merge of #104110 - krasimirgg:msan-16, r=nagisa

prevent uninitialized access in black_box for zero-sized-types

Don't read the pointer location in black_box for zero sized types, just emit a memory clobber instead. Addresses  https://github.com/rust-lang/rust/issues/103304 when rust is build against LLVM at HEAD.

Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/.28with.20llvm.20at.20HEAD.29.3A.20msan.20error.20in.20core.3A.3Ahint.3A.3Ablack_box

19 months agorustdoc: avoid excessive HTML generated in example sources
Michael Howell [Sat, 12 Nov 2022 15:53:12 +0000 (08:53 -0700)]
rustdoc: avoid excessive HTML generated in example sources

19 months agorustdoc: remove no-op CSS `.scrape-help { background: transparent }`
Michael Howell [Sat, 12 Nov 2022 16:21:29 +0000 (09:21 -0700)]
rustdoc: remove no-op CSS `.scrape-help { background: transparent }`

It's a link. This is the default CSS for it.

19 months agoAuto merge of #103812 - clubby789:improve-include-bytes, r=petrochenkov
bors [Sat, 12 Nov 2022 14:30:34 +0000 (14:30 +0000)]
Auto merge of #103812 - clubby789:improve-include-bytes, r=petrochenkov

Delay `include_bytes` to AST lowering

Hopefully addresses #65818.
This PR introduces a new `ExprKind::IncludedBytes` which stores the path and bytes of a file included with `include_bytes!()`. We can then create a literal from the bytes during AST lowering, which means we don't need to escape the bytes into valid UTF8 which is the cause of most of the overhead of embedding large binary blobs.

19 months agoAdd GUI test to ensure that source links can be clicked
Guillaume Gomez [Sat, 12 Nov 2022 12:58:59 +0000 (13:58 +0100)]
Add GUI test to ensure that source links can be clicked

19 months agoUse `derive_const` and rm manual StructuralEq impl
Deadbeef [Sat, 12 Nov 2022 12:57:10 +0000 (12:57 +0000)]
Use `derive_const` and rm manual StructuralEq impl

19 months agoTidy
Caio [Sat, 12 Nov 2022 12:54:06 +0000 (09:54 -0300)]
Tidy

19 months agoFix impossibility to click on source link
Guillaume Gomez [Sat, 12 Nov 2022 12:52:43 +0000 (13:52 +0100)]
Fix impossibility to click on source link

19 months agoMove tests
Caio [Sat, 12 Nov 2022 12:51:53 +0000 (09:51 -0300)]
Move tests

19 months agoUse same color for links in no result search
Guillaume Gomez [Fri, 11 Nov 2022 19:39:20 +0000 (20:39 +0100)]
Use same color for links in no result search

19 months agoAdd GUI test for "no result found" links
Guillaume Gomez [Thu, 10 Nov 2022 17:51:08 +0000 (18:51 +0100)]
Add GUI test for "no result found" links

19 months agoMigrate no result page link color to CSS variables
Guillaume Gomez [Thu, 10 Nov 2022 17:16:22 +0000 (18:16 +0100)]
Migrate no result page link color to CSS variables

19 months agoUse correct EH personality on `*-windows-gnu-*`
Mateusz Mikuła [Tue, 1 Nov 2022 11:57:34 +0000 (12:57 +0100)]
Use correct EH personality on `*-windows-gnu-*`

19 months agoBump unwinder private data size for AArch64 Windows
Mateusz Mikuła [Tue, 1 Nov 2022 11:28:49 +0000 (12:28 +0100)]
Bump unwinder private data size for AArch64 Windows

This fixes unwinding on `aarch64-*-windows-gnu*`.

19 months agoAuto merge of #102701 - flba-eb:add_qnx_nostd_support, r=cjgillot
bors [Sat, 12 Nov 2022 11:03:33 +0000 (11:03 +0000)]
Auto merge of #102701 - flba-eb:add_qnx_nostd_support, r=cjgillot

Add tier 3 no_std AArch64/x86_64 support for the QNX Neutrino RTOS

This change allows to compile `no_std` applications for the QNX Neutrino Real-time operating system for ARM 64 bit CPUs.
Tested with QNX Neutrino 7.1.

Partially discussed in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Adding.20QNX.20as.20target).

---

> ## Tier 3 target policy
>
> At this tier, the Rust project provides no official support for a target, so we
place minimal requirements on the introduction of targets.
>
>A proposed new tier 3 target must be reviewed and approved by a member of the
compiler team based on these requirements. The reviewer may choose to gauge
broader compiler team consensus via a [Major Change Proposal (MCP)][MCP].
>
>A proposed target or target-specific patch that substantially changes code
shared with other targets (not just target-specific code) must be reviewed and
approved by the appropriate team for that shared code before acceptance.
>
>- A tier 3 target must have a designated developer or developers (the "target
  maintainers") on record to be CCed when issues arise regarding the target.
  (The mechanism to track and CC such developers may evolve over time.)

See also nto-qnx.md; designated developers are:

- Florian Bartels, `Florian.Bartels@elektrobit.com`, https://github.com/flba-eb
- Tristan Roach, `TRoach@blackberry.com`, https://github.com/gh-tr

> - Targets must use naming consistent with any existing targets; for instance, a
  target for the same CPU or OS as an existing Rust target should use the same
  name for that CPU or OS. Targets should normally use the same names and
  naming conventions as used elsewhere in the broader ecosystem beyond Rust
  (such as in other toolchains), unless they have a very good reason to
  diverge. Changing the name of a target can be highly disruptive, especially
  once the target reaches a higher tier, so getting the name right is important
  even for a tier 3 target.
>  - Target names should not introduce undue confusion or ambiguity unless
    absolutely necessary to maintain ecosystem compatibility. For example, if
    the name of the target makes people extremely likely to form incorrect
    beliefs about what it targets, the name should be changed or augmented to
    disambiguate it.

`aarch64-unknown-nto-qnx7.1.0` and `x86_64-pc-nto-qnx7.1.0` have been chosen as these
strings are used in the official QNX Neutrino toolchain (for `C`/`C++`). It should also
harmonize with the other Rust targets.

The version (`7.1.0 `) is needed because libc needs to distinguish between different
versions (`target_env` is set to `710` for QNX Neutrino 7.1): For example, functions are removed from 7.0
to 7.1, sometimes the signature of functions is slightly changed or size/alignment of structs.
I'm expecting the same for future versions.
This works very well in e.g. `libc` (tested with 7.0 which I'm not going to support).

> - Tier 3 targets may have unusual requirements to build or use, but must not
  create legal issues or impose onerous legal terms for the Rust project or for
  Rust developers or users.
>  - The target must not introduce license incompatibilities.

No issue as far as I can see.

>  - Anything added to the Rust repository must be under the standard Rust
    license (`MIT OR Apache-2.0`).

Ok

>  - The target must not cause the Rust tools or libraries built for any other
    host (even when supporting cross-compilation to the target) to depend
    on any new dependency less permissive than the Rust licensing policy. This
    applies whether the dependency is a Rust crate that would require adding
    new license exceptions (as specified by the `tidy` tool in the
    rust-lang/rust repository), or whether the dependency is a native library
    or binary. In other words, the introduction of the target must not cause a
    user installing or running a version of Rust or the Rust tools to be
    subject to any new license requirements.

No change for host tools. When cross-compiling for QNX Neutrino, the compiler/linker
driver "qcc" is called. It should be possible (but not tested) to use other
(OSS) compilers/linkers to produce working binaries.

>  - Compiling, linking, and emitting functional binaries, libraries, or other
    code for the target (whether hosted on the target itself or cross-compiling
    from another target) must not depend on proprietary (non-FOSS) libraries.
    Host tools built for the target itself may depend on the ordinary runtime
    libraries supplied by the platform and commonly used by other applications
    built for the target, but those libraries must not be required for code
    generation for the target; cross-compilation to the target must not require
    such libraries at all. For instance, `rustc` built for the target may
    depend on a common proprietary C runtime library or console output library,
    but must not depend on a proprietary code generation library or code
    optimization library. Rust's license permits such combinations, but the
    Rust project has no interest in maintaining such combinations within the
    scope of Rust itself, even at tier 3.

Only rustc is required for code generation (i.e. no additional libraries to
generate code). Linking of executables requires the ordinary runtime libraries
`crt` and `libc`.

>  - "onerous" here is an intentionally subjective term. At a minimum, "onerous"
    legal/licensing terms include but are *not* limited to: non-disclosure
    requirements, non-compete requirements, contributor license agreements
    (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms,
    requirements conditional on the employer or employment of any particular
    Rust developers, revocable terms, any requirements that create liability
    for the Rust project or its developers or users, or any requirements that
    adversely affect the livelihood or prospects of the Rust project or its
    developers or users.
>- Neither this policy nor any decisions made regarding targets shall create any
  binding agreement or estoppel by any party. If any member of an approving
  Rust team serves as one of the maintainers of a target, or has any legal or
  employment requirement (explicit or implicit) that might affect their
  decisions regarding a target, they must recuse themselves from any approval
  decisions regarding the target's tier status, though they may otherwise
  participate in discussions.
>  - This requirement does not prevent part or all of this policy from being
    cited in an explicit contract or work agreement (e.g. to implement or
    maintain support for a target). This requirement exists to ensure that a
    developer or team responsible for reviewing and approving a target does not
    face any legal threats or obligations that would prevent them from freely
    exercising their judgment in such approval, even if such judgment involves
    subjective matters or goes beyond the letter of these requirements.

I see no issues with any of the above.

>- Tier 3 targets should attempt to implement as much of the standard libraries
  as possible and appropriate (`core` for most targets, `alloc` for targets
  that can support dynamic memory allocation, `std` for targets with an
  operating system or equivalent layer of system-provided functionality), but
  may leave some code unimplemented (either unavailable or stubbed out as
  appropriate), whether because the target makes it impossible to implement or
  challenging to implement. The authors of pull requests are not obligated to
  avoid calling any portions of the standard library on the basis of a tier 3
  target not implementing those portions.

`core` and `alloc` should be working (no change required). `std` implementation
is ongoing and will be provided separately.

>- The target must provide documentation for the Rust community explaining how
  to build for the target, using cross-compilation if possible. If the target
  supports running binaries, or running tests (even if they do not pass), the
  documentation must explain how to run such binaries or tests for the target,
  using emulation if possible or dedicated hardware if necessary.

see nto-qnx.md

>- Tier 3 targets must not impose burden on the authors of pull requests, or
  other developers in the community, to maintain the target. In particular,
  do not post comments (automated or manual) on a PR that derail or suggest a
  block on the PR based on a tier 3 target. Do not send automated messages or
  notifications (via any medium, including via ``@`)` to a PR author or others
  involved with a PR regarding a tier 3 target, unless they have opted into
  such messages.
>  - Backlinks such as those generated by the issue/PR tracker when linking to
    an issue or PR are not considered a violation of this policy, within
    reason. However, such messages (even on a separate repository) must not
    generate notifications to anyone involved with a PR who has not requested
    such notifications.

Ok

>- Patches adding or updating tier 3 targets must not break any existing tier 2
  or tier 1 target, and must not knowingly break another tier 3 target without
  approval of either the compiler team or the maintainers of the other tier 3
  target.
>  - In particular, this may come up when working on closely related targets,
    such as variations of the same architecture with different features. Avoid
    introducing unconditional uses of features that another variation of the
    target may not have; use conditional compilation or runtime detection, as
    appropriate, to let each target run code supported by that target.

Ok

19 months agoRemove example code as it does not compile in CI
Florian Bartels [Sat, 12 Nov 2022 08:25:34 +0000 (09:25 +0100)]
Remove example code as it does not compile in CI

Code is QNX/nto specific and will not link on Windows.

19 months agoAuto merge of #104310 - Dylan-DPC:rollup-wgt1z4a, r=Dylan-DPC
bors [Sat, 12 Nov 2022 08:03:01 +0000 (08:03 +0000)]
Auto merge of #104310 - Dylan-DPC:rollup-wgt1z4a, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #102049 (Add the `#[derive_const]` attribute)
 - #103970 (Unhide unknown spans)
 - #104206 (Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more)
 - #104214 (Emit error in `collecting_trait_impl_trait_tys` on mismatched signatures)
 - #104267 (rustdoc: use checkbox instead of switch for settings toggles)
 - #104302 (Update cargo)
 - #104303 (UI tests can be assigned to T-compiler)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoRollup merge of #104303 - compiler-errors:ui-test-triagebot, r=Mark-Simulacrum
Dylan DPC [Sat, 12 Nov 2022 06:32:54 +0000 (12:02 +0530)]
Rollup merge of #104303 - compiler-errors:ui-test-triagebot, r=Mark-Simulacrum

UI tests can be assigned to T-compiler

It's my understanding that while not *all* `src/test/ui` tests are compiler-related, the bulk of them are, so I think it makes sense for this to go to the compiler triagebot category (T-compiler and T-compiler-contributors) instead of fallback, which consists of just `@Mark-Simulacrum.` Though if anyone diagrees, feel free to close this PR.

19 months agoRollup merge of #104302 - weihanglo:update-cargo, r=weihanglo
Dylan DPC [Sat, 12 Nov 2022 06:32:53 +0000 (12:02 +0530)]
Rollup merge of #104302 - weihanglo:update-cargo, r=weihanglo

Update cargo

9 commits in 9286a1beba5b28b115bad67de2ae91fb1c61eb0b..a3dfea71ca0c888a88111086898aa833c291d497 2022-11-04 06:41:49 +0000 to 2022-11-11 03:50:47 +0000
- fix: return non UTF-8 error message (rust-lang/cargo#11321)
- Extract `two_kinds_of_msg_format_err` message to de-duplicate it (rust-lang/cargo#11358)
- Propagate change of artifact bin dep to its parent fingerprint (rust-lang/cargo#11353)
- Fix not a hyperlink warnings (rust-lang/cargo#11357)
- Fix wait-for-publish with sparse registry (rust-lang/cargo#11356)
- Add `rm` alias to configuration docs (rust-lang/cargo#11351)
- Add `registries.crates-io.protocol` docs (rust-lang/cargo#11350)
- test(features2): test to prevent regressing of optional host deps of dep (rust-lang/cargo#11342)
- Bump to 0.68.0, update changelog (rust-lang/cargo#11340)

r? ````@ghost````

19 months agoRollup merge of #104267 - notriddle:notriddle/checkbox, r=GuillaumeGomez
Dylan DPC [Sat, 12 Nov 2022 06:32:53 +0000 (12:02 +0530)]
Rollup merge of #104267 - notriddle:notriddle/checkbox, r=GuillaumeGomez

rustdoc: use checkbox instead of switch for settings toggles

Preview: http://notriddle.com/notriddle-rustdoc-demos/checkbox/test_dingus/index.html

## Before

![image](https://user-images.githubusercontent.com/1593513/201232887-dee27ef5-b091-49bb-be4a-103d2e7983f3.png)

## After

![image](https://user-images.githubusercontent.com/1593513/201232835-95b40b77-6535-4280-8719-44c992a07772.png)

## Description

The switch ("slider") is designed to give the application a "physical" feel, but nothing else in here really followed through. They didn't support the "flick" gesture that real iOS switches support, and the radio buttons that were also used in Rustdoc Settings were a more "classic" form element anyway.

Also, while switches are the exclusive toggle design on iOS (since [Apple HIG] reserves checkboxes for Mac only), the [Google Material] guidelines say that lists of switches are bad, and you should just use check boxes.

[Apple HIG]: https://developer.apple.com/design/human-interface-guidelines/components/selection-and-input/toggles
[Google Material]: https://m3.material.io/components/checkbox/guidelines#6902f23d-ceba-4b19-ae3b-b78b9b01d185

19 months agoRollup merge of #104214 - Nilstrieb:returns_impl_Ice, r=compiler-errors
Dylan DPC [Sat, 12 Nov 2022 06:32:52 +0000 (12:02 +0530)]
Rollup merge of #104214 - Nilstrieb:returns_impl_Ice, r=compiler-errors

Emit error in `collecting_trait_impl_trait_tys` on mismatched signatures

Previously, a `delay_span_bug` was isssued, failing normalization. This create a `TyKind::Error` in the signature, which caused `compare_predicate_entailment` to swallow its signature mismatch error, causing ICEs because no error was emitted.

fixes #104183

r? ``@compiler-errors``

19 months agoRollup merge of #104206 - compiler-errors:ocx-more-2, r=lcnr
Dylan DPC [Sat, 12 Nov 2022 06:32:52 +0000 (12:02 +0530)]
Rollup merge of #104206 - compiler-errors:ocx-more-2, r=lcnr

Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more

r? ```@lcnr```

19 months agoRollup merge of #103970 - oli-obk:unhide_unknown_spans, r=estebank
Dylan DPC [Sat, 12 Nov 2022 06:32:51 +0000 (12:02 +0530)]
Rollup merge of #103970 - oli-obk:unhide_unknown_spans, r=estebank

Unhide unknown spans

r? ```@estebank```

19 months agoRollup merge of #102049 - fee1-dead-contrib:derive_const, r=oli-obk
Dylan DPC [Sat, 12 Nov 2022 06:32:50 +0000 (12:02 +0530)]
Rollup merge of #102049 - fee1-dead-contrib:derive_const, r=oli-obk

Add the `#[derive_const]` attribute

Closes #102371. This is a minimal patchset for the attribute to work. There are no restrictions on what traits this attribute applies to.

r? `````@oli-obk`````

19 months agoRemove the old `ValidAlign` name
Scott McMurray [Sat, 12 Nov 2022 05:44:27 +0000 (21:44 -0800)]
Remove the old `ValidAlign` name

Since it looks like there won't be any reverts needed in `Layout`, finish off this change.

19 months agoAuto merge of #103530 - cjgillot:hir-lifetimes-direct, r=estebank
bors [Sat, 12 Nov 2022 05:22:17 +0000 (05:22 +0000)]
Auto merge of #103530 - cjgillot:hir-lifetimes-direct, r=estebank

Resolve lifetimes independently for each item-like.

Now that the heavy-lifting is done on the AST and during lowering, we do not need to perform HIR lifetime resolution on a full item at once.  Instead, we can treat each item-like independently, and look at `generics_of` the parent exceptionally for associated items.

19 months agoAuto merge of #103150 - joboet:remove_lock_wrappers, r=m-ou-se
bors [Sat, 12 Nov 2022 01:31:39 +0000 (01:31 +0000)]
Auto merge of #103150 - joboet:remove_lock_wrappers, r=m-ou-se

Remove lock wrappers in `sys_common`

This moves the lazy allocation to `sys` (SGX and UNIX). While this leads to a bit more verbosity, it will simplify future improvements by making room in `sys_common` for platform-independent implementations.

This also removes the condvar check on SGX as it is not necessary for soundness and will be removed anyway once mutex has been made movable.

For simplicity's sake, `libunwind` also uses lazy allocation now on SGX. This will require an update to the C definitions before merging this (CC `@raoulstrackx).`

r? `@m-ou-se`

19 months agorustdoc: update test cases
Michael Howell [Wed, 9 Nov 2022 00:49:29 +0000 (17:49 -0700)]
rustdoc: update test cases

19 months agorustdoc: make notable traits popover behavior consistent with Help and Settings
Michael Howell [Wed, 9 Nov 2022 00:59:03 +0000 (17:59 -0700)]
rustdoc: make notable traits popover behavior consistent with Help and Settings

19 months agorustdoc: use consistent "popover" styling for notable traits
Michael Howell [Wed, 9 Nov 2022 01:00:22 +0000 (18:00 -0700)]
rustdoc: use consistent "popover" styling for notable traits

19 months agoEnable profiler in dist-s390x-linux
Ulrich Weigand [Fri, 11 Nov 2022 22:22:58 +0000 (23:22 +0100)]
Enable profiler in dist-s390x-linux

Build the profiler runtime to allow using -C profile-generate
and -C instrument-coverage on s390x-linux.

I've verified in a local build that the runtime builds and
the profiler is working fine on the platform.

19 months agoUI tests can be assigned to T-compiler
Michael Goulet [Fri, 11 Nov 2022 22:16:14 +0000 (22:16 +0000)]
UI tests can be assigned to T-compiler

19 months agoUpdate cargo
Weihang Lo [Fri, 11 Nov 2022 22:07:29 +0000 (22:07 +0000)]
Update cargo

9 commits in 9286a1beba5b28b115bad67de2ae91fb1c61eb0b..a3dfea71ca0c888a88111086898aa833c291d497
2022-11-04 06:41:49 +0000 to 2022-11-11 03:50:47 +0000
- fix: return non UTF-8 error message (rust-lang/cargo#11321)
- Extract `two_kinds_of_msg_format_err` message to de-duplicate it (rust-lang/cargo#11358)
- Propagate change of artifact bin dep to its parent fingerprint (rust-lang/cargo#11353)
- Fix not a hyperlink warnings (rust-lang/cargo#11357)
- Fix wait-for-publish with sparse registry (rust-lang/cargo#11356)
- Add `rm` alias to configuration docs (rust-lang/cargo#11351)
- Add `registries.crates-io.protocol` docs (rust-lang/cargo#11350)
- test(features2): test to prevent regressing of optional host deps of dep (rust-lang/cargo#11342)
- Bump to 0.68.0, update changelog (rust-lang/cargo#11340)

19 months agoDocument `Path::parent` behavior around relative paths
Tobias Bucher [Fri, 11 Nov 2022 20:38:00 +0000 (21:38 +0100)]
Document `Path::parent` behavior around relative paths

A relative path with just one component will return `Some("")` as its
parent, which wasn't clear to me from the documentation.

The parent of `""` is `None`, which was missing from the documentation
as well.

19 months agoAuto merge of #104293 - Manishearth:rollup-xj92d0k, r=Manishearth
bors [Fri, 11 Nov 2022 20:11:07 +0000 (20:11 +0000)]
Auto merge of #104293 - Manishearth:rollup-xj92d0k, r=Manishearth

Rollup of 8 pull requests

Successful merges:

 - #95292 (Allow specialized const trait impls.)
 - #100386 (Make `Sized` coinductive, again)
 - #102215 (Implement the `+whole-archive` modifier for `wasm-ld`)
 - #103468 (Fix unused lint and parser caring about spaces to won't produce invalid code)
 - #103531 (Suggest calling the instance method of the same name when method not found)
 - #103960 (piece of diagnostic migrate)
 - #104051 (update Miri)
 - #104129 (rustdoc: use javascript to layout notable traits popups)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoSkip stable hashing without incremental.
Camille GILLOT [Fri, 11 Nov 2022 20:03:33 +0000 (20:03 +0000)]
Skip stable hashing without incremental.

19 months agoAuto merge of #104289 - Dylan-DPC:rollup-v7wei2t, r=Dylan-DPC
bors [Fri, 11 Nov 2022 17:29:10 +0000 (17:29 +0000)]
Auto merge of #104289 - Dylan-DPC:rollup-v7wei2t, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #100633 (Consider `#[must_use]` annotation on `async fn` as also affecting the `Future::Output`)
 - #103445 (`#[test]`: Point at return type if `Termination` bound is unsatisfied)
 - #103924 (Fix broken link in description of error code E0706)
 - #104146 (Retry binding TCP Socket in remote-test-server)
 - #104169 (Migrate `:target` rules to use CSS variables)
 - #104202 (Fix ICE #103748)
 - #104216 (Don't ICE on operator trait methods with generic methods)
 - #104217 (Display help message when fluent arg was referenced incorrectly)
 - #104245 (Reduce default configuration's dependency upon static libstdcpp library (#103606))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

19 months agoRollup merge of #104129 - notriddle:notriddle/102576-js-notable-trait, r=Manishearth
Manish Goregaokar [Fri, 11 Nov 2022 17:12:31 +0000 (12:12 -0500)]
Rollup merge of #104129 - notriddle:notriddle/102576-js-notable-trait, r=Manishearth

rustdoc: use javascript to layout notable traits popups

Fixes #102576

Preview: https://notriddle.com/notriddle-rustdoc-demos/102576-js-notable-trait/std/iter/trait.Iterator.html#method.step_by

## Before

![image](https://user-images.githubusercontent.com/1593513/200432713-23aa8d49-ba2b-469f-9eab-089e0c174039.png)

## After

![image](https://user-images.githubusercontent.com/1593513/200432735-edd5b53d-e99d-4fc5-9410-8a79e0efdc9d.png)

19 months agoRollup merge of #104051 - RalfJung:miri, r=RalfJung
Manish Goregaokar [Fri, 11 Nov 2022 17:12:31 +0000 (12:12 -0500)]
Rollup merge of #104051 - RalfJung:miri, r=RalfJung

update Miri

Notable PRs:
- https://github.com/rust-lang/miri/pull/2636
- https://github.com/rust-lang/miri/pull/2641
- https://github.com/rust-lang/miri/pull/2638

19 months agoRollup merge of #103960 - AndyJado:var_path_only_diag, r=davidtwco
Manish Goregaokar [Fri, 11 Nov 2022 17:12:30 +0000 (12:12 -0500)]
Rollup merge of #103960 - AndyJado:var_path_only_diag, r=davidtwco

piece of diagnostic migrate

r? `@davidtwco`

19 months agoRollup merge of #103531 - chenyukang:yukang/fix-103474, r=estebank
Manish Goregaokar [Fri, 11 Nov 2022 17:12:30 +0000 (12:12 -0500)]
Rollup merge of #103531 - chenyukang:yukang/fix-103474, r=estebank

Suggest calling the instance method of the same name when method not found

Fixes #103474