]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoAuto merge of #100726 - jswrenn:transmute, r=oli-obk
bors [Sun, 4 Sep 2022 07:55:44 +0000 (07:55 +0000)]
Auto merge of #100726 - jswrenn:transmute, r=oli-obk

safe transmute: use `Assume` struct to provide analysis options

This task was left as a TODO in #92268; resolving it brings [`BikeshedIntrinsicFrom`](https://doc.rust-lang.org/nightly/core/mem/trait.BikeshedIntrinsicFrom.html) more in line with the API defined in [MCP411](https://github.com/rust-lang/compiler-team/issues/411).

**Before:**
```rust
pub unsafe trait BikeshedIntrinsicFrom<
    Src,
    Context,
    const ASSUME_ALIGNMENT: bool,
    const ASSUME_LIFETIMES: bool,
    const ASSUME_VALIDITY: bool,
    const ASSUME_VISIBILITY: bool,
> where
    Src: ?Sized,
{}
```
**After:**
```rust
pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }>
where
    Src: ?Sized,
{}
```

`Assume::visibility` has also been renamed to `Assume::safety`, as library safety invariants are what's actually being assumed; visibility is just the mechanism by which it is currently checked (and that may change).

r? `@oli-obk`

---

Related:
- https://github.com/rust-lang/compiler-team/issues/411
- https://github.com/rust-lang/rust/issues/99571

21 months agoAuto merge of #101312 - nikic:update-llvm-7, r=cuviper
bors [Sun, 4 Sep 2022 05:14:34 +0000 (05:14 +0000)]
Auto merge of #101312 - nikic:update-llvm-7, r=cuviper

Update LLVM submodule

This updates to the current 15.x branch plus one cherry-pick.

Fixes #100834.
Fixes #101121.

21 months agoAuto merge of #101396 - matthiaskrgr:rollup-9n0257m, r=matthiaskrgr
bors [Sun, 4 Sep 2022 02:59:45 +0000 (02:59 +0000)]
Auto merge of #101396 - matthiaskrgr:rollup-9n0257m, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #100302 (Suggest associated method on deref types when path syntax method fails)
 - #100647 ( Make trait bound not satisfied specify kind)
 - #101349 (rustdoc: remove `.impl-items { flex-basis }` CSS, not in flex container)
 - #101369 (Fix `global_asm` macro pretty printing)

Failed merges:

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

21 months agoRollup merge of #101369 - compiler-errors:global-asm-pprint, r=jackh726
Matthias Krüger [Sat, 3 Sep 2022 22:20:43 +0000 (00:20 +0200)]
Rollup merge of #101369 - compiler-errors:global-asm-pprint, r=jackh726

Fix `global_asm` macro pretty printing

Fixes #101051
Fixes #101047

21 months agoRollup merge of #101349 - notriddle:notriddle/flex-basis, r=GuillaumeGomez
Matthias Krüger [Sat, 3 Sep 2022 22:20:42 +0000 (00:20 +0200)]
Rollup merge of #101349 - notriddle:notriddle/flex-basis, r=GuillaumeGomez

rustdoc: remove `.impl-items { flex-basis }` CSS, not in flex container

Added in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9

For this to actually do anything, [according to MDN] (and Firefox Dev Tools), it must be a "flex item", which only happens if its a direct child of a node with `display: flex` on it. It seems like it could not have worked at the time when this rule was added, because the only items in `rustdoc.css` with `display: flex` active were:

* `#help`

  This should not contain anything like this.

* `.impl-items h4, h4.impl, h3.impl`

  These are all headers, so they shouldn't contain `.impl-items` either.

* `.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant`

  Associated constants and methods definitely shouldn't contain a list of impl items, and the `.type` class seems to refer to type aliases, which, when shown inside of an impl, only show a link to the aliased type.

[according to MDN]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis

Nowadays, `display: flex` is a lot more prolific, but `.impl-items` still seems to only be used in plain block parents:

* If it's not a trait impl, then it's nested below a `<div>` with an id but no class, added in a5216cf67d93de97091b41ecba85de2e08f39863. This will be `display: block`, probably. For example, [vec deref]
* Inherent impls also get a `<div>` tag, for example [vec impl], and they are also wrapped by their own non-flexbox `<details>` tag.
* If it's a tait implementation, then it's also nested below a `<details>` container, like [deref cstring].

[vec impl]: https://doc.rust-lang.org/1.63.0/std/vec/struct.Vec.html#impl
[vec deref]: https://doc.rust-lang.org/1.63.0/std/vec/struct.Vec.html#deref-methods-%5BT%5D
[deref cstring]: https://doc.rust-lang.org/1.63.0/std/ops/trait.Deref.html#impl-Deref

Also, this would imply that trait items ought to take up as much space as possible, pushing everything else to the edge of the screen. If this is nested directly below the `.rustdoc` container, which has a row basis, that would be bad.

21 months agoRollup merge of #100647 - obeis:issue-99875, r=nagisa
Matthias Krüger [Sat, 3 Sep 2022 22:20:40 +0000 (00:20 +0200)]
Rollup merge of #100647 - obeis:issue-99875, r=nagisa

 Make trait bound not satisfied specify kind

Closes #99875

21 months agoRollup merge of #100302 - compiler-errors:deref-path-methods, r=jackh726
Matthias Krüger [Sat, 3 Sep 2022 22:20:39 +0000 (00:20 +0200)]
Rollup merge of #100302 - compiler-errors:deref-path-methods, r=jackh726

Suggest associated method on deref types when path syntax method fails

Fixes #100278

21 months agorustdoc: remove `.impl-items { flex-basis }` CSS, not in flex container
Michael Howell [Fri, 2 Sep 2022 22:44:06 +0000 (15:44 -0700)]
rustdoc: remove `.impl-items { flex-basis }` CSS, not in flex container

Added in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9

For this to actually do anything, [according to MDN] (and Firefox Dev Tools),
it must be a "flex item", which only happens if its a direct child of a node
with `display: flex` on it. It seems like it could not have worked at the time
when this rule was added, because the only items in `rustdoc.css` with
`display: flex` active were:

* `#help`

  This should not contain anything like this.

* `.impl-items h4, h4.impl, h3.impl`

  These are all headers, so they shouldn't contain `.impl-items` either.

* `.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant`

  Associated constants and methods definitely shouldn't contain a list of impl
  items, and the `.type` class seems to refer to type aliases, which, when
  shown inside of an impl, only show a link to the aliased type.

[according to MDN]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis

Nowadays, `display: flex` is a lot more prolific, but `.impl-items` still
seems to only be used in plain block parents:

* If it's not a trait impl, then it's nested below a `<div>` with an id but no
  class, added in a5216cf67d93de97091b41ecba85de2e08f39863. This will be
  `display: block`, probably. For example, [vec deref]
* Inherent impls also get a `<div>` tag, for example [vec impl], and they are
  also wrapped by their own non-flexbox `<details>` tag.
* If it's a tait implementation, then it's also nested below a `<details>`
  container, like [deref cstring].

