]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoSplit out from_u32_unchecked from const_char_convert
est31 [Thu, 29 Sep 2022 12:23:47 +0000 (14:23 +0200)]
Split out from_u32_unchecked from const_char_convert

It relies on the Option::unwrap function which is not const-stable (yet).

21 months agoAuto merge of #102328 - cuviper:ibm-stack-probes, r=nagisa
bors [Thu, 29 Sep 2022 08:00:54 +0000 (08:00 +0000)]
Auto merge of #102328 - cuviper:ibm-stack-probes, r=nagisa

Enable inline stack probes on PowerPC and SystemZ

The LLVM PowerPC and SystemZ targets have both supported `"probe-stack"="inline-asm"` for longer than our current minimum LLVM 13 requirement, so we can turn this on for all `powerpc`, `powerpc64`, `powerpc64le`, and `s390x` targets in Rust. These are all tier-2 or lower, so CI does not run their tests, but I have confirmed that their `linux-gnu` variants do pass on RHEL.

cc #43241

21 months agoAuto merge of #102450 - JohnTitor:rollup-ahleg93, r=JohnTitor
bors [Thu, 29 Sep 2022 05:12:30 +0000 (05:12 +0000)]
Auto merge of #102450 - JohnTitor:rollup-ahleg93, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #98368 (Make `std::os::fd` public.)
 - #102085 (Code refactoring smart_resolve_report_errors)
 - #102351 (Improve E0585 help)
 - #102368 (Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`)
 - #102393 (Add regression test for issue 94923)
 - #102399 (Account for use of index-based lifetime names in print of binder)
 - #102416 (remove FIXME, improve documentation)
 - #102433 (env::temp_dir: fix a typo)

Failed merges:

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

21 months agoRollup merge of #102433 - RalfJung:temp-dir-typo, r=thomcc
Yuki Okushi [Thu, 29 Sep 2022 02:42:06 +0000 (11:42 +0900)]
Rollup merge of #102433 - RalfJung:temp-dir-typo, r=thomcc

env::temp_dir: fix a typo

21 months agoRollup merge of #102416 - lcnr:specialization-fixme, r=compiler-errors
Yuki Okushi [Thu, 29 Sep 2022 02:42:06 +0000 (11:42 +0900)]
Rollup merge of #102416 - lcnr:specialization-fixme, r=compiler-errors

remove FIXME, improve documentation

r? types

21 months agoRollup merge of #102399 - b-naber:binder-print-ice, r=lcnr
Yuki Okushi [Thu, 29 Sep 2022 02:42:06 +0000 (11:42 +0900)]
Rollup merge of #102399 - b-naber:binder-print-ice, r=lcnr

Account for use of index-based lifetime names in print of binder

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

r? ```@lcnr```

cc ```@steffahn```

21 months agoRollup merge of #102393 - Rageking8:add-regression-test-for-issue-94923, r=JohnTitor
Yuki Okushi [Thu, 29 Sep 2022 02:42:05 +0000 (11:42 +0900)]
Rollup merge of #102393 - Rageking8:add-regression-test-for-issue-94923, r=JohnTitor

Add regression test for issue 94923

Fixes #94923

21 months agoRollup merge of #102368 - beetrees:nano-niche, r=joshtriplett
Yuki Okushi [Thu, 29 Sep 2022 02:42:05 +0000 (11:42 +0900)]
Rollup merge of #102368 - beetrees:nano-niche, r=joshtriplett

Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`

As the nanoseconds fields is always between `0` and `(NANOS_PER_SEC - 1)` inclusive, use the `rustc_layout_scalar_valid_range` attributes to create a niche in the nanosecond field of `Duration` and `Timespec` (which is used to implement unix `SystemTime` and non-apple unix `Instant`; windows `Instant` is implemented with `Duration` and therefore will also benefit). This change has the benefit of making `Option<T>` the same size as `T` for the previously mentioned types. Also shrinks the nanoseconds field of `Timespec` to a `u32` as nanoseconds do not need the extra range of an `i64`, shrinking `Timespec` by 4 bytes on 32-bit platforms.

r? ```@joshtriplett```

21 months agoRollup merge of #102351 - Rageking8:improve-E0585, r=wesleywiser
Yuki Okushi [Thu, 29 Sep 2022 02:42:04 +0000 (11:42 +0900)]
Rollup merge of #102351 - Rageking8:improve-E0585, r=wesleywiser

Improve E0585 help

21 months agoRollup merge of #102085 - chenyukang:code-refactor, r=cjgillot
Yuki Okushi [Thu, 29 Sep 2022 02:42:03 +0000 (11:42 +0900)]
Rollup merge of #102085 - chenyukang:code-refactor, r=cjgillot

Code refactoring smart_resolve_report_errors

`smart_resolve_report_errors` https://github.com/rust-lang/rust/blob/4ecfdfac51b159f68fce608792affb34a70e6f73/compiler/rustc_resolve/src/late/diagnostics.rs#L143
is almost 600 lines of code, we should do some code refactoring.

21 months agoRollup merge of #98368 - sunfishcode:sunfishcode/std-os-fd, r=joshtriplett
Yuki Okushi [Thu, 29 Sep 2022 02:42:03 +0000 (11:42 +0900)]
Rollup merge of #98368 - sunfishcode:sunfishcode/std-os-fd, r=joshtriplett

Make `std::os::fd` public.

`std::os::fd` defines types like `OwnedFd` and `RawFd` and is common
between Unix and non-Unix platforms that share a basic file-descriptor
concept. Rust currently uses this internally to simplify its own code,
but it would be useful for external users in the same way, so make it
public.

This means that `OwnedFd` etc. will all appear in three places, for
example on unix platforms:
 - `std::os::fd::OwnedFd`
 - `std::os::unix::io::OwnedFd`
 - `std::os::unix::prelude::OwnedFd`

r? `````@joshtriplett`````

21 months agoAuto merge of #101833 - jyn514:cross-compile-compiler-builtins, r=Mark-Simulacrum
bors [Thu, 29 Sep 2022 02:28:50 +0000 (02:28 +0000)]
Auto merge of #101833 - jyn514:cross-compile-compiler-builtins, r=Mark-Simulacrum

Make the `c` feature for `compiler-builtins` an explicit opt-in

Its build script doesn't support cross-compilation. I tried fixing it, but the cc crate itself doesn't appear to support cross-compiling to windows either unless you use the -gnu toolchain:
```
  error occurred: Failed to find tool. Is `lib.exe` installed?
