]> git.lizzy.rs Git - rust.git/log
rust.git
23 months agoMake as_ref suggestion a note
Michael Goulet [Tue, 16 Aug 2022 03:02:04 +0000 (03:02 +0000)]
Make as_ref suggestion a note

23 months agoSuggest as_ref or as_mut
Michael Goulet [Sat, 6 Aug 2022 00:17:16 +0000 (00:17 +0000)]
Suggest as_ref or as_mut

23 months agoAuto merge of #100429 - GuillaumeGomez:merge-html-elements-together, r=notriddle
bors [Sun, 14 Aug 2022 14:37:17 +0000 (14:37 +0000)]
Auto merge of #100429 - GuillaumeGomez:merge-html-elements-together, r=notriddle

rustdoc: Merge source code pages HTML elements together

We realized that the HTML generated for the source code pages could be improved quite a lot. This PR is a first pass toward this goal. Some explanations: it merges similar classes elements (even when there are white characters in between).

There is an exception to this: if this is an ident, I also merged it with "unclassified" elements. This part is up to debate and can be very easily removed as the check is performed in one place (in the `can_merge` function).

EDIT: The `ident` is now only kept in the code for the `span` it contains but it is not rendered into the HTML.

So now some numbers:

For these ones, on each page, I run this JS: `document.getElementsByTagName('*').length`. The goal is to count the number of DOM elements. I took some pages that seemed big, but don't hesitate to check some others.

| file name | before this PR | with this PR | diff | without ident | diff |
|-|-|-|-|-|-|
| std/lib.rs.html (source link on std crate page) | 3455 | 2776 | 20.7% | 2387 | 31% |
| alloc/vec/mod.rs.html (source on Vec type page) | 11012 | 8084 | 26.6% | 6682 | 39.4% |
| alloc/string.rs.html (source on String type page) | 10800 | 8214 | 24% | 6712 | 37.9% |
| std/sync/mutex.rs.html (source on Mutex type page) | 2953 | 2403 | 18.7% | 2139 | 27.6% |