[vec impl]: https://doc.rust-lang.org/1.63.0/std/vec/struct.Vec.html#impl
[vec deref]: https://doc.rust-lang.org/1.63.0/std/vec/struct.Vec.html#deref-methods-%5BT%5D
[deref cstring]: https://doc.rust-lang.org/1.63.0/std/ops/trait.Deref.html#impl-Deref

Also, this would imply that trait items ought to take up as much space as
possible, pushing everything else to the edge of the screen. If this is nested
directly below the `.rustdoc` container, which has a row basis, that would
be bad.

21 months agoAuto merge of #101214 - cjgillot:old-no-lt, r=estebank
bors [Sat, 3 Sep 2022 19:32:41 +0000 (19:32 +0000)]
Auto merge of #101214 - cjgillot:old-no-lt, r=estebank

Do not call object_lifetime_default on lifetime params.

Small cleanup to avoid unnecessary query invocations in trivial cases.

21 months agoDo not call object_lifetime_default on lifetime params.
Camille GILLOT [Tue, 30 Aug 2022 20:47:58 +0000 (22:47 +0200)]
Do not call object_lifetime_default on lifetime params.

21 months agoAuto merge of #101342 - saethlin:update-backtrace, r=Mark-Simulacrum
bors [Sat, 3 Sep 2022 17:12:17 +0000 (17:12 +0000)]
Auto merge of #101342 - saethlin:update-backtrace, r=Mark-Simulacrum

Update backtrace

Most notably, this pulls in https://github.com/rust-lang/backtrace-rs/commit/ebc9a85466506e4fd0ba9cb72b15c42e320a0867, which is both a bugfix and a significant performance improvement for Miri, since fixing the bug makes `RUST_BACKTRACE=1` backtraces much smaller: https://github.com/rust-lang/miri/issues/2273, https://github.com/rust-lang/miri-test-libstd/issues/8

This also pulls in other commits which turn the backtrace-rs CI green. That's nice.

21 months agoAuto merge of #101378 - matthiaskrgr:rollup-s1awa47, r=matthiaskrgr
bors [Sat, 3 Sep 2022 14:23:58 +0000 (14:23 +0000)]
Auto merge of #101378 - matthiaskrgr:rollup-s1awa47, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #101335 (rustdoc: remove old CSS selector that causes weird spacing)
 - #101347 (ffx component run should provide a collection)
 - #101364 (Shrink suggestion span of argument mismatch error)
 - #101365 (remove redundant clones)

Failed merges:

 - #101349 (rustdoc: remove `.impl-items { flex-basis }` CSS, not in flex container)

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

21 months agoRollup merge of #101365 - matthiaskrgr:clones2, r=fee1-dead
Matthias Krüger [Sat, 3 Sep 2022 12:20:53 +0000 (14:20 +0200)]
Rollup merge of #101365 - matthiaskrgr:clones2, r=fee1-dead

remove redundant clones

21 months agoRollup merge of #101364 - compiler-errors:arg-suggestion-spans, r=wesleywiser
Matthias Krüger [Sat, 3 Sep 2022 12:20:52 +0000 (14:20 +0200)]
Rollup merge of #101364 - compiler-errors:arg-suggestion-spans, r=wesleywiser

Shrink suggestion span of argument mismatch error

This doesn't really help with #101242, but I wanted to put this up while I work on other fixes.

21 months agoRollup merge of #101347 - diminishedprime:patch-4, r=tmandry
Matthias Krüger [Sat, 3 Sep 2022 12:20:51 +0000 (14:20 +0200)]
Rollup merge of #101347 - diminishedprime:patch-4, r=tmandry

ffx component run should provide a collection

In the future,`ffx component run` will not default to the using the `/core/ffx-laboratory` collection. Updated the run commands to include this.

21 months agoRollup merge of #101335 - notriddle:notriddle/methods-stability, r=notriddle
Matthias Krüger [Sat, 3 Sep 2022 12:20:49 +0000 (14:20 +0200)]
Rollup merge of #101335 - notriddle:notriddle/methods-stability, r=notriddle

rustdoc: remove old CSS selector that causes weird spacing

It was added with e08a84a0c18739417a50c3e46917ced5037244eb (actually, it was called `.methods > .stability` at the time) and was directly nested that way.

**EDIT**: It is technically reachable code still, but it seems wrong.

## With the old CSS rule still present

https://notriddle.com/notriddle-rustdoc-test/weird-spacing/lib/struct.Foo.html