```

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

21 months agoAuto merge of #102384 - camelid:extrainfo, r=GuillaumeGomez
bors [Wed, 28 Sep 2022 22:15:28 +0000 (22:15 +0000)]
Auto merge of #102384 - camelid:extrainfo, r=GuillaumeGomez

rustdoc: Remove `clean::TraitWithExtraInfo` and queryify `is_notable_trait`

cc `@notriddle` `@GuillaumeGomez`

21 months agoenv::temp_dir: fix a typo
Ralf Jung [Wed, 28 Sep 2022 19:51:09 +0000 (21:51 +0200)]
env::temp_dir: fix a typo

21 months agoAuto merge of #100719 - CohenArthur:rust-safe-intrinsic-attribute, r=wesleywiser
bors [Wed, 28 Sep 2022 19:07:50 +0000 (19:07 +0000)]
Auto merge of #100719 - CohenArthur:rust-safe-intrinsic-attribute, r=wesleywiser

Add `#[rustc_safe_intrinsic]`

This PR adds the `#[rustc_safe_intrinsic]` attribute as mentionned on Zulip. The goal of this attribute is to avoid keeping a list of symbols as the source for stable intrinsics, and instead rely on an attribute. This is similar to `#[rustc_const_stable]` and `#[rustc_const_unstable]`, which among other things, are used to mark the constness of intrinsic functions.

21 months agoAdd a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`
beetrees [Wed, 14 Sep 2022 10:43:02 +0000 (11:43 +0100)]
Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`

21 months agoimprove E0585 help
Rageking8 [Tue, 27 Sep 2022 08:08:04 +0000 (16:08 +0800)]
improve E0585 help

21 months agoupdate fixme
lcnr [Wed, 28 Sep 2022 15:04:29 +0000 (17:04 +0200)]
update fixme

21 months agoAuto merge of #101454 - cjgillot:concat-binders, r=estebank
bors [Wed, 28 Sep 2022 14:42:55 +0000 (14:42 +0000)]
Auto merge of #101454 - cjgillot:concat-binders, r=estebank

Do not overwrite lifetime binders for another HirId.

This PR makes higher-ranked bounds in where clauses a bit more principled.
We used to conflate `for<'a> T: Trait` with `(for<'a> T): Trait`.
This PR separates both binders.

This caused issued with fn types, which have their own binder, causing us to overwrite the predicates's binders with `fn`'s binders, ICEing.

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

21 months agoAuto merge of #101619 - Xiretza:rustc_parse-session-diagnostics, r=davidtwco
bors [Wed, 28 Sep 2022 11:11:42 +0000 (11:11 +0000)]
Auto merge of #101619 - Xiretza:rustc_parse-session-diagnostics, r=davidtwco

Migrate more of rustc_parse to SessionDiagnostic

Still far from complete, but I thought I'd add a checkpoint here because rebasing was starting to get annoying.

21 months agoadd test
b-naber [Wed, 28 Sep 2022 10:31:19 +0000 (12:31 +0200)]
add test

21 months agoaccount for use of index-based lifetime names in print of binder
b-naber [Wed, 28 Sep 2022 10:31:08 +0000 (12:31 +0200)]
account for use of index-based lifetime names in print of binder

21 months agoadd regression test
Rageking8 [Wed, 28 Sep 2022 08:30:06 +0000 (16:30 +0800)]
add regression test

21 months agoMake the `c` feature for `compiler-builtins` opt-in instead of inferred
Joshua Nelson [Thu, 15 Sep 2022 00:33:00 +0000 (19:33 -0500)]
Make the `c` feature for `compiler-builtins` opt-in instead of inferred

The build script for `compiler_builtins` doesn't support cross-compilation. I tried fixing it, but the cc crate itself
doesn't appear to support cross-compiling to windows either unless you use the -gnu toolchain:
```
  error occurred: Failed to find tool. Is `lib.exe` installed?
```

Rather than trying to fix it or special-case the platforms without bugs,
make it opt-in instead of automatic.

21 months agoAuto merge of #102302 - nnethercote:more-lexer-improvements, r=matklad
bors [Wed, 28 Sep 2022 08:14:04 +0000 (08:14 +0000)]
Auto merge of #102302 - nnethercote:more-lexer-improvements, r=matklad