You can test it [here](https://rustdoc.crud.net/imperio/merge-html-elements-together/src/std/lib.rs.html).

cc `@jsha`
r? `@notriddle`

23 months agoAuto merge of #100525 - Dylan-DPC:rollup-4cp6nu0, r=Dylan-DPC
bors [Sun, 14 Aug 2022 12:06:50 +0000 (12:06 +0000)]
Auto merge of #100525 - Dylan-DPC:rollup-4cp6nu0, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #99582 (Delay a span bug if we see ty/const generic params during writeback)
 - #99861 (orphan check: rationalize our handling of constants)
 - #100026 (Add `Iterator::array_chunks` (take N+1))
 - #100115 (Suggest removing `let` if `const let` or `let const` is used)
 - #100126 (rustc_target: Update some old naming around self contained linking)
 - #100487 (`assert_{inhabited,zero_valid,uninit_valid}` intrinsics are safe)

Failed merges:

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

23 months agoRollup merge of #100487 - tmiasko:assert-safe, r=petrochenkov
Dylan DPC [Sun, 14 Aug 2022 11:39:17 +0000 (17:09 +0530)]
Rollup merge of #100487 - tmiasko:assert-safe, r=petrochenkov

`assert_{inhabited,zero_valid,uninit_valid}` intrinsics are safe

Those intrinsics either panic or do nothing. They are safe.

23 months agoRollup merge of #100126 - petrochenkov:screname, r=davidtwco
Dylan DPC [Sun, 14 Aug 2022 11:39:16 +0000 (17:09 +0530)]
Rollup merge of #100126 - petrochenkov:screname, r=davidtwco

rustc_target: Update some old naming around self contained linking

The "fallback" naming pre-dates introduction of `-Clink-self-contained`.
Noticed when reviewing https://github.com/rust-lang/rust/pull/99500.

This PR doesn't break any json target spec, but supporting per-linker-flavor startup objects needed by https://github.com/rust-lang/rust/pull/99500 will break them, so maybe next time I'll remove the compatibility names.

23 months agoRollup merge of #100115 - obeis:issue-99910, r=cjgillot
Dylan DPC [Sun, 14 Aug 2022 11:39:15 +0000 (17:09 +0530)]
Rollup merge of #100115 - obeis:issue-99910, r=cjgillot

Suggest removing `let` if `const let` or `let const` is used

Closes #99910

23 months agoRollup merge of #100026 - WaffleLapkin:array-chunks, r=scottmcm
Dylan DPC [Sun, 14 Aug 2022 11:39:14 +0000 (17:09 +0530)]
Rollup merge of #100026 - WaffleLapkin:array-chunks, r=scottmcm

Add `Iterator::array_chunks` (take N+1)

A revival of https://github.com/rust-lang/rust/pull/92393.

r? `@Mark-Simulacrum`
cc `@rossmacarthur` `@scottmcm` `@the8472`

I've tried to address most of the review comments on the previous attempt. The only thing I didn't address is `try_fold` implementation, I've left the "custom" one for now, not sure what exactly should it use.

23 months agoRollup merge of #99861 - lcnr:orphan-check-cg, r=jackh726
Dylan DPC [Sun, 14 Aug 2022 11:39:13 +0000 (17:09 +0530)]
Rollup merge of #99861 - lcnr:orphan-check-cg, r=jackh726

orphan check: rationalize our handling of constants

cc `@rust-lang/types` `@rust-lang/project-const-generics` on whether you agree with this reasoning.

r? types

23 months agoRollup merge of #99582 - compiler-errors:issue-99566, r=cjgillot
Dylan DPC [Sun, 14 Aug 2022 11:39:12 +0000 (17:09 +0530)]
Rollup merge of #99582 - compiler-errors:issue-99566, r=cjgillot

Delay a span bug if we see ty/const generic params during writeback

Fixes #99566

23 months agoUpdate rustdoc tests
Guillaume Gomez [Thu, 11 Aug 2022 21:04:01 +0000 (23:04 +0200)]
Update rustdoc tests

23 months agoDon't generate ident elements as DOM nodes
Guillaume Gomez [Fri, 12 Aug 2022 16:18:04 +0000 (18:18 +0200)]
Don't generate ident elements as DOM nodes

23 months agoMerge HTML elements in highlighting when they can be merged together
Guillaume Gomez [Thu, 11 Aug 2022 21:03:45 +0000 (23:03 +0200)]
Merge HTML elements in highlighting when they can be merged together

23 months agoAuto merge of #100516 - compiler-errors:rollup-fgrfeb3, r=compiler-errors
bors [Sun, 14 Aug 2022 06:40:58 +0000 (06:40 +0000)]
Auto merge of #100516 - compiler-errors:rollup-fgrfeb3, r=compiler-errors

Rollup of 8 pull requests

Successful merges:

 - #99646 (Only point out a single function parameter if we have a single arg incompatibility)
 - #100299 (make `clean::Item::span` return `Option` instead of dummy span)
 - #100335 (Rustdoc-Json: Add `Path` type for traits.)
 - #100367 (Suggest the path separator when a dot is used on a trait)
 - #100431 (Enum variant ctor inherits the stability of the enum variant)
 - #100446 (Suggest removing a semicolon after impl/trait items)
 - #100468 (Use an extensionless `x` script for non-Windows)
 - #100479 (Argument type error improvements)

Failed merges:

 - #100483 (Point to generic or arg if it's the self type of unsatisfied projection predicate)

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

23 months agoRollup merge of #100479 - compiler-errors:argument-type-error-improvements, r=lcnr
Michael Goulet [Sun, 14 Aug 2022 04:06:53 +0000 (21:06 -0700)]
Rollup merge of #100479 - compiler-errors:argument-type-error-improvements, r=lcnr

Argument type error improvements

Motivated by this interesting code snippet:

```rust
#[derive(Copy, Clone)]
struct Wrapper<T>(T);

fn foo(_: fn(i32), _: Wrapper<i32>) {}

fn f(_: u32) {}

fn main() {
    let w = Wrapper::<isize>(1isize);
    foo(f, w);
}
```

Which currently errors like:
```
error[E0308]: arguments to this function are incorrect
  --> src/main.rs:10:5
   |
10 |     foo(f, w);
   |     ^^^ -  - expected `i32`, found `isize`
   |         |
   |         expected `i32`, found `u32`
   |
   = note: expected fn pointer `fn(i32)`
                 found fn item `fn(u32) {f}`
   = note: expected struct `Wrapper<i32>`
              found struct `Wrapper<isize>`
note: function defined here
  --> src/main.rs:4:4
   |
4  | fn foo(_: fn(i32), _: Wrapper<i32>) {}
   |    ^^^ ----------  ---------------
```

Specifically, that double `expected .. found ..` which is very difficult to correlate to the types in the arguments. Also, the fact that "expected `i32`, found `isize`" and the other argument mismatch label don't even really explain what's going on here.

After this PR:
```
error[E0308]: arguments to this function are incorrect
  --> $DIR/two-mismatch-notes.rs:10:5
   |
LL |     foo(f, w);
   |     ^^^
   |
note: expected fn pointer, found fn item
  --> $DIR/two-mismatch-notes.rs:10:9
   |
LL |     foo(f, w);
   |         ^
   = note: expected fn pointer `fn(i32)`
                 found fn item `fn(u32) {f}`
note: expected struct `Wrapper`, found a different struct `Wrapper`
  --> $DIR/two-mismatch-notes.rs:10:12
   |
LL |     foo(f, w);
   |            ^
   = note: expected struct `Wrapper<i32>`
              found struct `Wrapper<isize>`
note: function defined here
  --> $DIR/two-mismatch-notes.rs:4:4
   |
LL | fn foo(_: fn(i32), _: Wrapper<i32>) {}
   |    ^^^ ----------  ---------------

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
```

Yeah, it's a bit verbose, but much clearer IMO.

---

Open to discussions about how this could be further improved. Motivated by `@jyn514's` [tweet](https://mobile.twitter.com/joshuayn514/status/1558042020601634816) here.

23 months agoRollup merge of #100468 - cuviper:lazy-x, r=jyn514
Michael Goulet [Sun, 14 Aug 2022 04:06:52 +0000 (21:06 -0700)]
Rollup merge of #100468 - cuviper:lazy-x, r=jyn514

Use an extensionless `x` script for non-Windows

#99992 added `x.sh` and `x.ps1`, but this broke my lazy `./xTAB` habit that used to get me to `./x.py`. If we rename `x.sh` to `x`, then I can adjust to `./xSPACE` for the same number of characters typed.

r? `@jyn514`

23 months agoRollup merge of #100446 - TaKO8Ki:suggest-removing-semicolon-after-impl-trait-items...
Michael Goulet [Sun, 14 Aug 2022 04:06:51 +0000 (21:06 -0700)]
Rollup merge of #100446 - TaKO8Ki:suggest-removing-semicolon-after-impl-trait-items, r=compiler-errors

Suggest removing a semicolon after impl/trait items

fixes #99822

23 months agoRollup merge of #100431 - compiler-errors:enum-ctor-variant-stab, r=estebank
Michael Goulet [Sun, 14 Aug 2022 04:06:50 +0000 (21:06 -0700)]
Rollup merge of #100431 - compiler-errors:enum-ctor-variant-stab, r=estebank

Enum variant ctor inherits the stability of the enum variant

Fixes #100399
Fixes #100420

Context #71481 for why enum variants don't need stability

23 months agoRollup merge of #100367 - fmease:fix-100365, r=compiler-errors
Michael Goulet [Sun, 14 Aug 2022 04:06:49 +0000 (21:06 -0700)]
Rollup merge of #100367 - fmease:fix-100365, r=compiler-errors

Suggest the path separator when a dot is used on a trait

Fixes #100365.

`@rustbot` label A-diagnostics
r? diagnostics

23 months agoRollup merge of #100335 - aDotInTheVoid:rdj-resolved-path, r=GuillaumeGomez
Michael Goulet [Sun, 14 Aug 2022 04:06:48 +0000 (21:06 -0700)]
Rollup merge of #100335 - aDotInTheVoid:rdj-resolved-path, r=GuillaumeGomez

Rustdoc-Json: Add `Path` type for traits.

Avoids using `Type` for trait fields, as a trait must always be a path, and not any other kind of type.

``@rustbot`` modify labels: +A-rustdoc-json +T-rustdoc

Closes #100106

23 months agoRollup merge of #100299 - compiler-errors:issue-100283, r=notriddle
Michael Goulet [Sun, 14 Aug 2022 04:06:47 +0000 (21:06 -0700)]
Rollup merge of #100299 - compiler-errors:issue-100283, r=notriddle

make `clean::Item::span` return `Option` instead of dummy span

Fixes #100283

23 months agoRollup merge of #99646 - compiler-errors:arg-mismatch-single-arg-label, r=estebank
Michael Goulet [Sun, 14 Aug 2022 04:06:46 +0000 (21:06 -0700)]
Rollup merge of #99646 - compiler-errors:arg-mismatch-single-arg-label, r=estebank

Only point out a single function parameter if we have a single arg incompatibility

Fixes #99635

23 months agoAuto merge of #100495 - RalfJung:miri, r=RalfJung
bors [Sun, 14 Aug 2022 04:00:04 +0000 (04:00 +0000)]
Auto merge of #100495 - RalfJung:miri, r=RalfJung

update Miri

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

23 months agoAuto merge of #100511 - compiler-errors:rollup-vrte4w5, r=compiler-errors
bors [Sun, 14 Aug 2022 01:29:58 +0000 (01:29 +0000)]
Auto merge of #100511 - compiler-errors:rollup-vrte4w5, r=compiler-errors

Rollup of 11 pull requests

Successful merges:

 - #100355 (rustdoc: Rename ``@has` FILE PATTERN` to ``@hasraw` FILE PATTERN`)
 - #100407 (avoid some int2ptr casts in thread_local_key tests)
 - #100434 (Fix HIR pretty printing of let else)
 - #100438 (Erase regions better in `promote_candidate`)
 - #100445 (adapt test for msan message change)
 - #100447 (Remove more Clean trait implementations)
 - #100464 (Make `[rust] use-lld=true` work on windows)
 - #100475 (Give a helpful diagnostic when the next struct field has an attribute)
 - #100490 (wf: correctly `shallow_resolve` consts)
 - #100501 (nicer Miri backtraces for from_exposed_addr)
 - #100509 (merge two test directories that mean the same thing)

Failed merges:

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

23 months agomake clean::Item::span return option instead of dummy span
Michael Goulet [Tue, 9 Aug 2022 02:48:01 +0000 (02:48 +0000)]
make clean::Item::span return option instead of dummy span

23 months agoRollup merge of #100509 - BoxyUwU:merge_hrtb_with_higher_rank_trait_bound, r=compiler...
Michael Goulet [Sat, 13 Aug 2022 21:10:15 +0000 (14:10 -0700)]
Rollup merge of #100509 - BoxyUwU:merge_hrtb_with_higher_rank_trait_bound, r=compiler-errors

merge two test directories that mean the same thing

hopefully `hrtb` doesnt have a secret second meaning that i'm not aware of :laughing:

r? `@compiler-errors`

23 months agoRollup merge of #100501 - RalfJung:miri-from-exposed-addr, r=Mark-Simulacrum
Michael Goulet [Sat, 13 Aug 2022 21:10:14 +0000 (14:10 -0700)]
Rollup merge of #100501 - RalfJung:miri-from-exposed-addr, r=Mark-Simulacrum

nicer Miri backtraces for from_exposed_addr

Miri by default warns about using from_exposed_addr; this makes the span for that a bit nicer.

23 months agoRollup merge of #100490 - lcnr:wf-consts, r=jackh726
Michael Goulet [Sat, 13 Aug 2022 21:10:13 +0000 (14:10 -0700)]
Rollup merge of #100490 - lcnr:wf-consts, r=jackh726

wf: correctly `shallow_resolve` consts

`shallow_resolve` on `InferConst` is always a noop. this is mostly irrelevant as inference vars should already be resolved at most - if not all - call sites. Haven't actually looked too deeply into whether this was a problem.

23 months agoRollup merge of #100475 - chenyukang:fix-100461, r=fee1-dead
Michael Goulet [Sat, 13 Aug 2022 21:10:12 +0000 (14:10 -0700)]
Rollup merge of #100475 - chenyukang:fix-100461, r=fee1-dead

Give a helpful diagnostic when the next struct field has an attribute

Fixes #100461

23 months agoRollup merge of #100464 - khyperia:lld-icf-on-windows, r=jyn514
Michael Goulet [Sat, 13 Aug 2022 21:10:11 +0000 (14:10 -0700)]
Rollup merge of #100464 - khyperia:lld-icf-on-windows, r=jyn514

Make `[rust] use-lld=true` work on windows

Before, it would fail with "error: ignoring unknown argument '-Wl,--icf=all'"

This option was introduced in https://github.com/rust-lang/rust/pull/99062 (well, technically https://github.com/rust-lang/rust/pull/99680)

See zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/rust-lld.3A.20error.3A.20ignoring.20unknown.20argument.20'-Wl.2C--icf.3Dall'

23 months agoRollup merge of #100447 - GuillaumeGomez:rm-clean-impl, r=Dylan-DPC
Michael Goulet [Sat, 13 Aug 2022 21:10:10 +0000 (14:10 -0700)]
Rollup merge of #100447 - GuillaumeGomez:rm-clean-impl, r=Dylan-DPC

Remove more Clean trait implementations

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

r? ``@Dylan-DPC``

23 months agoRollup merge of #100445 - krasimirgg:llvm-16-msan, r=tmiasko
Michael Goulet [Sat, 13 Aug 2022 21:10:08 +0000 (14:10 -0700)]
Rollup merge of #100445 - krasimirgg:llvm-16-msan, r=tmiasko

adapt test for msan message change

LLVM commit https://github.com/llvm/llvm-project/commit/057cabd997aeaef136e1e14f2ee645bd5bb197dd removed the function from the msan error message. This adapts our test accordingly.

Found via our experimental rust + llvm @ HEAD bot:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12634#018289fe-b0bc-4bab-89b3-fb1d4e38f6db

23 months agoRollup merge of #100438 - compiler-errors:issue-100360, r=lcnr
Michael Goulet [Sat, 13 Aug 2022 21:10:07 +0000 (14:10 -0700)]
Rollup merge of #100438 - compiler-errors:issue-100360, r=lcnr

Erase regions better in `promote_candidate`

Use `tcx.erase_regions` instead of manually walking through the substs.... this also makes the code slightly simpler :see_no_evil:

Fixes #100360
Fixes #89851

23 months agoRollup merge of #100434 - compiler-errors:issue-100373, r=cjgillot
Michael Goulet [Sat, 13 Aug 2022 21:10:06 +0000 (14:10 -0700)]
Rollup merge of #100434 - compiler-errors:issue-100373, r=cjgillot

Fix HIR pretty printing of let else

Fixes #100373
Fixes #99318
Fixes #99319

23 months agoRollup merge of #100407 - RalfJung:no-int2ptr, r=Mark-Simulacrum
Michael Goulet [Sat, 13 Aug 2022 21:10:05 +0000 (14:10 -0700)]
Rollup merge of #100407 - RalfJung:no-int2ptr, r=Mark-Simulacrum

avoid some int2ptr casts in thread_local_key tests

23 months agoRollup merge of #100355 - camelid:has2-rename, r=GuillaumeGomez
Michael Goulet [Sat, 13 Aug 2022 21:10:04 +0000 (14:10 -0700)]
Rollup merge of #100355 - camelid:has2-rename, r=GuillaumeGomez

rustdoc: Rename `@has FILE PATTERN` to `@hasraw FILE PATTERN`

Fixes #100354.

23 months agowf correctly shallow_resolve consts
lcnr [Sat, 13 Aug 2022 11:49:11 +0000 (13:49 +0200)]
wf correctly shallow_resolve consts

23 months agomove
Ellen [Sat, 13 Aug 2022 18:42:25 +0000 (19:42 +0100)]
move

23 months agoDo not inline non-simple argument type errors into labels
Michael Goulet [Sat, 13 Aug 2022 05:44:20 +0000 (05:44 +0000)]
Do not inline non-simple argument type errors into labels

23 months agoLabel argument coercion errors
Michael Goulet [Sat, 13 Aug 2022 05:22:47 +0000 (05:22 +0000)]
Label argument coercion errors

23 months agonicer Miri backtraces for from_exposed_addr
Ralf Jung [Sat, 13 Aug 2022 16:55:43 +0000 (12:55 -0400)]
nicer Miri backtraces for from_exposed_addr

23 months agoupdate Miri
Ralf Jung [Sat, 13 Aug 2022 14:00:48 +0000 (10:00 -0400)]
update Miri

23 months agouse `span_suggestion` instead of `span_suggestion_verbose`
Takayuki Maeda [Sat, 13 Aug 2022 13:10:54 +0000 (22:10 +0900)]
use `span_suggestion` instead of `span_suggestion_verbose`

23 months agoAuto merge of #100380 - nicholasbishop:bishop-update-cb2, r=Mark-Simulacrum
bors [Sat, 13 Aug 2022 05:10:01 +0000 (05:10 +0000)]
Auto merge of #100380 - nicholasbishop:bishop-update-cb2, r=Mark-Simulacrum

Update compiler_builtins to 0.1.79

This pulls in a memcmp fix and some UEFI float-to-int fixes:
https://github.com/rust-lang/compiler-builtins/compare/0.1.78...0.1.79

23 months agorustdoc: Fix incorrect usage of `@!has` and `@!matches`
Noah Lev [Sat, 13 Aug 2022 04:56:16 +0000 (00:56 -0400)]
rustdoc: Fix incorrect usage of `@!has` and `@!matches`

`@!has` (and `@!matches`) with two arguments used to treat the second
argument as a literal string of HTML code. Now, that feature has been
renamed into `@!hasraw` (and `@!matchesraw`), and the arity-2 `@!has`
version is an error.

These uses thought the second argument was being treated as an XPath, as
with the arity-3 version, but in fact was being treated as literal HTML.
Because these were checking for the *absence* of the string, the tests
silently did nothing -- an XPath string won't ever be showing up in the
test's generated HTML!

23 months agoUpdate `@!has` name in tests
Noah Lev [Fri, 12 Aug 2022 04:44:07 +0000 (00:44 -0400)]
Update `@!has` name in tests

23 months agogive a helpful diagnostic even when the next struct field has an attribute
yukang [Sat, 13 Aug 2022 04:50:53 +0000 (12:50 +0800)]
give a helpful diagnostic even when the next struct field has an attribute

23 months agoFix line lengths
Noah Lev [Thu, 11 Aug 2022 15:09:48 +0000 (11:09 -0400)]
Fix line lengths

23 months agoRename `@hastext` to `@hasraw` (same for `matches`)
Noah Lev [Wed, 10 Aug 2022 20:13:18 +0000 (13:13 -0700)]
Rename `@hastext` to `@hasraw` (same for `matches`)

I think `@hasraw` is slightly clearer than `@hastext` since it is
actually matching against the raw HTML, not the text nodes.

23 months agoUpdate tests: arity-2 `@{has,matches}` -> `...text`
Noah Lev [Wed, 10 Aug 2022 20:10:04 +0000 (13:10 -0700)]
Update tests: arity-2 `@{has,matches}` -> `...text`

23 months agoRename `@{has,matches}-literal` to `...text`
Noah Lev [Wed, 10 Aug 2022 04:52:04 +0000 (21:52 -0700)]
Rename `@{has,matches}-literal` to `...text`

Reasons:
1. It's shorter.
2. `@matches-literal` seems to contradict itself: a regex is
   intrinsically not a literal match, while it is still a textual match.

23 months agoUse different name for arity-2 `@has` and `@matches`
Noah Lev [Wed, 10 Aug 2022 04:50:54 +0000 (21:50 -0700)]
Use different name for arity-2 `@has` and `@matches`

See #100354 for the rationale.

23 months agoAuto merge of #100341 - andrewpollack:fuchsia-llvm-libunwind, r=tmandry
bors [Sat, 13 Aug 2022 02:41:27 +0000 (02:41 +0000)]
Auto merge of #100341 - andrewpollack:fuchsia-llvm-libunwind, r=tmandry

Use llvm-libunwind="in-tree" for Fuchsia targets

With updates to Fuchsia CI's Zircon libraries #99833, we can introduce `llvm-libunwind="in-tree"` for Fuchsia targets. This PR restores functionality removed from https://github.com/rust-lang/rust/pull/93604#issuecomment-1136515651.

cc `@tmandry` `@djkoloski`

23 months agoAuto merge of #100324 - Mark-Simulacrum:bootstrap-bump, r=jyn514
bors [Sat, 13 Aug 2022 00:12:48 +0000 (00:12 +0000)]
Auto merge of #100324 - Mark-Simulacrum:bootstrap-bump, r=jyn514

Bump bootstrap compiler to 1.64

r? `@jyn514` perhaps?

23 months ago`assert_{inhabited,zero_valid,uninit_valid}` intrinsics are safe
Tomasz Miąsko [Sat, 13 Aug 2022 00:00:00 +0000 (00:00 +0000)]
`assert_{inhabited,zero_valid,uninit_valid}` intrinsics are safe

Those intrinsics either panic or do nothing. They are safe.

23 months agoUse an extensionless `x` script for non-Windows
Josh Stone [Fri, 12 Aug 2022 22:39:26 +0000 (15:39 -0700)]
Use an extensionless `x` script for non-Windows

23 months agoMake `[rust] use-lld=true` work on windows
khyperia [Fri, 12 Aug 2022 21:30:24 +0000 (23:30 +0200)]
Make `[rust] use-lld=true` work on windows

Before, it would fail with "error: ignoring unknown argument '-Wl,--icf=all'"

23 months agoApply changes from rustfmt bump
Mark Rousskov [Tue, 9 Aug 2022 14:16:52 +0000 (10:16 -0400)]
Apply changes from rustfmt bump

23 months agoAdjust cfgs
Mark Rousskov [Tue, 9 Aug 2022 13:56:13 +0000 (09:56 -0400)]
Adjust cfgs

23 months agoBump bootstrap compiler
Mark Rousskov [Tue, 9 Aug 2022 13:40:54 +0000 (09:40 -0400)]
Bump bootstrap compiler

23 months agoAuto merge of #100456 - Dylan-DPC:rollup-fn17z9f, r=Dylan-DPC
bors [Fri, 12 Aug 2022 16:32:24 +0000 (16:32 +0000)]
Auto merge of #100456 - Dylan-DPC:rollup-fn17z9f, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #100022 (Optimize thread ID generation)
 - #100030 (cleanup code w/ pointers in std a little)
 - #100229 (add -Zextra-const-ub-checks to enable more UB checking in const-eval)
 - #100247 (Generalize trait object generic param check to aliases.)
 - #100255 (Adding more verbose documentation for `std::fmt::Write`)
 - #100366 (errors: don't fail on broken primary translations)
 - #100396 (Suggest const and static for global variable)
 - #100409 (rustdoc: don't generate DOM element for operator)
 - #100443 (Add two let else regression tests)

Failed merges:

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

23 months agorustc_target: Update some old naming around self contained linking
Vadim Petrochenkov [Wed, 3 Aug 2022 22:43:17 +0000 (01:43 +0300)]
rustc_target: Update some old naming around self contained linking

The "fallback" naming pre-dates introduction of `-Clink-self-contained`

23 months agoAddress nit
Michael Goulet [Fri, 12 Aug 2022 15:35:27 +0000 (15:35 +0000)]
Address nit

23 months agoAdjust span of closure param
Michael Goulet [Sat, 23 Jul 2022 17:46:20 +0000 (17:46 +0000)]
Adjust span of closure param

23 months agoAnd for closures
Michael Goulet [Sat, 23 Jul 2022 17:43:21 +0000 (17:43 +0000)]
And for closures

23 months agoPoint out a single arg if we have a single arg incompatibility
Michael Goulet [Sat, 23 Jul 2022 17:17:19 +0000 (17:17 +0000)]
Point out a single arg if we have a single arg incompatibility

23 months agoCheck ctor for missing stability
Michael Goulet [Thu, 11 Aug 2022 22:25:16 +0000 (22:25 +0000)]
Check ctor for missing stability

23 months agoenum variant ctor inherits stability of variant
Michael Goulet [Thu, 11 Aug 2022 22:20:35 +0000 (22:20 +0000)]
enum variant ctor inherits stability of variant

23 months agoRollup merge of #100443 - est31:let_else_regression_tests, r=Mark-Simulacrum
Dylan DPC [Fri, 12 Aug 2022 15:09:18 +0000 (20:39 +0530)]
Rollup merge of #100443 - est31:let_else_regression_tests, r=Mark-Simulacrum

Add two let else regression tests

Adds a regression test for #94176, as it was fixed by #98574 but doesn't have a regression test. The PR also incorporates a commit from #94012 which added a test for an issue discovered in that PR.

Originally they have been part of #99291, but I've moved them out in the hopes of getting them merged more quickly, as that PR is already open since a month, and so that #99291 can focus on the drop order part of things.

Closes #94176
Closes #96961 -- dupe of #94176

23 months agoRollup merge of #100409 - jsha:highlight-lighter, r=GuillaumeGomez
Dylan DPC [Fri, 12 Aug 2022 15:09:17 +0000 (20:39 +0530)]
Rollup merge of #100409 - jsha:highlight-lighter, r=GuillaumeGomez

rustdoc: don't generate DOM element for operator

In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme.

Remove the styles for `.op` in ayu, and stop generating the `<span>`s.

This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction.

r? ``@GuillaumeGomez``

Demo: (warning - slow!) https://rustdoc.crud.net/jsha/highlight-lighter/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html

[1]:
https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html

23 months agoRollup merge of #100396 - chenyukang:fix-100394, r=petrochenkov
Dylan DPC [Fri, 12 Aug 2022 15:09:16 +0000 (20:39 +0530)]
Rollup merge of #100396 - chenyukang:fix-100394, r=petrochenkov

Suggest const and static for global variable

Fixing #100394

23 months agoRollup merge of #100366 - davidtwco:translation-never-fail, r=compiler-errors
Dylan DPC [Fri, 12 Aug 2022 15:09:14 +0000 (20:39 +0530)]
Rollup merge of #100366 - davidtwco:translation-never-fail, r=compiler-errors

errors: don't fail on broken primary translations

If a primary bundle doesn't contain a message then the fallback bundle is used. However, if the primary bundle's message is broken (e.g. it refers to a interpolated variable that the compiler isn't providing) then this would just result in a compiler panic. While there aren't any primary bundles right now, this is the type of issue that could come up once translation is further along.

r? ```@compiler-errors``` (since this comes out of a in-person discussion we had at RustConf)

23 months agoRollup merge of #100255 - thedanvail:issue-98861-fix, r=joshtriplett
Dylan DPC [Fri, 12 Aug 2022 15:09:13 +0000 (20:39 +0530)]
Rollup merge of #100255 - thedanvail:issue-98861-fix, r=joshtriplett

Adding more verbose documentation for `std::fmt::Write`

Attempts to address #98861

23 months agoRollup merge of #100247 - cjgillot:verify-dyn-trait-alias-defaults, r=lcnr
Dylan DPC [Fri, 12 Aug 2022 15:09:12 +0000 (20:39 +0530)]
Rollup merge of #100247 - cjgillot:verify-dyn-trait-alias-defaults, r=lcnr

Generalize trait object generic param check to aliases.

The current algorithm only checks that `Self` does not appear in defaults for traits.  This is not sufficient for trait aliases.
This PR moves the check to trait object elaboration, which sees through trait aliases.

Fixes https://github.com/rust-lang/rust/issues/82927.
Fixes https://github.com/rust-lang/rust/issues/84789.

23 months agoRollup merge of #100229 - RalfJung:extra-const-ub-checks, r=lcnr
Dylan DPC [Fri, 12 Aug 2022 15:09:11 +0000 (20:39 +0530)]
Rollup merge of #100229 - RalfJung:extra-const-ub-checks, r=lcnr

add -Zextra-const-ub-checks to enable more UB checking in const-eval

Cc https://github.com/rust-lang/rust/issues/99923
r? `@oli-obk`

23 months agoRollup merge of #100030 - WaffleLapkin:nice_pointer_sis, r=scottmcm
Dylan DPC [Fri, 12 Aug 2022 15:09:10 +0000 (20:39 +0530)]
Rollup merge of #100030 - WaffleLapkin:nice_pointer_sis, r=scottmcm

cleanup code w/ pointers in std a little

Use pointer methods (`byte_add`, `null_mut`, etc) to make code in std a little nicer.

23 months agoRollup merge of #100022 - joboet:faster_threadid, r=joshtriplett
Dylan DPC [Fri, 12 Aug 2022 15:09:09 +0000 (20:39 +0530)]
Rollup merge of #100022 - joboet:faster_threadid, r=joshtriplett

Optimize thread ID generation

By using atomics where available, thread IDs can be generated without locking while still enforcing uniqueness.

23 months agoAuto merge of #100328 - davidtwco:perf-implications, r=nnethercote
bors [Fri, 12 Aug 2022 13:51:26 +0000 (13:51 +0000)]
Auto merge of #100328 - davidtwco:perf-implications, r=nnethercote

passes: load `defined_lib_features` query less

Hopefully addresses the perf regressions from #99212 (see #99905).

Re-structure the stability checks for library features to avoid calling `defined_lib_features` for any more crates than necessary for each of the implications or local feature attributes that need validation.

r? `@ghost` (just checking perf at first)

23 months agofill-in tracking issue for `feature(iter_array_chunks)`
Maybe Waffle [Fri, 12 Aug 2022 10:58:14 +0000 (14:58 +0400)]
fill-in tracking issue for `feature(iter_array_chunks)`

23 months agoaddress review comments
Maybe Waffle [Fri, 12 Aug 2022 10:57:15 +0000 (14:57 +0400)]
address review comments

23 months agoAuto merge of #99624 - vincenzopalazzo:macros/unix_error, r=Amanieu
bors [Fri, 12 Aug 2022 09:49:55 +0000 (09:49 +0000)]
Auto merge of #99624 - vincenzopalazzo:macros/unix_error, r=Amanieu

promote debug_assert to assert when possible and useful

This PR fixed a very old issue https://github.com/rust-lang/rust/issues/94705 to clarify and improve the POSIX error checking, and some of the checks are skipped because can have no benefit, but I'm sure that this can open some interesting discussion.

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

cc: `@tavianator`
cc: `@cuviper`

23 months agoremove Clean trait implementation for hir::BareFnTy
Guillaume Gomez [Fri, 12 Aug 2022 09:40:39 +0000 (11:40 +0200)]
remove Clean trait implementation for hir::BareFnTy

23 months agoremove Clean trait implementation for hir::PathSegment
Guillaume Gomez [Fri, 12 Aug 2022 09:37:32 +0000 (11:37 +0200)]
remove Clean trait implementation for hir::PathSegment

23 months agosuggest removing a semicolon after impl/trait items
Takayuki Maeda [Fri, 12 Aug 2022 09:11:01 +0000 (18:11 +0900)]
suggest removing a semicolon after impl/trait items

23 months agoadapt test for msan message change
Krasimir Georgiev [Fri, 12 Aug 2022 08:57:18 +0000 (08:57 +0000)]
adapt test for msan message change

LLVM commit https://github.com/llvm/llvm-project/commit/057cabd997aeaef136e1e14f2ee645bd5bb197dd removed the function from the msan error message. This adapts our test accordingly.

Found via our experimental rust + llvm @ HEAD bot:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12634#018289fe-b0bc-4bab-89b3-fb1d4e38f6db

23 months agoAdd regression test for #94176
est31 [Fri, 15 Jul 2022 16:53:23 +0000 (18:53 +0200)]
Add regression test for #94176

23 months agolet-else: add a test for warnings on let-else with diverging tail
Cormac Relf [Tue, 15 Feb 2022 06:42:50 +0000 (17:42 +1100)]
let-else: add a test for warnings on let-else with diverging tail

23 months agoAuto merge of #100435 - ehuss:update-cargo, r=ehuss
bors [Fri, 12 Aug 2022 06:45:35 +0000 (06:45 +0000)]
Auto merge of #100435 - ehuss:update-cargo, r=ehuss

Update cargo

8 commits in ce40690a5e4e315d3dab0aae1eae69d0252c52ac..efd4ca3dc0b89929dc8c5f5c023d25978d76cb61
2022-08-09 22:32:17 +0000 to 2022-08-12 01:28:28 +0000
- Use `std::thread::scope` to replace crossbeam (rust-lang/cargo#10977)
- [docs] Remove extra "in" from `cargo-test.md` (rust-lang/cargo#10978)
- Enable two windows tests (rust-lang/cargo#10930)
- Improve error msg for get target runner (rust-lang/cargo#10968)
- Ensure rustc-echo-wrapper works with an overridden build.target-dir (rust-lang/cargo#10962)
- Switch back to `available_parallelism` (rust-lang/cargo#10969)
- Only override published resolver when the workspace is different (rust-lang/cargo#10961)
- Add `CARGO_LOG` to "Environment variables Cargo reads" (rust-lang/cargo#10967)

23 months agoErase regions better in promote_candidate
Michael Goulet [Fri, 12 Aug 2022 03:48:40 +0000 (03:48 +0000)]
Erase regions better in promote_candidate

23 months agoUpdate cargo
Eric Huss [Fri, 12 Aug 2022 03:03:43 +0000 (20:03 -0700)]
Update cargo

23 months agoAuto merge of #99464 - nikic:llvm-15, r=cuviper
bors [Fri, 12 Aug 2022 02:58:51 +0000 (02:58 +0000)]
Auto merge of #99464 - nikic:llvm-15, r=cuviper

Update to LLVM 15

For preliminary testing. Some LLVM 15 compatibility fixes were applied separately in #99512.

Release timeline:
 * LLVM 15 branched on Jul 26.
 * The final LLVM 15.0.0 release is scheduled for Sep 6.
 * Current nightly (1.65.0) is scheduled for Nov 3.

Changes in this PR (apart from the LLVM update):
 * Pass `--set llvm.allow-old-toolchain` for many Docker images. LLVM 16 will require GCC >= 7.1, while LLVM 15 still allows older compilers with an option. Specify the option for builders still using GCC 5.4. #95026 updated some of the used toolchains, but not all.
 * Use the `+atomics-32` target feature for thumbv6m.
 * Explicitly link libatomic when cross-compiling LLVM to 32-bit target.
 * Explicitly disable zstd support, to avoid libzstd.so dependency.

New LLVM patches ([commits](https://github.com/rust-lang/llvm-project/commits/rustc/15.0-2022-08-09)):
 * [rust-only] Fix ICE with GCC 5.4 (https://github.com/nikic/llvm-project/commit/15be58d7f0342b1da5af219bac8bd71d01da6dff)
 * [rust-only] Fix build with GCC 5.4 (https://github.com/nikic/llvm-project/commit/774edc10fa45229c2aa678f1bef8b4812dc0f76a)
 * ~~[rust-only] Fix build with GCC 5.2 (https://github.com/nikic/llvm-project/commit/1a6069a7bb35ace1e40d566035cbf7ed2fa3b1f7)~~
 * ~~[rust-only] Fix ICE with GCC 5.2 (https://github.com/nikic/llvm-project/commit/493081f2909206e0ed55af68a4058a76c0ad7a64)~~
 * ~~[rust-only] Fix build with GCC 5.2 (https://github.com/nikic/llvm-project/commit/0fc5979d738c3a1f9510fe2d62417f7d2af37817)~~
 * [backported] Addition of `+atomics` target feature (https://github.com/llvm/llvm-project/commit/57bdd9892d0eba5bdd25fc44799235be7b9f5153).
 * [backported] Revert compiler-rt change that broke powerpc (https://github.com/llvm/llvm-project/commit/9c68b43915fc1c9c0a07e935163ae8d638d7241b)
 * [awaiting backport] Fix RelLookupTableConverter on gnux32 (https://github.com/nikic/llvm-project/commit/639388a05f25772fb23eea5b1045e7df83bcfaa7 / https://github.com/llvm/llvm-project/issues/57021)

Tested images: dist-x86_64-linux, armhf-gnu, arm-android, dist-s390x-linux, dist-x86_64-illumos, dist-x86_64-freebsd, wasm32, dist-x86_64-musl, dist-various-1, dist-riscv64-linux, dist-mips-linux, dist-mipsel-linux, dist-powerpc-linux, dist-aarch64-linux, dist-x86_64-apple, x86_64-msvc-1, x86_64-msvc-2, dist-various-2, dist-arm-linux
Tested up to the usual ipv6 error: test-various, i686-gnu, x86_64-gnu-nopt

r? `@ghost`

23 months agoFix HIR pretty printing of let else
Michael Goulet [Fri, 12 Aug 2022 02:47:57 +0000 (02:47 +0000)]
Fix HIR pretty printing of let else

23 months agoAuto merge of #100419 - flip1995:clippyup, r=Manishearth
bors [Fri, 12 Aug 2022 00:12:51 +0000 (00:12 +0000)]
Auto merge of #100419 - flip1995:clippyup, r=Manishearth

Update Clippy

r? `@Manishearth`

23 months agorustdoc: don't generate DOM element for operator
Jacob Hoffman-Andrews [Thu, 11 Aug 2022 13:59:58 +0000 (06:59 -0700)]
rustdoc: don't generate DOM element for operator

In our source page highlighting, we were generating `<span class="op">`
tags for all "operators", including e.g. `<` `>` around generic
parameters, `*`, `&`. This contributed significantly to DOM size, but
we don't actually style `.op` except in the ayu theme.

Remove the styles for `.op` in ayu, and stop generating the `<span>`s.

This reduces DOM size of an example page[1] from 265,938 HTML elements
to 242,165 elements, a 9% reduction.

[1]:
https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html

23 months agoPatch lld for older toolchains
Josh Stone [Thu, 11 Aug 2022 22:51:59 +0000 (15:51 -0700)]
Patch lld for older toolchains

23 months agoAuto merge of #100426 - matthiaskrgr:rollup-0ks4dou, r=matthiaskrgr
bors [Thu, 11 Aug 2022 21:30:07 +0000 (21:30 +0000)]
Auto merge of #100426 - matthiaskrgr:rollup-0ks4dou, r=matthiaskrgr

Rollup of 13 pull requests

Successful merges:

 - #93896 (rustdoc: make item-infos dimmer on dark theme)
 - #99337 (rustdoc: simplify highlight.rs)
 - #99421 (add crt-static for android)
 - #99500 (Fix flags when using clang as linker for Fuchsia)
 - #99511 (make raw_eq precondition more restrictive)
 - #99992 (Add `x.sh` and `x.ps1` shell scripts)
 - #100112 (Fix test: chunks_mut_are_send_and_sync)
 - #100203 (provide correct size hint for unsupported platform `CommandArgs`)
 - #100307 (Fix #96847)
 - #100350 (Stringify non-shorthand visibility correctly)
 - #100374 (Improve crate selection on rustdoc search results page)
 - #100392 (Simplify visitors)
 - #100418 (Add stability attributes to BacktraceStatus variants)

Failed merges:

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

23 months agoSuggest path separator when a dot is used on a trait
León Orell Valerian Liehr [Wed, 10 Aug 2022 12:06:27 +0000 (14:06 +0200)]
Suggest path separator when a dot is used on a trait

23 months agoRollup merge of #100418 - tbodt:stabilize-backtrace, r=dtolnay
Matthias Krüger [Thu, 11 Aug 2022 20:53:10 +0000 (22:53 +0200)]
Rollup merge of #100418 - tbodt:stabilize-backtrace, r=dtolnay

Add stability attributes to BacktraceStatus variants

Fixes #100399

23 months agoRollup merge of #100392 - nnethercote:simplify-visitors, r=cjgillot
Matthias Krüger [Thu, 11 Aug 2022 20:53:08 +0000 (22:53 +0200)]
Rollup merge of #100392 - nnethercote:simplify-visitors, r=cjgillot

Simplify visitors

By removing some unused arguments.

r? `@cjgillot`

23 months agoRollup merge of #100374 - GuillaumeGomez:improve_rustdoc_search_results_page_crates_s...
Matthias Krüger [Thu, 11 Aug 2022 20:53:07 +0000 (22:53 +0200)]
Rollup merge of #100374 - GuillaumeGomez:improve_rustdoc_search_results_page_crates_selection, r=notriddle

Improve crate selection on rustdoc search results page

Take over of #98855 (screenshots and explanations are there).

You can test it [here](https://rustdoc.crud.net/imperio/improve_rustdoc_search_results_page_crates_selection/std/index.html?search=test).

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