![image](https://user-images.githubusercontent.com/1593513/188216226-c667c560-d33d-494f-a492-4e0ec3ac0009.png)

## Version 2 (an older version of this PR)

https://notriddle.com/notriddle-rustdoc-test/normal-spacing-2/lib/struct.Foo.html

![image](https://user-images.githubusercontent.com/1593513/188216418-9fcd3109-f1b2-425d-b4fc-0c6b3b54e48e.png)

## Version 3 (with alignment fix for mobile)

https://notriddle.com/notriddle-rustdoc-test/normal-spacing-3/lib/struct.Foo.html

![image](https://user-images.githubusercontent.com/1593513/188223161-0e1ebce7-842f-41cb-8a0c-ae43aedcfccc.png)

21 months agoAuto merge of #100574 - Urgau:check-cfg-warn-cfg, r=petrochenkov
bors [Sat, 3 Sep 2022 12:02:14 +0000 (12:02 +0000)]
Auto merge of #100574 - Urgau:check-cfg-warn-cfg, r=petrochenkov

Add warning against unexpected --cfg with --check-cfg

This PR adds a warning when an unexpected `--cfg` is specified but not in the specified list of `--check-cfg`.

This is the follow-up PR I mentioned in https://github.com/rust-lang/rust/pull/99519.

r? `@petrochenkov`

21 months agoAuto merge of #101154 - RalfJung:validation-perf, r=oli-obk
bors [Sat, 3 Sep 2022 09:20:54 +0000 (09:20 +0000)]
Auto merge of #101154 - RalfJung:validation-perf, r=oli-obk

interpret: fix unnecessary allocation in validation visitor

Should fix the perf regression introduced by https://github.com/rust-lang/rust/pull/100043.

r? `@oli-obk`

21 months agoFix global_asm macro pretty printing
Michael Goulet [Sat, 3 Sep 2022 08:05:48 +0000 (08:05 +0000)]
Fix global_asm macro pretty printing

21 months agoSuggest associated method on deref types
Michael Goulet [Sat, 3 Sep 2022 07:24:55 +0000 (07:24 +0000)]
Suggest associated method on deref types

21 months agoAuto merge of #101361 - Dylan-DPC:rollup-xj1syld, r=Dylan-DPC
bors [Sat, 3 Sep 2022 07:00:07 +0000 (07:00 +0000)]
Auto merge of #101361 - Dylan-DPC:rollup-xj1syld, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #99736 (Partially stabilize `bound_as_ref` by stabilizing `Bound::as_ref`)
 - #100928 (Migrate rustc_metadata to SessionDiagnostics)
 - #101217 ([drop tracking] Use parent expression for scope, not parent node )
 - #101325 (Windows RNG: Use `BCRYPT_RNG_ALG_HANDLE` by default)
 - #101330 (Fix `std::collections::HashSet::drain` documentation)
 - #101338 (Fix unsupported syntax in .manifest file)
 - #101348 (Cleanup css theme)

Failed merges:

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

21 months agoremove redundant clones
Matthias Krüger [Sat, 3 Sep 2022 05:58:41 +0000 (07:58 +0200)]
remove redundant clones

21 months agoShrink suggestion span of argument mismatch error
Michael Goulet [Fri, 2 Sep 2022 02:17:44 +0000 (02:17 +0000)]
Shrink suggestion span of argument mismatch error

21 months agoRollup merge of #101348 - GuillaumeGomez:cleanup-css-theme, r=notriddle
Dylan DPC [Sat, 3 Sep 2022 05:03:09 +0000 (10:33 +0530)]
Rollup merge of #101348 - GuillaumeGomez:cleanup-css-theme, r=notriddle

Cleanup css theme

Follow-up of https://github.com/rust-lang/rust/pull/100494.

The change for the border color of the search input in the dark mode was actually a weird case: the search input border was unique, it didn't share the same variable with other items with borders. This weird case being unique to the dark theme, I removed it, hence the modification in the GUI test.

Live demo is [here](https://rustdoc.crud.net/imperio/cleanup-css-theme/std/index.html).

cc `@jsha`
r? `@notriddle`

21 months agoRollup merge of #101338 - diminishedprime:patch-2, r=tmandry
Dylan DPC [Sat, 3 Sep 2022 05:03:08 +0000 (10:33 +0530)]
Rollup merge of #101338 - diminishedprime:patch-2, r=tmandry

Fix unsupported syntax in .manifest file

Fuchsia .manifest files do not support a `#` comment syntax. Because of this, if you copy and paste the current example code for this file, and then remove the line you don't need, you still see an error. To make this a bit easier to follow, split this into two code blocks, one for rustc, and one for cargo.

21 months agoRollup merge of #101330 - wkordalski:hashset-drain-doc, r=jyn514
Dylan DPC [Sat, 3 Sep 2022 05:03:07 +0000 (10:33 +0530)]
Rollup merge of #101330 - wkordalski:hashset-drain-doc, r=jyn514

Fix `std::collections::HashSet::drain` documentation

Hi!

`std::collections::HashSet::drain` contains small typo in the docstring.

I didn't read too much about the model of contributing to Rust, so merge this PR or close and fix the typo the right way :)

Thanks for Rust!

21 months agoRollup merge of #101325 - ChrisDenton:BCRYPT_RNG_ALG_HANDLE, r=thomcc
Dylan DPC [Sat, 3 Sep 2022 05:03:06 +0000 (10:33 +0530)]
Rollup merge of #101325 - ChrisDenton:BCRYPT_RNG_ALG_HANDLE, r=thomcc

Windows RNG: Use `BCRYPT_RNG_ALG_HANDLE` by default

This only changes a small amount of actual code, the rest is documentation outlining the history of this module as I feel it will be relevant to any future issues that might crop up.

The code change is to use the `BCRYPT_RNG_ALG_HANDLE` [pseudo-handle](https://docs.microsoft.com/en-us/windows/win32/seccng/cng-algorithm-pseudo-handles) by default, which simply uses the default RNG. Previously we used `BCRYPT_USE_SYSTEM_PREFERRED_RNG` which has to load the system configuration and then find and load that RNG. I suspect this was the cause of failures on some systems (e.g. due to corrupted config). However, this is admittedly speculation as I can't reproduce the issue myself (and it does seem quite rare even in the wild). Still, removing a possible point of failure is likely worthwhile in any case.

r? libs

21 months agoRollup merge of #101217 - eholk:drop-tracking-73137, r=jyn514
Dylan DPC [Sat, 3 Sep 2022 05:03:06 +0000 (10:33 +0530)]
Rollup merge of #101217 - eholk:drop-tracking-73137, r=jyn514

[drop tracking] Use parent expression for scope, not parent node

Previously we were just using the parent node as the scope for a temporary value, but it turns out this is too narrow. For example, in an expression like

    Foo {
        b: &42,
        a: async { 0 }.await,
    }

the scope for the &42 was set to the ExprField node for `b: &42`, when we actually want to use the Foo struct expression.

We fix this by recursively searching through parent nodes until we find a Node::Expr. It may be that we don't find one, and if so that's okay, we will just fall back on the enclosing temporary scope which is always sufficient.

Helps with #97331

r? ``@jyn514``

21 months agoRollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davidtwco
Dylan DPC [Sat, 3 Sep 2022 05:03:05 +0000 (10:33 +0530)]
Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davidtwco

Migrate rustc_metadata to SessionDiagnostics

Migrate rustc_metadata to SessionDiagnostics.

Part of https://github.com/rust-lang/rust/issues/100717

21 months agoRollup merge of #99736 - lopopolo:lopopolo/gh-80996-partial-stabilization-bounds...
Dylan DPC [Sat, 3 Sep 2022 05:03:04 +0000 (10:33 +0530)]
Rollup merge of #99736 - lopopolo:lopopolo/gh-80996-partial-stabilization-bounds-as-ref, r=dtolnay

Partially stabilize `bound_as_ref` by stabilizing `Bound::as_ref`

Stabilizing `Bound::as_ref` will simplify the implementation for `RangeBounds<usize>` for custom range types:

```rust
impl RangeBounds<usize> for Region {
    fn start_bound(&self) -> Bound<&usize> {
        // TODO: Use `self.start.as_ref()` when upstream `std` stabilizes:
        // https://github.com/rust-lang/rust/issues/80996
        match self.start {
            Bound::Included(ref bound) => Bound::Included(bound),
            Bound::Excluded(ref bound) => Bound::Excluded(bound),
            Bound::Unbounded => Bound::Unbounded,
        }
    }

    fn end_bound(&self) -> Bound<&usize> {
        // TODO: Use `self.end.as_ref()` when upstream `std` stabilizes:
        // https://github.com/rust-lang/rust/issues/80996
        match self.end {
            Bound::Included(ref bound) => Bound::Included(bound),
            Bound::Excluded(ref bound) => Bound::Excluded(bound),
            Bound::Unbounded => Bound::Unbounded,
        }
    }
}
```

See:

- #80996
- https://github.com/rust-lang/rust/issues/80996#issuecomment-1194575470

cc `@yaahc` who suggested partial stabilization.

21 months agoAuto merge of #101139 - nnethercote:shrink-thir-Pat, r=cjgillot
bors [Sat, 3 Sep 2022 04:19:00 +0000 (04:19 +0000)]
Auto merge of #101139 - nnethercote:shrink-thir-Pat, r=cjgillot

Shrink `thir::Pat`

r? `@cjgillot`

21 months agoAuto merge of #100966 - compiler-errors:revert-remove-deferred-sized-checks, r=pnkfelix
bors [Sat, 3 Sep 2022 00:02:41 +0000 (00:02 +0000)]
Auto merge of #100966 - compiler-errors:revert-remove-deferred-sized-checks, r=pnkfelix

Revert "Remove deferred sized checks"

cc: https://github.com/rust-lang/rust/pull/100652#issuecomment-1225798572

I'm okay with reverting this for now, and I will look into the diagnostic regressions.

This reverts commit 33212bf7f527798a8cfa2bbb38781742f4ca718a.

r? `@pnkfelix`

----

EDIT: This _also_ fixes #101066, a regression in method selection logic/coercion(?) due to the early registering of a `Sized` bound.

21 months agoffx component run should provide a collection
Matt Hamrick [Fri, 2 Sep 2022 22:16:51 +0000 (15:16 -0700)]
ffx component run should provide a collection

In the future,`ffx component run` will not default to the using the `/core/ffx-laboratory` collection. Updated the run commands to include this.

21 months agoUpdate rustdoc-gui tests for search-input border color on dark theme
Guillaume Gomez [Fri, 2 Sep 2022 15:40:28 +0000 (17:40 +0200)]
Update rustdoc-gui tests for search-input border color on dark theme

21 months agoClean up themes CSS
Guillaume Gomez [Fri, 2 Sep 2022 13:08:23 +0000 (15:08 +0200)]
Clean up themes CSS

21 months agoAuto merge of #97802 - Enselic:add-no_ignore_sigkill-feature, r=joshtriplett
bors [Fri, 2 Sep 2022 21:08:08 +0000 (21:08 +0000)]
Auto merge of #97802 - Enselic:add-no_ignore_sigkill-feature, r=joshtriplett

Support `#[unix_sigpipe = "inherit|sig_dfl"]` on `fn main()` to prevent ignoring `SIGPIPE`

When enabled, programs don't have to explicitly handle `ErrorKind::BrokenPipe` any longer. Currently, the program

```rust
fn main() { loop { println!("hello world"); } }
```

will print an error if used with a short-lived pipe, e.g.

    % ./main | head -n 1
    hello world
    thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1016:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

by enabling `#[unix_sigpipe = "sig_dfl"]` like this

```rust
#![feature(unix_sigpipe)]
#[unix_sigpipe = "sig_dfl"]
fn main() { loop { println!("hello world"); } }
```

there is no error, because `SIGPIPE` will not be ignored and thus the program will be killed appropriately:

    % ./main | head -n 1
    hello world

The current libstd behaviour of ignoring `SIGPIPE` before `fn main()` can be explicitly requested by using `#[unix_sigpipe = "sig_ign"]`.

With `#[unix_sigpipe = "inherit"]`, no change at all is made to `SIGPIPE`, which typically means the behaviour will be the same as `#[unix_sigpipe = "sig_dfl"]`.

See https://github.com/rust-lang/rust/issues/62569 and referenced issues for discussions regarding the `SIGPIPE` problem itself

See the [this](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Proposal.3A.20First.20step.20towards.20solving.20the.20SIGPIPE.20problem) Zulip topic for more discussions, including about this PR.

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

21 months agorustdoc: put in rule to get alignment in desktop and mobile layouts
Michael Howell [Fri, 2 Sep 2022 19:15:06 +0000 (12:15 -0700)]
rustdoc: put in rule to get alignment in desktop and mobile layouts

21 months agoUpdate backtrace
Ben Kimock [Fri, 2 Sep 2022 20:09:58 +0000 (16:09 -0400)]
Update backtrace

21 months agorustdoc: remove incorrect CSS rule causing misaligned item-info
Michael Howell [Fri, 2 Sep 2022 18:50:19 +0000 (11:50 -0700)]
rustdoc: remove incorrect CSS rule causing misaligned item-info

21 months agorustdoc: remove unused CSS selector `.methods > .item-info`
Michael Howell [Fri, 2 Sep 2022 17:54:40 +0000 (10:54 -0700)]
rustdoc: remove unused CSS selector `.methods > .item-info`

It was added with e08a84a0c18739417a50c3e46917ced5037244eb
(actually, it was called `.methods > .stability` at the time) and was
directly nested that way.

But with the switch to `<details>`, the code has changed drastically out from
under it, to the point where you have to go out of your way to actually get
it to render this way, and the result looks overly-tight and weird alongside
the normal version where this code is not reachable.

21 months agoAuto merge of #101333 - matthiaskrgr:rollup-qpf1otj, r=matthiaskrgr
bors [Fri, 2 Sep 2022 18:40:21 +0000 (18:40 +0000)]
Auto merge of #101333 - matthiaskrgr:rollup-qpf1otj, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #100121 (Try normalizing types without RevealAll in ParamEnv in MIR validation)
 - #100200 (Change implementation of `-Z gcc-ld` and `lld-wrapper` again)
 - #100814 ( Porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1)
 - #101215 (Also replace the version placeholder in rustc_attr)
 - #101260 (Use `FILE_ATTRIBUTE_TAG_INFO` to get reparse tag)
 - #101323 (Remove unused .toggle-label CSS rule)

Failed merges:

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

21 months agoFix unsupported syntax in .manifest file
Matt Hamrick [Fri, 2 Sep 2022 18:14:22 +0000 (11:14 -0700)]
Fix unsupported syntax in .manifest file

Fuchsia .manifest files do not support a `#` comment syntax. Because of this, if you copy and paste the current example code for this file, and then remove the line you don't need, you still see an error. To make this a bit easier to follow, split this into two code blocks, one for rustc, and one for cargo.

21 months agoRollup merge of #101323 - GuillaumeGomez:remove-unused-css, r=notriddle
Matthias Krüger [Fri, 2 Sep 2022 16:22:04 +0000 (18:22 +0200)]
Rollup merge of #101323 - GuillaumeGomez:remove-unused-css, r=notriddle

Remove unused .toggle-label CSS rule

It was added in https://github.com/rust-lang/rust/pull/44192 but since we moved to `<details>`, we don't use this rule any more.

r? `@notriddle`

21 months agoRollup merge of #101260 - ChrisDenton:attribute-tag, r=thomcc
Matthias Krüger [Fri, 2 Sep 2022 16:22:02 +0000 (18:22 +0200)]
Rollup merge of #101260 - ChrisDenton:attribute-tag, r=thomcc

Use `FILE_ATTRIBUTE_TAG_INFO` to get reparse tag

I've been looking at this code recently and it just occurred to me we don't actually use the full reparse data at this point, only the tag. [`GetFileInformationByHandleEx`](https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyhandleex) can do exactly that by filling a [`FILE_ATTRIBUTE_TAG_INFO`](https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_attribute_tag_info) struct.

r? ```````@thomcc``````` since you've made changes here recently (which is why I have this code on my mind atm)

21 months agoRollup merge of #101215 - est31:rustdoc_version_placeholder, r=Mark-Simulacrum
Matthias Krüger [Fri, 2 Sep 2022 16:22:01 +0000 (18:22 +0200)]
Rollup merge of #101215 - est31:rustdoc_version_placeholder, r=Mark-Simulacrum

Also replace the version placeholder in rustc_attr

Replace the version placeholder with the current version in the rustc_attr crate too so that users won't see the placeholder but instead the explicit version. This especially fixes the bug for rustdoc not showing it but instead the placeholder.

Originally reported [here](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/libs.20stabilization.20placeholder/near/296057188).

cc #100591

![Screenshot_20220830_233727](https://user-images.githubusercontent.com/8872119/187548079-6207776b-4481-4351-afff-607f5b3fe03a.png)

21 months agoRollup merge of #100814 - gabrielBusta:port_trait_selection_diagnostics, r=davidtwco
Matthias Krüger [Fri, 2 Sep 2022 16:22:00 +0000 (18:22 +0200)]
Rollup merge of #100814 - gabrielBusta:port_trait_selection_diagnostics, r=davidtwco

 Porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1

``@rustbot`` label +A-translation

r? rust-lang/diagnostics
cc #100717

21 months agoRollup merge of #100200 - petrochenkov:zgccld2, r=lqd,Mark-Simulacrum
Matthias Krüger [Fri, 2 Sep 2022 16:21:59 +0000 (18:21 +0200)]
Rollup merge of #100200 - petrochenkov:zgccld2, r=lqd,Mark-Simulacrum

Change implementation of `-Z gcc-ld` and `lld-wrapper` again

This PR partially reverts https://github.com/rust-lang/rust/pull/97375 and uses the strategy described in https://github.com/rust-lang/rust/issues/97402#issuecomment-1147404520 instead, thus fixes https://github.com/rust-lang/rust/issues/97755.

21 months agoRollup merge of #100121 - Nilstrieb:mir-validator-param-env, r=oli-obk
Matthias Krüger [Fri, 2 Sep 2022 16:21:58 +0000 (18:21 +0200)]
Rollup merge of #100121 - Nilstrieb:mir-validator-param-env, r=oli-obk

Try normalizing types without RevealAll in ParamEnv in MIR validation

Before, the MIR validator used RevealAll in its ParamEnv for type
checking. This could cause false negatives in some cases due to
RevealAll ParamEnvs not always use all predicates as expected here.

Since some MIR passes like inlining use RevealAll as well, keep using
it in the MIR validator too, but when it fails usign RevealAll, also
try the check without it, to stop false negatives.

Fixes #99866

cc ````````@compiler-errors```````` who nicely helped me on zulip

21 months agoAuto merge of #101331 - RalfJung:miri, r=RalfJung
bors [Fri, 2 Sep 2022 16:10:04 +0000 (16:10 +0000)]
Auto merge of #101331 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/101324
r? `@ghost`
now finally with the FFI support we had to bail out last time :D

21 months agoupdate Miri
Ralf Jung [Fri, 2 Sep 2022 14:49:38 +0000 (16:49 +0200)]
update Miri

21 months agoFix `std::collections::HashSet::drain` documentation
Wojciech Kordalski [Fri, 2 Sep 2022 14:35:40 +0000 (16:35 +0200)]
Fix `std::collections::HashSet::drain` documentation

21 months agoUse `BCRYPT_RNG_ALG_HANDLE` by default
Chris Denton [Fri, 2 Sep 2022 12:23:52 +0000 (13:23 +0100)]
Use `BCRYPT_RNG_ALG_HANDLE` by default

Also briefly document the history of `sys/windows/rand.rs` as they may be relevant to any future changes.

21 months agoRemove unused .toggle-label CSS rule
Guillaume Gomez [Fri, 2 Sep 2022 13:09:59 +0000 (15:09 +0200)]
Remove unused .toggle-label CSS rule

21 months agoAuto merge of #101318 - GuillaumeGomez:rollup-qsr51z4, r=GuillaumeGomez
bors [Fri, 2 Sep 2022 10:55:24 +0000 (10:55 +0000)]
Auto merge of #101318 - GuillaumeGomez:rollup-qsr51z4, r=GuillaumeGomez

Rollup of 9 pull requests

Successful merges:

 - #97739 (Uplift the `let_underscore` lints from clippy into rustc.)
 - #99583 (Add additional methods to the Demand type)
 - #100147 (optimization of access level table construction)
 - #100552 (rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors)
 - #100827 (Simplify MIR opt tests)
 - #101166 (Generate error index with mdbook instead of raw HTML pages)
 - #101294 (Fix #100844 rebase accident)
 - #101298 (rustdoc: remove unused CSS `#main-content > .since`)
 - #101304 (Add autolabels for `A-query-system`)

Failed merges:

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

21 months agoAdd warning against unexpected --cfg with --check-cfg
Urgau [Thu, 11 Aug 2022 17:50:48 +0000 (19:50 +0200)]
Add warning against unexpected --cfg with --check-cfg

21 months agoMake CrateConfig make order depended for linting purpose
Urgau [Thu, 1 Sep 2022 14:22:30 +0000 (16:22 +0200)]
Make CrateConfig make order depended for linting purpose

21 months agoRollup merge of #101304 - jyn514:jnelson/tag-query-system, r=Dylan-DPC
Guillaume Gomez [Fri, 2 Sep 2022 09:34:55 +0000 (11:34 +0200)]
Rollup merge of #101304 - jyn514:jnelson/tag-query-system, r=Dylan-DPC

Add autolabels for `A-query-system`

r? `@cjgillot`

21 months agoRollup merge of #101298 - notriddle:notriddle/rustdoc-main-since, r=GuillaumeGomez
Guillaume Gomez [Fri, 2 Sep 2022 09:34:54 +0000 (11:34 +0200)]
Rollup merge of #101298 - notriddle:notriddle/rustdoc-main-since, r=GuillaumeGomez

rustdoc: remove unused CSS `#main-content > .since`

This rule was added (actually, it was called `#main > .since` back then) with cdca0843779eed0b9046e9fee48c91458ad51605 and you can see an example of the bug it's intended to fix in <https://doc.rust-lang.org/1.9.0/std/fmt/fn.write.html> by looking at the `1.0.0` version marker.

However, a5a2f2b951ea982a666eaf52b1874d8f1b17290b changed it so that `<span class="since">` is always placed in an out-of-band wrapper, so it's never nested directly below `#main` / `#main-content` any more.

21 months agoRollup merge of #101294 - Xiretza:fix-100844-accident, r=davidtwco
Guillaume Gomez [Fri, 2 Sep 2022 09:34:53 +0000 (11:34 +0200)]
Rollup merge of #101294 - Xiretza:fix-100844-accident, r=davidtwco

Fix #100844 rebase accident

This undoes the rebase accident in #100844, which accidentally caused #100970 to be reverted.

21 months agoRollup merge of #101166 - GuillaumeGomez:error-index-mdbook, r=notriddle
Guillaume Gomez [Fri, 2 Sep 2022 09:34:51 +0000 (11:34 +0200)]
Rollup merge of #101166 - GuillaumeGomez:error-index-mdbook, r=notriddle

Generate error index with mdbook instead of raw HTML pages

This is a follow-up of https://github.com/rust-lang/rust/pull/100922.

This comes from a remark from ````@estebank```` who said that the search was a nice thing on the previous version and that it wasn't possible anymore. An easy way to come around this limitation was to use `mdbook`, which is what I did here.

Now some explanations on the code. I'll explain how I developed this and why I reached this solution. First I did it very basically by simply setting the source directory and the output directory, generated a `SUMMARY.md` manually which listed all error codes and that was it. Two problems arose from this:
 1. A lot of new HTML files were generated at the top level
 2. An `index.html` file was generated at the top-level (the summary in short).

So for `1.`, it's not great to have too many files at the top-level as it could create file conflicts more easily. And for `2.`, this is actually a huge issue because <doc.rust-lang.org> generates an `index.html` file with a links to a few different resources, so it should never be overwritten. <s>Unfortunately, `mdbook` **always** generates an `index.html` file so the only solution I could see (except for sending them a contribution, I'll maybe do that later) was to temporaly move a potentially existing `index.html` file and then puts it back once done. For this last part, to ensure that we don't return *before* it has been put back, I wrapped the `mdbook` generation code inside `render_html_inner` which is called from `render_html` which in turn handle the "save" of `index.html`.</s>

EDIT: `mdbook` completely deletes ALL the content in the target directory so I instead generate into a sub directory and then I move the files to the real target directory.

To keep compatibility with the old version, I also put the `<script>` ````@notriddle```` nicely provided in the previous PR only into the `error-index.html` file to prevent unneeded repetition. I didn't use `mdbook` `additional-js` option because the JS is included at the end of all HTML files, which we don't want for two reasons:
 1. It's slow.
 2. We only want it to be run in `error-index.html` (even if we also ensure in the JS itself too!).

<s>Now the last part: why we generate the summary twice. We actually generate it once to tell `mdbook` what the book will look like and a second time because a create a new chapter content which will actually list all the error codes (with the updated paths).</s>

EDIT: I removed the need for two summaries.

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

r? ````@notriddle````

21 months agoRollup merge of #100827 - JakobDegen:better-tests, r=wesleywiser
Guillaume Gomez [Fri, 2 Sep 2022 09:34:50 +0000 (11:34 +0200)]
Rollup merge of #100827 - JakobDegen:better-tests, r=wesleywiser

Simplify MIR opt tests

This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized.

Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the end to end effect of the optimization pipeline on the example code is.

r? `````@wesleywiser`````

21 months agoRollup merge of #100552 - petrochenkov:flavorcompat, r=lqd
Guillaume Gomez [Fri, 2 Sep 2022 09:34:49 +0000 (11:34 +0200)]
Rollup merge of #100552 - petrochenkov:flavorcompat, r=lqd

rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors

I want to do some refactorings in `rustc_target` - merge `lld_flavor` and `linker_is_gnu` into `linker_flavor`, support combination gcc+lld (https://github.com/rust-lang/rust/pull/96827).
This PR adds some compatibility infra that makes that possible without making any changes to user-facing interfaces - `-Clinker-flavor` values and json target specs. (For json target specs this infra may eventually go away since they are not very stable.)

The second commit does some light refactoring of internal linker flavors (applies changes from https://github.com/petrochenkov/rust/commit/53eca42973b7e379b9fa0469c33f08680b57c35f that don't require mass-editing target specs).

21 months agoRollup merge of #100147 - Bryanskiy:private-in-public, r=petrochenkov
Guillaume Gomez [Fri, 2 Sep 2022 09:34:48 +0000 (11:34 +0200)]
Rollup merge of #100147 - Bryanskiy:private-in-public, r=petrochenkov

optimization of access level table construction

Refactoring which was mentioned in #87487

21 months agoRollup merge of #99583 - shepmaster:provider-plus-plus, r=yaahc
Guillaume Gomez [Fri, 2 Sep 2022 09:34:46 +0000 (11:34 +0200)]
Rollup merge of #99583 - shepmaster:provider-plus-plus, r=yaahc

Add additional methods to the Demand type

This adds on to the original tracking issue #96024

r? `````@yaahc`````

21 months agoRollup merge of #97739 - a2aaron:let_underscore, r=estebank
Guillaume Gomez [Fri, 2 Sep 2022 09:34:45 +0000 (11:34 +0200)]
Rollup merge of #97739 - a2aaron:let_underscore, r=estebank

Uplift the `let_underscore` lints from clippy into rustc.

This PR resolves #97241.

This PR adds three lints from clippy--`let_underscore_drop`, `let_underscore_lock`, and `let_underscore_must_use`, which are meant to capture likely-incorrect uses of `let _ = ...` bindings (in particular, doing this on a type with a non-trivial `Drop` causes the `Drop` to occur immediately, instead of at the end of the scope. For a type like `MutexGuard`, this effectively releases the lock immediately, which is almost certainly the wrong behavior)

In porting the lints from clippy I had to copy over a bunch of utility functions from `clippy_util` that these lints also relied upon. Is that the right approach?

Note that I've set the `must_use` and `drop` lints to Allow by default and set `lock` to Deny by default (this matches the same settings that clippy has). In talking with `@estebank` he informed me to do a Crater run (I am not sure what type of Crater run to request here--I think it's just "check only"?)

On the linked issue, there's some discussion about using `must_use` and `Drop` together as a heuristic for when to warn--I did not implement this yet.

r? `@estebank`

21 months agoAuto merge of #100943 - jyn514:query-system-2, r=cjgillot
bors [Fri, 2 Sep 2022 08:28:08 +0000 (08:28 +0000)]
Auto merge of #100943 - jyn514:query-system-2, r=cjgillot

Simplify the `define_query` macro

This moves a bunch of control flow out of the macro into generic functions, leaving the macro just to call the function with a new generic parameter for each query.

It may be possible to improve compile-times / icache by instantiating the generic functions only with the query key, not the query type itself, but I'm going to leave that for a follow-up PR.

Helps with https://github.com/rust-lang/rust/issues/96524.

r? `@cjgillot`

21 months agoUpdate LLVM submodule
Nikita Popov [Fri, 2 Sep 2022 08:18:12 +0000 (10:18 +0200)]
Update LLVM submodule

Fixes #100834.
Fixes #101121.

21 months agoSimplify MIR opt tests
Jakob Degen [Sun, 21 Aug 2022 04:47:53 +0000 (21:47 -0700)]
Simplify MIR opt tests

This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These
tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due
to having excessively strong opinions over *how* a piece of code should be optimized.

Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for
code where we want to track what the result of the net result of the optimization pipeline's output
is.

21 months agoAuto merge of #100935 - cuviper:upgrade-android-ci, r=Mark-Simulacrum
bors [Fri, 2 Sep 2022 05:32:57 +0000 (05:32 +0000)]
Auto merge of #100935 - cuviper:upgrade-android-ci, r=Mark-Simulacrum

ci: Upgrade android containers from ubuntu:16.04 to 22.04

The main goal of updating to 22.04 is to get away from `llvm.allow-old-toolchain`.
These containers are not building LLVM for android, so only the host version matters.
A side benefit is that they can also use the system `cmake` instead of building one.

21 months agoAuto merge of #100395 - Dylan-DPC:rollup-ajrwo1s, r=Dylan-DPC
bors [Fri, 2 Sep 2022 03:16:32 +0000 (03:16 +0000)]
Auto merge of #100395 - Dylan-DPC:rollup-ajrwo1s, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #92744 (Check if enum from foreign crate has any non exhaustive variants when attempting a cast)
 - #99337 (rustdoc: simplify highlight.rs)
 - #100007 (Never inline Windows dtor access)
 - #100030 (cleanup code w/ pointers in std a little)
 - #100192 ( Remove duplicated temporaries creating during box derefs elaboration)
 - #100247 (Generalize trait object generic param check to aliases.)
 - #100374 (Improve crate selection on rustdoc search results page)

Failed merges:

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

21 months agoAdd autolabels for `A-query-system`
Joshua Nelson [Fri, 2 Sep 2022 01:49:12 +0000 (20:49 -0500)]
Add autolabels for `A-query-system`

21 months agoAuto merge of #101248 - RalfJung:miri, r=RalfJung
bors [Fri, 2 Sep 2022 00:53:50 +0000 (00:53 +0000)]
Auto merge of #101248 - RalfJung:miri, r=RalfJung

update Miri

r? `@ghost`
Fixes https://github.com/rust-lang/rust/issues/101067

21 months agoDon't create two new closures for each query
Joshua Nelson [Mon, 29 Aug 2022 15:20:14 +0000 (10:20 -0500)]
Don't create two new closures for each query

- Parameterize DepKindStruct over `'tcx`

    This allows passing in an invariant function pointer in `query_callback`,
    rather than having to try and make it work for any lifetime.

- Add a new `execute_query` function to `QueryDescription` so we can call `tcx.$name` without needing to be in a macro context

21 months agoSimplify `try_load_from_on_disk_cache`
Joshua Nelson [Wed, 24 Aug 2022 04:34:23 +0000 (23:34 -0500)]
Simplify `try_load_from_on_disk_cache`

21 months agoMove almost all of the function in `query_callbacks` to a generic function
Joshua Nelson [Wed, 24 Aug 2022 04:31:12 +0000 (23:31 -0500)]
Move almost all of the function in `query_callbacks` to a generic function

21 months agoAlso replace the version placeholder in rustc_attr
est31 [Tue, 30 Aug 2022 21:05:51 +0000 (23:05 +0200)]
Also replace the version placeholder in rustc_attr

This fixes rustdoc not showing the current version as stabilization version
for recently stabilized lang features.

21 months agoGet rid of `fn recover`
Joshua Nelson [Wed, 24 Aug 2022 03:49:20 +0000 (22:49 -0500)]
Get rid of `fn recover`

21 months agoMove `force_with_dep_node` outside the giant macro
Joshua Nelson [Wed, 24 Aug 2022 03:24:39 +0000 (22:24 -0500)]
Move `force_with_dep_node` outside the giant macro

21 months agoMove `try_on_disk_cache` out of the giant macro
Joshua Nelson [Wed, 24 Aug 2022 03:10:47 +0000 (22:10 -0500)]
Move `try_on_disk_cache` out of the giant macro

21 months agoGet rid of `make_query` module
Joshua Nelson [Wed, 24 Aug 2022 02:47:59 +0000 (21:47 -0500)]
Get rid of `make_query` module

21 months agorustdoc: remove unused CSS `#main-content > .since`
Michael Howell [Thu, 1 Sep 2022 20:06:24 +0000 (13:06 -0700)]
rustdoc: remove unused CSS `#main-content > .since`

This rule was added (actually, it was called `#main > .since` back then) with
cdca0843779eed0b9046e9fee48c91458ad51605 and you can see an example of the
bug it's intended to fix in <https://doc.rust-lang.org/1.9.0/std/fmt/fn.write.html>
by looking at the `1.0.0` version marker.

However, a5a2f2b951ea982a666eaf52b1874d8f1b17290b changed it so that
`<span class="since">` is always placed in an out-of-band wrapper, so it's
never nested directly below `#main` / `#main-content` any more.

21 months agoAuto merge of #101295 - matthiaskrgr:rollup-046o38p, r=matthiaskrgr
bors [Thu, 1 Sep 2022 22:12:32 +0000 (22:12 +0000)]
Auto merge of #101295 - matthiaskrgr:rollup-046o38p, r=matthiaskrgr

Rollup of 14 pull requests

Successful merges:

 - #94467 (Add `special_module_name` lint)
 - #100852 (Use `getuid` to check instead of `USER` env var in rustbuild)
 - #101072 (bootstrap: Add llvm-has-rust-patches target option)
 - #101190 (Make docs formulation more consistent for NonZero{int})
 - #101245 (Remove unneeded where whitespace)
 - #101251 (Fix  bad target name in Walkthrough)
 - #101254 (rustdoc: remove unused `.docblock .impl-items` CSS)
 - #101256 (Fixes/adjustments to Fuchsia doc walkthrough)
 - #101270 (Update outdated comment about output capturing in print_to.)
 - #101271 (Fix filename of armv4t-none-eabi.md)
 - #101274 (Fix typo in comment)
 - #101279 (Fix doc_auto_cfg for impl blocks in different modules with different `cfg`)
 - #101285 (Do not suggest adding `move` to closure when `move` is already used)
 - #101292 (rustdoc: remove unneeded CSS `.content table td:first-child > a`)

Failed merges:

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

21 months agoUse boxed slices in `PatKind`.
Nicholas Nethercote [Fri, 26 Aug 2022 02:06:13 +0000 (12:06 +1000)]
Use boxed slices in `PatKind`.

To shrink it a little more.

21 months agoBox `CanonicalUserTypeAnnotation::CanonicalUserType`.
Nicholas Nethercote [Fri, 26 Aug 2022 01:53:54 +0000 (11:53 +1000)]
Box `CanonicalUserTypeAnnotation::CanonicalUserType`.

This shrinks `Ascription`, which shrinks `PatKind::AscribeUserType`,
which shrinks `Pat`.

21 months agoBox `PatKind::Range`.
Nicholas Nethercote [Fri, 26 Aug 2022 01:36:24 +0000 (11:36 +1000)]
Box `PatKind::Range`.

Because it's the biggest variant. Also, make `PatRange` non-`Copy`,
because it's 104 bytes, which is pretty big.

21 months agoAvoid some clones.
Nicholas Nethercote [Thu, 25 Aug 2022 04:05:01 +0000 (14:05 +1000)]
Avoid some clones.

`Builder::expr_into_pattern` has a single call site. Currently the
`pattern` argument at the call site is always cloned.

This commit changes things so that we instead do a clone within
`expr_into_pattern`, but only if the pattern has the
`PatKind::AscribeUserType` kind, and we only clone the annotation within
the pattern instead of the entire pattern.

21 months agoClean up THIR patterns.
Nicholas Nethercote [Thu, 25 Aug 2022 02:25:44 +0000 (12:25 +1000)]
Clean up THIR patterns.

`thir::Pat::kind` is a `Box<PatKind>`, which doesn't follow the usual
pattern in AST/HIR/THIR which is that the "kind" enum for a node is
stored inline within the parent struct.

This commit makes the `PatKind` directly inline within the `Pat`. This
requires using `Box<Pat>` in all the types that hold a `Pat.

Ideally, `Pat` would be stored in `Thir` like `Expr` and `Stmt` and
referred to with a `PatId` rather than `Box<Pat>`. But this is hard to
do because lots of `Pat`s get created after the destruction of the `Cx`
that does normal THIR building. But this does get us a step closer to
`PatId`, because all the `Box<Pat>` occurrences would be replaced with
`PatId` if `PatId` ever happened.

At 128 bytes, `Pat` is large. Subsequent commits will shrink it.

21 months agoupdate Miri
Ralf Jung [Thu, 1 Sep 2022 20:59:05 +0000 (22:59 +0200)]
update Miri

21 months agoRollup merge of #101292 - rust-lang:notriddle/rustdoc-table-first-child, r=GuillaumeGomez
Matthias Krüger [Thu, 1 Sep 2022 19:37:23 +0000 (21:37 +0200)]
Rollup merge of #101292 - rust-lang:notriddle/rustdoc-table-first-child, r=GuillaumeGomez

rustdoc: remove unneeded CSS `.content table td:first-child > a`

This rule was added in c1c6175e62189f8f0e6479bff7bac0e59a95a406 to benefit the module items table. However, the module items table stopped using table tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6 switched us over to grid layout.

21 months agoRollup merge of #101285 - TaKO8Ki:do-not-suggest-adding-move-when-closure-is-already...
Matthias Krüger [Thu, 1 Sep 2022 19:37:21 +0000 (21:37 +0200)]
Rollup merge of #101285 - TaKO8Ki:do-not-suggest-adding-move-when-closure-is-already-marked-as-move, r=oli-obk

Do not suggest adding `move` to closure when `move` is already used

Fixes #101227

21 months agoRollup merge of #101279 - GuillaumeGomez:doc_auto_cfg_nested_impl, r=notriddle
Matthias Krüger [Thu, 1 Sep 2022 19:37:20 +0000 (21:37 +0200)]
Rollup merge of #101279 - GuillaumeGomez:doc_auto_cfg_nested_impl, r=notriddle

Fix doc_auto_cfg for impl blocks in different modules with different `cfg`

Fixes #101129.

Just like reexports, impl blocks don't necessarily share the same "space" as the item they implement so we need to merge attributes from its parents as well.

r? `@notriddle`

21 months agoRollup merge of #101274 - aDotInTheVoid:comment-typo, r=TaKO8Ki
Matthias Krüger [Thu, 1 Sep 2022 19:37:19 +0000 (21:37 +0200)]
Rollup merge of #101274 - aDotInTheVoid:comment-typo, r=TaKO8Ki

Fix typo in comment

21 months agoRollup merge of #101271 - QuinnPainter:patch-1, r=Dylan-DPC
Matthias Krüger [Thu, 1 Sep 2022 19:37:17 +0000 (21:37 +0200)]
Rollup merge of #101271 - QuinnPainter:patch-1, r=Dylan-DPC

Fix filename of armv4t-none-eabi.md

The filename differed from the link in SUMMARY.md, causing it to 404.

21 months agoRollup merge of #101270 - m-ou-se:update-comment, r=joshtriplett
Matthias Krüger [Thu, 1 Sep 2022 19:37:16 +0000 (21:37 +0200)]
Rollup merge of #101270 - m-ou-se:update-comment, r=joshtriplett

Update outdated comment about output capturing in print_to.

21 months agoRollup merge of #101256 - andrewpollack:fuchsia-docs-adding, r=tmandry
Matthias Krüger [Thu, 1 Sep 2022 19:37:15 +0000 (21:37 +0200)]
Rollup merge of #101256 - andrewpollack:fuchsia-docs-adding, r=tmandry

Fixes/adjustments to Fuchsia doc walkthrough

Small fixes/adjustments missed during #100927

21 months agoRollup merge of #101254 - rust-lang:notriddle/remove-even-more-css, r=jsha
Matthias Krüger [Thu, 1 Sep 2022 19:37:14 +0000 (21:37 +0200)]
Rollup merge of #101254 - rust-lang:notriddle/remove-even-more-css, r=jsha

rustdoc: remove unused `.docblock .impl-items` CSS

The impl-items list stopped being nested inside a docblock since c1b1d6804bfce1aee3a95b3cbff3eaeb15bad9a4

21 months agoRollup merge of #101251 - diminishedprime:patch-1, r=JohnTitor
Matthias Krüger [Thu, 1 Sep 2022 19:37:12 +0000 (21:37 +0200)]
Rollup merge of #101251 - diminishedprime:patch-1, r=JohnTitor

Fix  bad target name in Walkthrough

Walkthrough currently say:

```
rustup target add aarch_64-fuchsia
```
but should say

```
rustup target add aarch64-fuchsia
```

21 months agoRollup merge of #101245 - GuillaumeGomez:remove-unneeded-where-whitespace, r=notriddle
Matthias Krüger [Thu, 1 Sep 2022 19:37:11 +0000 (21:37 +0200)]
Rollup merge of #101245 - GuillaumeGomez:remove-unneeded-where-whitespace, r=notriddle

Remove unneeded where whitespace

It fixes these two bugs:

![Screenshot from 2022-08-31 18-14-40](https://user-images.githubusercontent.com/3050060/187727950-94657419-abfa-454c-9d27-004280fbcb45.png)
![Screenshot from 2022-08-31 18-14-49](https://user-images.githubusercontent.com/3050060/187727956-21d1b39d-62d7-4e7b-8f6f-631ceda67a19.png)

It's a relic from a very old time (this commit: https://github.com/rust-lang/rust/commit/bfd01b7f40ae2cbfe9acbc1d10e79ffe16870df8).

You can test the result [here](https://rustdoc.crud.net/imperio/remove-unneeded-where-whitespace/lib2/struct.WhereWhitespace.html).

cc `````````@jsha`````````
r? `````````@notriddle`````````

21 months agoRollup merge of #101190 - yjhn:patch-1, r=Mark-Simulacrum
Matthias Krüger [Thu, 1 Sep 2022 19:37:10 +0000 (21:37 +0200)]
Rollup merge of #101190 - yjhn:patch-1, r=Mark-Simulacrum

Make docs formulation more consistent for NonZero{int}

Use third person, as it is used for other `std` documentation.

21 months agoRollup merge of #101072 - tmandry:llvm-is-vanilla, r=Mark-Simulacrum
Matthias Krüger [Thu, 1 Sep 2022 19:37:09 +0000 (21:37 +0200)]
Rollup merge of #101072 - tmandry:llvm-is-vanilla, r=Mark-Simulacrum

bootstrap: Add llvm-has-rust-patches target option

This is so you can check out an upstream commit in src/llvm-project and
have everything just work.

This simplifies the logic in `is_rust_llvm` a bit; it doesn't need to
check for download-ci-llvm because we would have already errored if both
that and llvm-config were specified on the host platform.