More lexer improvements

A follow-up to #99884.

r? `@matklad`

21 months agorustc_safe_intrinsic: Add UI test
Arthur Cohen [Tue, 27 Sep 2022 05:22:07 +0000 (07:22 +0200)]
rustc_safe_intrinsic: Add UI test

21 months agorustc_safe_intrinsic: Keep list of safe intrinsics within the compiler
Arthur Cohen [Fri, 9 Sep 2022 14:38:33 +0000 (16:38 +0200)]
rustc_safe_intrinsic: Keep list of safe intrinsics within the compiler

21 months agoAuto merge of #102388 - JohnTitor:rollup-mbyw6fl, r=JohnTitor
bors [Wed, 28 Sep 2022 04:18:19 +0000 (04:18 +0000)]
Auto merge of #102388 - JohnTitor:rollup-mbyw6fl, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #100747 (Add long description and test for E0311)
 - #102232 (Stabilize bench_black_box)
 - #102288 (Suggest unwrapping `???<T>` if a method cannot be found on it but is present on `T`.)
 - #102338 (Deny associated type bindings within associated type bindings)
 - #102347 (Unescaping cleanups)
 - #102348 (Tweak `FulfillProcessor`.)
 - #102378 (Use already resolved `self_ty` in `confirm_fn_pointer_candidate`)
 - #102380 (rustdoc: remove redundant mobile `.source > .sidebar` CSS)

Failed merges:

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

21 months agoRollup merge of #102380 - notriddle:notriddle/rustdoc-source-sidebar, r=camelid
Yuki Okushi [Wed, 28 Sep 2022 04:07:20 +0000 (13:07 +0900)]
Rollup merge of #102380 - notriddle:notriddle/rustdoc-source-sidebar, r=camelid

rustdoc: remove redundant mobile `.source > .sidebar` CSS

When the source sidebar and standard sidebar had most of their code merged in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114, the properties `z-index: 11`, `margin: 0`, and `position: fixed` were already being set on the `.sidebar` class, so no need to repeat them.

https://github.com/rust-lang/rust/blob/57ee5cf5a93923dae9c98bffb11545fc3a31368d/src/librustdoc/html/static/css/rustdoc.css#L1742-L1754

21 months agoRollup merge of #102378 - compiler-errors:issue-102289, r=jackh726
Yuki Okushi [Wed, 28 Sep 2022 04:07:20 +0000 (13:07 +0900)]
Rollup merge of #102378 - compiler-errors:issue-102289, r=jackh726

Use already resolved `self_ty` in `confirm_fn_pointer_candidate`

Fixes #102289

21 months agoRollup merge of #102348 - nnethercote:tweak-FulfillProcessor, r=jackh726
Yuki Okushi [Wed, 28 Sep 2022 04:07:19 +0000 (13:07 +0900)]
Rollup merge of #102348 - nnethercote:tweak-FulfillProcessor, r=jackh726

Tweak `FulfillProcessor`.

Avoids some unnecessary references and lifetimes.

r? `@jackh726`

21 months agoRollup merge of #102347 - nnethercote:unescaping-cleanups, r=matklad
Yuki Okushi [Wed, 28 Sep 2022 04:07:18 +0000 (13:07 +0900)]
Rollup merge of #102347 - nnethercote:unescaping-cleanups, r=matklad

Unescaping cleanups

Some minor improvements.

r? `@matklad`

21 months agoRollup merge of #102338 - compiler-errors:assoc-ty-binding-in-assoc-ty-binding, r...
Yuki Okushi [Wed, 28 Sep 2022 04:07:18 +0000 (13:07 +0900)]
Rollup merge of #102338 - compiler-errors:assoc-ty-binding-in-assoc-ty-binding, r=cjgillot

Deny associated type bindings within associated type bindings

Fixes #102335

This was made worse by #100865, which unified the way we generate substs for GATs and non-generic associated types. However, the issue was not _caused_ by #100865, evidenced by the test I added for GATs:

```rust
trait T {
    type A: S<C<(), i32 = ()> = ()>;
    //~^ ERROR associated type bindings are not allowed here
}

trait Q {}

trait S {
    type C<T>: Q;
}

fn main() {}
```

^ which passes on beta (where GATs are stable) and presumably ever since GATs support was added to `create_substs_for_associated_item` in astconv.

21 months agoRollup merge of #102288 - mejrs:inner, r=compiler-errors
Yuki Okushi [Wed, 28 Sep 2022 04:07:17 +0000 (13:07 +0900)]
Rollup merge of #102288 - mejrs:inner, r=compiler-errors

Suggest unwrapping `???<T>` if a method cannot be found on it but is present on `T`.

This suggests various ways to get inside wrapper types if the method cannot be found on the wrapper type, but is present on the wrappee.

For this PR, those wrapper types include `Localkey`, `MaybeUninit`, `RefCell`, `RwLock` and `Mutex`.

21 months agoRollup merge of #102232 - Urgau:stabilize-bench_black_box, r=TaKO8Ki
Yuki Okushi [Wed, 28 Sep 2022 04:07:17 +0000 (13:07 +0900)]
Rollup merge of #102232 - Urgau:stabilize-bench_black_box, r=TaKO8Ki

Stabilize bench_black_box

This PR stabilize `feature(bench_black_box)`.

```rust
pub fn black_box<T>(dummy: T) -> T;
```

The FCP was completed in https://github.com/rust-lang/rust/issues/64102.

`@rustbot` label +T-libs-api -T-libs

21 months agoRollup merge of #100747 - MatthewPeterKelly:mpk/add-long-error-message-for-E0311...
Yuki Okushi [Wed, 28 Sep 2022 04:07:16 +0000 (13:07 +0900)]
Rollup merge of #100747 - MatthewPeterKelly:mpk/add-long-error-message-for-E0311, r=MatthewPeterKelly

Add long description and test for E0311

Adds a long description and unit test for the E0311 compiler error.

Fixes one line-item in https://github.com/rust-lang/rust/issues/61137.

21 months agoAuto merge of #100996 - m-ou-se:format-args-2, r=estebank
bors [Wed, 28 Sep 2022 01:36:28 +0000 (01:36 +0000)]
Auto merge of #100996 - m-ou-se:format-args-2, r=estebank

Rewrite and refactor format_args!() builtin macro.

This is a near complete rewrite of `compiler/rustc_builtin_macros/src/format.rs`.

This gets rid of the massive unmaintanable [`Context` struct](https://github.com/rust-lang/rust/blob/76531befc4b0352247ada67bd225e8cf71ee5686/compiler/rustc_builtin_macros/src/format.rs#L176-L263), and splits the macro expansion into three parts:

1. First, `parse_args` will parse the `(literal, arg, arg, name=arg, name=arg)` syntax, but doesn't parse the template (the literal) itself.
2. Second, `make_format_args` will parse the template, the format options, resolve argument references, produce diagnostics, and turn the whole thing into a `FormatArgs` structure.
3. Finally, `expand_parsed_format_args` will turn that `FormatArgs` structure into the expression that the macro expands to.

In other words, the `format_args` builtin macro used to be a hard-to-maintain 'single pass compiler', which I've split into a three phase compiler with a parser/tokenizer (step 1), semantic analysis (step 2), and backend (step 3). (It's compilers all the way down. ^^)

This can serve as a great starting point for https://github.com/rust-lang/rust/issues/99012, which will only need to change the implementation of 3, while leaving step 1 and 2 unchanged.

It also makes https://github.com/rust-lang/compiler-team/issues/541 easier, which could then upgrade the new `FormatArgs` struct to an `ast` node and remove step 3, moving that step to later in the compilation process.

It also fixes a few diagnostics bugs.

This also [significantly reduces](https://gist.github.com/m-ou-se/b67b2d54172c4837a5ab1b26fa3e5284) the amount of generated code for cases with arguments in non-default order without formatting options, like `"{1} {0}"` or `"{a} {}"`, etc.

21 months agoAddress review comments.
Nicholas Nethercote [Wed, 28 Sep 2022 00:28:36 +0000 (10:28 +1000)]
Address review comments.

21 months agorustdoc: Queryify `is_notable_trait`
Noah Lev [Wed, 28 Sep 2022 00:06:38 +0000 (17:06 -0700)]
rustdoc: Queryify `is_notable_trait`

This might help with #102375.

21 months agoDeduplicate some logic
mejrs [Wed, 28 Sep 2022 00:36:58 +0000 (02:36 +0200)]
Deduplicate some logic

21 months agoreview updates
Matthew Kelly [Tue, 27 Sep 2022 23:23:59 +0000 (19:23 -0400)]
review updates

21 months agoAuto merge of #102377 - matthiaskrgr:rollup-1zvj50t, r=matthiaskrgr
bors [Tue, 27 Sep 2022 22:41:47 +0000 (22:41 +0000)]
Auto merge of #102377 - matthiaskrgr:rollup-1zvj50t, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #101555 (Stabilize `#![feature(mixed_integer_ops)]`)
 - #102253 (rustdoc: use CSS containment to speed up render)
 - #102281 (make invalid_value lint a bit smarter around enums)
 - #102284 (Structured suggestion for missing `mut`/`const` in raw pointer)
 - #102330 (rustdoc: remove no-op CSS `.srclink { font-weight; font-size }`)
 - #102337 (Avoid LLVM-deprecated `Optional::hasValue`)
 - #102356 (session: remove now-unnecessary lint `#[allow]`s)
 - #102367 (rustdoc: remove redundant `#help-button` CSS)
 - #102369 (Fix search result colors)

Failed merges:

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

21 months agoSmall cleanups in unescaping code.
Nicholas Nethercote [Tue, 27 Sep 2022 06:32:22 +0000 (16:32 +1000)]
Small cleanups in unescaping code.

- Rename `unescape_raw_str_or_raw_byte_str` as
  `unescape_raw_str_or_byte_str`, which is more accurate.
- Remove the unused `Mode::in_single_quotes` method.
- Make some assertions more precise, and add a missing one to
  `unescape_char_or_byte`.
- Change all the assertions to `debug_assert!`, because this code is
  reasonably hot, and the assertions aren't required for memory safety,
  and any violations are likely to be sufficiently obvious that normal
  tests will trigger them.

21 months agorustdoc: remove redundant mobile `.source > .sidebar` CSS
Michael Howell [Tue, 27 Sep 2022 21:25:48 +0000 (14:25 -0700)]
rustdoc: remove redundant mobile `.source > .sidebar` CSS

When the source sidebar and standard sidebar had most of their code merged in
07e3f998b1ceb4b8d2a7992782e60f5e776aa114, the properties `z-index: 11`,
`margin: 0`, and `position: fixed` were already being set on the `.sidebar`
class, so no need to repeat them.

21 months agoAdd newline
mejrs [Tue, 27 Sep 2022 21:12:52 +0000 (23:12 +0200)]
Add newline

21 months agoUse already resolved self_ty in confirm_fn_pointer_candidate
Michael Goulet [Tue, 27 Sep 2022 20:00:24 +0000 (20:00 +0000)]
Use already resolved self_ty in confirm_fn_pointer_candidate

21 months agoAuto merge of #102365 - weihanglo:update-cargo, r=ehuss
bors [Tue, 27 Sep 2022 19:42:46 +0000 (19:42 +0000)]
Auto merge of #102365 - weihanglo:update-cargo, r=ehuss

Update cargo

22 commits in 73ba3f35e0205844418260722c11602113179c4a..f5fed93ba24607980647962c59863bbabb03ce14 2022-09-18 06:38:16 +0000 to 2022-09-27 12:03:57 +0000

- build-scripts.md: Use em dash consistently. (rust-lang/cargo#11150)
- Indicate how Cargo locates the manifest (rust-lang/cargo#10770)
- Reduce references to `[project]` within cargo (rust-lang/cargo#11135)
- Iteratively construct target cfg (rust-lang/cargo#11114)
- update comment about `CARGO_BIN_EXE_` (rust-lang/cargo#11146)
- Call out that not all config values can be set via env vars (rust-lang/cargo#11139)
- Bump to 0.67.0, update changelog (rust-lang/cargo#11137)
- ci: update toolchain for building api doc (rust-lang/cargo#11134)
- Http publish not noop (rust-lang/cargo#11111)
- Improve errors for TOML fields that support workspace inheritance (rust-lang/cargo#11113)
- switch to `std::task::ready!()` where possible (rust-lang/cargo#11130)
- Report cmd aliasing failure with more contexts (rust-lang/cargo#11087)
- minor: remove unused mut (rust-lang/cargo#11127)
- fix(cli): Forward non-UTF8 arguments to external subcommands (rust-lang/cargo#11118)
- This change adds an example to the authors attribute in the manifest. (rust-lang/cargo#10938)
- Add support for relative git submodule paths (rust-lang/cargo#11106)
- make unknown features on `cargo add` more discoverable (rust-lang/cargo#11098)
- Unlink old final artifacts before compilation (rust-lang/cargo#11122)
- refactor(cli): Prepare for clap v4 (rust-lang/cargo#11116)
- fix(cli): Error trailing args rather than ignore (rust-lang/cargo#11119)
- Add a minor clarification (rust-lang/cargo#11093)
- doc(changelog): mention CVE fixes (rust-lang/cargo#11104)

21 months agoRollup merge of #102369 - GuillaumeGomez:results-colors, r=notriddle
Matthias Krüger [Tue, 27 Sep 2022 19:42:25 +0000 (21:42 +0200)]
Rollup merge of #102369 - GuillaumeGomez:results-colors, r=notriddle

Fix search result colors

Fixes regression introduced in https://github.com/rust-lang/rust/commit/99c00714cff0d13b6c5092c9949cb4e93a121346.

As you can see, ayu lost some colors for its search results:

beta/nightly:
![Screenshot from 2022-09-27 19-46-49](https://user-images.githubusercontent.com/3050060/192606456-e7bb58dd-cf76-49a0-b1ae-28565adb1dc6.png)

stable:
![Screenshot from 2022-09-27 19-46-36](https://user-images.githubusercontent.com/3050060/192606453-e720e219-a336-4ff1-989b-2fdb76e789eb.png)

We'll need to backport it to beta too to prevent it reaching stable.

r? `@notriddle`

21 months agoRollup merge of #102367 - notriddle:notriddle/help-text-align, r=GuillaumeGomez
Matthias Krüger [Tue, 27 Sep 2022 19:42:25 +0000 (21:42 +0200)]
Rollup merge of #102367 - notriddle:notriddle/help-text-align, r=GuillaumeGomez

rustdoc: remove redundant `#help-button` CSS

When the separate top and bottom styles were added in cd3f4da244578a2ab4d17d10016c61b9191b21e4, some of the CSS rules were needlessly duplicated.

The `text-align: initial` rule on `.side-by-side` was always redundant, since the rules that centered the text were set on children, not parents.

21 months agoRollup merge of #102356 - davidtwco:translation-bootstrap-bump-allow-lint, r=lcnr
Matthias Krüger [Tue, 27 Sep 2022 19:42:24 +0000 (21:42 +0200)]
Rollup merge of #102356 - davidtwco:translation-bootstrap-bump-allow-lint, r=lcnr

session: remove now-unnecessary lint `#[allow]`s

In #101230, the internal diagnostic migration lints - `diagnostic_outside_of_impl` and `untranslatable_diagnostic` - were modified so that they wouldn't trigger on functions annotated with `#[rustc_lint_diagnostics]`. However, this change has to make it into the bootstrap compiler before the `#[allow]` annotations that it aims to remove can be removed, which is possible now that #102051 has landed.

21 months agoRollup merge of #102337 - cuviper:llvm-optional-bool, r=nikic
Matthias Krüger [Tue, 27 Sep 2022 19:42:24 +0000 (21:42 +0200)]
Rollup merge of #102337 - cuviper:llvm-optional-bool, r=nikic

Avoid LLVM-deprecated `Optional::hasValue`

LLVM 15 added `Optional::has_value`, and LLVM `main` (16) has deprecated
`hasValue`. However, its `explicit operator bool` does the same thing,
and was added long ago, so we can use that across our full LLVM range of
compatibility.

21 months agoRollup merge of #102330 - notriddle:notriddle/srclink, r=GuillaumeGomez
Matthias Krüger [Tue, 27 Sep 2022 19:42:23 +0000 (21:42 +0200)]
Rollup merge of #102330 - notriddle:notriddle/srclink, r=GuillaumeGomez

rustdoc: remove no-op CSS `.srclink { font-weight; font-size }`

When this CSS was added in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9, source links were nested below headers.

https://github.com/rust-lang/rust/blob/34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9/src/librustdoc/html/render.rs#L4015-L4019

Now, thanks to 458e7219bc2a62f72368279945cfda632a016da1, they are now siblings of headers, and thanks to 270d09dca9aae263671c4d32bbc7cb60dc378af8, they have the same font size that they would've had anyway.

21 months agoRollup merge of #102284 - compiler-errors:missing-type-in-raw-ptr, r=davidtwco
Matthias Krüger [Tue, 27 Sep 2022 19:42:23 +0000 (21:42 +0200)]
Rollup merge of #102284 - compiler-errors:missing-type-in-raw-ptr, r=davidtwco

Structured suggestion for missing `mut`/`const` in raw pointer

Fixes #102261

21 months agoRollup merge of #102281 - RalfJung:invalid-enums, r=cjgillot
Matthias Krüger [Tue, 27 Sep 2022 19:42:22 +0000 (21:42 +0200)]
Rollup merge of #102281 - RalfJung:invalid-enums, r=cjgillot

make invalid_value lint a bit smarter around enums

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

21 months agoRollup merge of #102253 - jsha:css-contain, r=notriddle
Matthias Krüger [Tue, 27 Sep 2022 19:42:22 +0000 (21:42 +0200)]
Rollup merge of #102253 - jsha:css-contain, r=notriddle

rustdoc: use CSS containment to speed up render

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Containment

This affected layout a little and required adjustments to the CSS to keep spacing the same. In particular, the margins of adjacent items usually overlap with each other. However, when an item has contain: layout, any margins of child nodes push out the size of the item itself. This was making spacing between items a little too big. To solve that, I removed margins in some places: in particular for certain classes that often occur at the end of a `details.rustdoc-toggle` block, I removed their bottom margin. Generally, the margins provided by the next item down are sufficient.

Also remove an unnecessary margin-top on .code-header.

In particular this helps with the problem that rustdoc in some situations can generate giant HTML pages, which can crash a Chrome tab on typical modern hardware, for instance: `https://docs.rs/iced-x86/1.16.0/iced_x86/code_asm/struct.CodeAssembler.html` (26MB, 409k DOM nodes). This doesn't, of course, universally solve the problem, but it pushes out the boundary of the largest page rustdoc can produce without crashing a browser tab.

Demos:

https://rustdoc.crud.net/jsha/css-contain/std/string/struct.String.html
(warning: giant page, _may_ crash a browser tab) https://rustdoc.crud.net/jsha/css-contain-icedx86/iced_x86/code_asm/struct.CodeAssembler.html

r? `@notriddle`

21 months agoRollup merge of #101555 - jhpratt:stabilize-mixed_integer_ops, r=joshtriplett
Matthias Krüger [Tue, 27 Sep 2022 19:42:21 +0000 (21:42 +0200)]
Rollup merge of #101555 - jhpratt:stabilize-mixed_integer_ops, r=joshtriplett

Stabilize `#![feature(mixed_integer_ops)]`

Tracked and FCP completed in #87840.

````@rustbot```` label +T-libs-api +S-waiting-on-review +relnotes

r? rust-lang/t-libs-api

21 months agoAddress feedback
mejrs [Tue, 27 Sep 2022 11:06:31 +0000 (13:06 +0200)]
Address feedback

21 months agoWrapper suggestions
mejrs [Sun, 25 Sep 2022 22:55:35 +0000 (00:55 +0200)]
Wrapper suggestions

21 months agorustdoc: remove `clean::TraitWithExtraInfo`
Michael Howell [Tue, 27 Sep 2022 19:27:04 +0000 (12:27 -0700)]
rustdoc: remove `clean::TraitWithExtraInfo`

Instead, it gathers the extra info later, when it's actually requested.

21 months agoBless stats.
Camille GILLOT [Tue, 27 Sep 2022 18:29:24 +0000 (20:29 +0200)]
Bless stats.

21 months agoImplement IntoDiagnosticArg for rustc_ast::token::Token(Kind)
Xiretza [Thu, 22 Sep 2022 16:39:17 +0000 (18:39 +0200)]
Implement IntoDiagnosticArg for rustc_ast::token::Token(Kind)

21 months agoDon't unnecessarily stringify paths in diagnostics
Xiretza [Wed, 14 Sep 2022 18:11:42 +0000 (20:11 +0200)]
Don't unnecessarily stringify paths in diagnostics

21 months agoDocument use of Symbol::to_string()
Xiretza [Wed, 14 Sep 2022 16:35:22 +0000 (18:35 +0200)]
Document use of Symbol::to_string()

21 months agoMigrate even more diagnostics in rustc_parse to diagnostic structs
Xiretza [Thu, 8 Sep 2022 16:23:31 +0000 (18:23 +0200)]
Migrate even more diagnostics in rustc_parse to diagnostic structs

21 months agoMigrate "struct literal body without path" error to diagnostic struct
Xiretza [Sun, 4 Sep 2022 18:19:49 +0000 (20:19 +0200)]
Migrate "struct literal body without path" error to diagnostic struct

21 months agoMigrate "expected semicolon" diagnostics to diagnostic structs
Xiretza [Sun, 4 Sep 2022 18:12:00 +0000 (20:12 +0200)]
Migrate "expected semicolon" diagnostics to diagnostic structs

21 months agoMigrate "expected identifier" diagnostics to diagnostic structs
Xiretza [Sun, 4 Sep 2022 08:14:00 +0000 (10:14 +0200)]
Migrate "expected identifier" diagnostics to diagnostic structs

21 months agoRework "inner attribute not permitted" errors
Xiretza [Wed, 31 Aug 2022 11:20:59 +0000 (13:20 +0200)]
Rework "inner attribute not permitted" errors

21 months agoRemove error condition in parse_attribute
Xiretza [Thu, 1 Sep 2022 17:29:59 +0000 (19:29 +0200)]
Remove error condition in parse_attribute

This function is only ever called when the `#` has already been
consumed, no need to produce an error message here.

21 months agoMigrate more rustc_parse diagnostics to diagnostic structs
Xiretza [Thu, 1 Sep 2022 17:29:23 +0000 (19:29 +0200)]
Migrate more rustc_parse diagnostics to diagnostic structs

21 months agoMove rustc_parse diagnostic structs to separate module
Xiretza [Tue, 30 Aug 2022 11:19:17 +0000 (13:19 +0200)]
Move rustc_parse diagnostic structs to separate module

21 months agoMigrate "invalid literal suffix" diagnostic to diagnostic structs
Xiretza [Thu, 15 Sep 2022 08:12:09 +0000 (10:12 +0200)]
Migrate "invalid literal suffix" diagnostic to diagnostic structs

21 months agoMigrate more diagnostics in rustc_parse to diagnostic structs
Xiretza [Wed, 24 Aug 2022 20:41:51 +0000 (22:41 +0200)]
Migrate more diagnostics in rustc_parse to diagnostic structs

21 months agoAllow raw identifiers to be used as fluent arguments
Xiretza [Wed, 14 Sep 2022 18:12:22 +0000 (20:12 +0200)]
Allow raw identifiers to be used as fluent arguments

21 months agoImplement IntoDiagnosticArg for rustc_ast::Path
Xiretza [Wed, 14 Sep 2022 17:22:20 +0000 (19:22 +0200)]
Implement IntoDiagnosticArg for rustc_ast::Path

21 months agoMigrate rustc_session::expr_parentheses_needed to Subdiagnostic struct
Xiretza [Thu, 25 Aug 2022 08:58:53 +0000 (10:58 +0200)]
Migrate rustc_session::expr_parentheses_needed to Subdiagnostic struct

21 months agoAdd GUI regression test for search results colors
Guillaume Gomez [Tue, 27 Sep 2022 18:23:00 +0000 (20:23 +0200)]
Add GUI regression test for search results colors

21 months agoFix regression for results colors
Guillaume Gomez [Tue, 27 Sep 2022 18:22:46 +0000 (20:22 +0200)]
Fix regression for results colors

21 months agorustdoc: remove redundant `#help-button` CSS
Michael Howell [Tue, 27 Sep 2022 17:52:08 +0000 (10:52 -0700)]
rustdoc: remove redundant `#help-button` CSS

When the separate top and bottom styles were added in
cd3f4da244578a2ab4d17d10016c61b9191b21e4, some of the CSS rules were
needlessly duplicated.

The `text-align: initial` rule on `.side-by-side` was always redundant, since
the rules that centered the text were set on children, not parents.

21 months agoUpdate src/test/rustdoc-gui/sidebar-mobile-scroll.goml
Jacob Hoffman-Andrews [Tue, 27 Sep 2022 17:25:25 +0000 (10:25 -0700)]
Update src/test/rustdoc-gui/sidebar-mobile-scroll.goml

Co-authored-by: Michael Howell <michael@notriddle.com>
21 months agoDeny associated type bindings within associated type bindings
Michael Goulet [Tue, 27 Sep 2022 00:45:50 +0000 (00:45 +0000)]
Deny associated type bindings within associated type bindings

21 months agoDo not overwrite binders for another HirId.
Camille GILLOT [Mon, 5 Sep 2022 15:21:19 +0000 (17:21 +0200)]
Do not overwrite binders for another HirId.

21 months agoUpdate cargo
Weihang Lo [Tue, 27 Sep 2022 16:46:34 +0000 (17:46 +0100)]
Update cargo

22 commits in 73ba3f35e0205844418260722c11602113179c4a..f5fed93ba24607980647962c59863bbabb03ce14
2022-09-18 06:38:16 +0000 to 2022-09-27 12:03:57 +0000

- build-scripts.md: Use em dash consistently. (rust-lang/cargo#11150)
- Indicate how Cargo locates the manifest (rust-lang/cargo#10770)
- Reduce references to `[project]` within cargo (rust-lang/cargo#11135)
- Iteratively construct target cfg (rust-lang/cargo#11114)
- update comment about `CARGO_BIN_EXE_` (rust-lang/cargo#11146)
- Call out that not all config values can be set via env vars (rust-lang/cargo#11139)
- Bump to 0.67.0, update changelog (rust-lang/cargo#11137)
- ci: update toolchain for building api doc (rust-lang/cargo#11134)
- Http publish not noop (rust-lang/cargo#11111)
- Improve errors for TOML fields that support workspace inheritance (rust-lang/cargo#11113)
- switch to `std::task::ready!()` where possible (rust-lang/cargo#11130)
- Report cmd aliasing failure with more contexts (rust-lang/cargo#11087)
- minor: remove unused mut (rust-lang/cargo#11127)
- fix(cli): Forward non-UTF8 arguments to external subcommands (rust-lang/cargo#11118)
- This change adds an example to the authors attribute in the manifest. (rust-lang/cargo#10938)
- Add support for relative git submodule paths (rust-lang/cargo#11106)
- make unknown features on `cargo add` more discoverable (rust-lang/cargo#11098)
- Unlink old final artifacts before compilation (rust-lang/cargo#11122)
- refactor(cli): Prepare for clap v4 (rust-lang/cargo#11116)
- fix(cli): Error trailing args rather than ignore (rust-lang/cargo#11119)
- Add a minor clarification (rust-lang/cargo#11093)
- doc(changelog): mention CVE fixes (rust-lang/cargo#11104)

21 months agorustdoc: use CSS containment to speed up render
Jacob Hoffman-Andrews [Tue, 27 Sep 2022 16:21:24 +0000 (09:21 -0700)]
rustdoc: use CSS containment to speed up render

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Containment

This affected layout a little and required adjustments to the CSS to
keep spacing the same. In particular, the margins of adjacent items
usually overlap with each other. However, when an item has contain:
layout, any margins of child nodes push out the size of the item itself.
This was making spacing between items a little too big. To solve that, I
removed margins in some places: in particular for certain classes that
often occur at the end of a `details.rustdoc-toggle` block, I removed
their bottom margin. Generally, the margins provided by the next item
down are sufficient.

Also remove an unnecessary margin-top on .code-header.

21 months agoStabilize bench_black_box
Urgau [Sat, 24 Sep 2022 10:34:56 +0000 (12:34 +0200)]
Stabilize bench_black_box

21 months agoalso query type_uninhabited_from
Ralf Jung [Tue, 27 Sep 2022 13:59:10 +0000 (15:59 +0200)]
also query type_uninhabited_from

21 months agocore: Mark all safe intrinsics with #[rustc_safe_intrinsic]
Arthur Cohen [Thu, 18 Aug 2022 09:15:26 +0000 (11:15 +0200)]
core: Mark all safe intrinsics with #[rustc_safe_intrinsic]

21 months agoattributes: Add #[rustc_safe_intrinsic] builtin
Arthur Cohen [Wed, 17 Aug 2022 11:43:59 +0000 (13:43 +0200)]
attributes: Add #[rustc_safe_intrinsic] builtin

21 months agoRemove confusing drop.
Mara Bos [Tue, 6 Sep 2022 21:19:20 +0000 (23:19 +0200)]
Remove confusing drop.

21 months agoUpdate doc comments.
Mara Bos [Tue, 6 Sep 2022 21:15:44 +0000 (23:15 +0200)]
Update doc comments.

21 months agoTurn format arguments Vec into its own struct.
Mara Bos [Tue, 6 Sep 2022 21:15:13 +0000 (23:15 +0200)]
Turn format arguments Vec into its own struct.

With efficient lookup through a hash map.

21 months agoUpdate test.
Mara Bos [Tue, 6 Sep 2022 21:08:27 +0000 (23:08 +0200)]
Update test.

21 months agoAdd clarifying comments.
Mara Bos [Tue, 30 Aug 2022 15:26:50 +0000 (17:26 +0200)]
Add clarifying comments.

21 months agoFlatten if-let and match into one.
Mara Bos [Tue, 30 Aug 2022 15:21:41 +0000 (17:21 +0200)]
Flatten if-let and match into one.

21 months agoMove enum definition closer to its usage.
Mara Bos [Tue, 30 Aug 2022 15:18:09 +0000 (17:18 +0200)]
Move enum definition closer to its usage.

21 months agoUse if let chain.
Mara Bos [Tue, 30 Aug 2022 15:18:01 +0000 (17:18 +0200)]
Use if let chain.

21 months agoTweak comments.
Mara Bos [Sat, 27 Aug 2022 16:32:20 +0000 (18:32 +0200)]
Tweak comments.

21 months agoPrefer new_v1_formatted instead of new_v1 with duplicates.
Mara Bos [Sat, 27 Aug 2022 15:51:28 +0000 (17:51 +0200)]
Prefer new_v1_formatted instead of new_v1 with duplicates.

21 months agoFix typo.
Mara Bos [Fri, 26 Aug 2022 20:56:21 +0000 (22:56 +0200)]
Fix typo.

21 months agoMove FormatArgs structure to its own module.
Mara Bos [Fri, 26 Aug 2022 17:13:17 +0000 (19:13 +0200)]
Move FormatArgs structure to its own module.