]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoReduce the scope of allow(rustc::potential_query_instability) in rustc_trait_selection
CastilloDel [Fri, 28 Oct 2022 21:32:41 +0000 (23:32 +0200)]
Reduce the scope of allow(rustc::potential_query_instability) in rustc_trait_selection

Make InferCtxtExt use a FxIndexMap

This should be faster, because the map is only being used to iterate,
which is supposed to be faster with the IndexMap

Make the user_computed_preds use an IndexMap

It is being used mostly for iteration, so the change shouldn't result in
a perf hit

Make the RegionDeps fields use an IndexMap

This change could be a perf hit. Both `larger` and `smaller` are used
for iteration, but they are also used for insertions.

Make types_without_default_bounds use an IndexMap

It uses extend, but it also iterates and removes items. Not sure if
this will be a perf hit.

Make InferTtxt.reported_trait_errors use an IndexMap

This change brought a lot of other changes. The map seems to have been
mostly used for iteration, so the performance shouldn't suffer.

Add FIXME to change ProvisionalEvaluationCache.map to use an IndexMap

Right now this results in a perf hit. IndexMap doesn't have
the `drain_filter` API, so in `on_completion` we now need to iterate two
times over the map.

19 months agoAuto merge of #104063 - compiler-errors:ct-norm-unless, r=jackh726
bors [Tue, 8 Nov 2022 10:02:11 +0000 (10:02 +0000)]
Auto merge of #104063 - compiler-errors:ct-norm-unless, r=jackh726

Don't normalize constants unless they need normalization

Maybe makes normalization a bit faster when we have many constants in a type

r? `@ghost`

19 months agoAuto merge of #104138 - Dylan-DPC:rollup-m3ojpjg, r=Dylan-DPC
bors [Tue, 8 Nov 2022 06:49:52 +0000 (06:49 +0000)]
Auto merge of #104138 - Dylan-DPC:rollup-m3ojpjg, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #103446 (Specialize `iter::ArrayChunks::fold` for TrustedRandomAccess iterators)
 - #103651 (Fix `rustc_parse_format` spans following escaped utf-8 multibyte chars)
 - #103865 (Move `fallback_has_occurred` state tracking to `FnCtxt`)
 - #103955 (Update linker-plugin-lto.md to contain up to Rust 1.65)
 - #103987 (Remove `in_tail_expr` from FnCtxt)
 - #104067 (fix debuginfo for windows_gnullvm_base.rs)
 - #104094 (fully move `on_unimplemented` to `error_reporting`)

Failed merges:

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

19 months agoRollup merge of #104094 - lcnr:on_unimplemented-move, r=wesleywiser
Dylan DPC [Tue, 8 Nov 2022 05:53:53 +0000 (11:23 +0530)]
Rollup merge of #104094 - lcnr:on_unimplemented-move, r=wesleywiser

fully move `on_unimplemented` to `error_reporting`

the `traits` module has a few too many submodules in my opinion.

19 months agoRollup merge of #104067 - jeremyd2019:patch-1, r=davidtwco
Dylan DPC [Tue, 8 Nov 2022 05:53:53 +0000 (11:23 +0530)]
Rollup merge of #104067 - jeremyd2019:patch-1, r=davidtwco

fix debuginfo for windows_gnullvm_base.rs

These lines (including the FIXME comment) were added to windows_gnu_base.rs in cf2c492ef8c87c049b4e3a62f43c841aafc88cba but windows_gnullvm_base.rs was not updated.  This resulted in an error `LLVM ERROR: dwo only supported with ELF and Wasm` attempting to build on aarch64-pc-windows-gnullvm.

See also https://github.com/msys2/MINGW-packages/pull/13921#issuecomment-1304391707

/cc ```@mati865``` ```@davidtwco```

r? ```@davidtwco```

19 months agoRollup merge of #103987 - compiler-errors:no-in_tail_expr, r=eholk
Dylan DPC [Tue, 8 Nov 2022 05:53:52 +0000 (11:23 +0530)]
Rollup merge of #103987 - compiler-errors:no-in_tail_expr, r=eholk

Remove `in_tail_expr` from FnCtxt

Cleans up yet another unneeded member from `FnCtxt`. The `in_tail_expr` condition wasn't even correct -- it was set for true while typechecking the whole fn body.

19 months agoRollup merge of #103955 - str4d:update-lto-doc-1.65, r=ehuss
Dylan DPC [Tue, 8 Nov 2022 05:53:52 +0000 (11:23 +0530)]
Rollup merge of #103955 - str4d:update-lto-doc-1.65, r=ehuss

Update linker-plugin-lto.md to contain up to Rust 1.65

The table rows were obtained via the script embedded in the page.

19 months agoRollup merge of #103865 - compiler-errors:fallback-has-occurred-tracking, r=eholk
Dylan DPC [Tue, 8 Nov 2022 05:53:51 +0000 (11:23 +0530)]
Rollup merge of #103865 - compiler-errors:fallback-has-occurred-tracking, r=eholk

Move `fallback_has_occurred` state tracking to `FnCtxt`

Removes a ton of callsites that defaulted to `false`

19 months agoRollup merge of #103651 - Alexendoo:parse-format-unicode-escapes, r=wesleywiser
Dylan DPC [Tue, 8 Nov 2022 05:53:51 +0000 (11:23 +0530)]
Rollup merge of #103651 - Alexendoo:parse-format-unicode-escapes, r=wesleywiser

Fix `rustc_parse_format` spans following escaped utf-8 multibyte chars

Currently too many skips are created for char escapes that are larger than 1 byte when encoded in UTF-8, [playground:](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c77a9dc669b69b167271b59ed2c8d88c)

```rust
fn main() {
    format!("\u{df}{a}");
    format!("\u{211d}{a}");
    format!("\u{1f4a3}{a}");
}
```
```
error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
 --> src/main.rs:2:22
  |
2 |     format!("\u{df}{a}");
  |                      ^ not found in this scope

error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
 --> src/main.rs:3:25
  |
3 |     format!("\u{211d}{a}");
  |                         ^ not found in this scope

error[[E0425]](https://doc.rust-lang.org/stable/error-index.html#E0425): cannot find value `a` in this scope
 --> src/main.rs:4:27
  |
4 |     format!("\u{1f4a3}{a}");
  |                           ^ not found in this scope
```

This reduces the number of skips to account for that

Fixes https://github.com/rust-lang/rust-clippy/issues/9727

19 months agoRollup merge of #103446 - the8472:tra-array-chunks, r=Mark-Simulacrum
Dylan DPC [Tue, 8 Nov 2022 05:53:50 +0000 (11:23 +0530)]
Rollup merge of #103446 - the8472:tra-array-chunks, r=Mark-Simulacrum

Specialize `iter::ArrayChunks::fold` for TrustedRandomAccess iterators

```
OLD:
test iter::bench_trusted_random_access_chunks                      ... bench:         368 ns/iter (+/- 4)
NEW:
test iter::bench_trusted_random_access_chunks                      ... bench:          30 ns/iter (+/- 0)
```

The resulting assembly is similar to #103166 but the specialization kicks in under different (partially overlapping) conditions compared to that PR. They're complementary.

In principle a TRA-based specialization could be applied to all `ArrayChunks` methods, including `next()` as we do for `Zip` but that would have all the same hazards as the Zip specialization. Only doing it for `fold` is far less hazardous. The downside is that it only helps with internal, exhaustive iteration. I.e. `for _ in` or `try_fold` will not benefit.

Note that the regular, `try_fold`-based and the specialized `fold()` impl have observably slightly different behavior. Namely the specialized variant does not fetch the remainder elements from the underlying iterator. We do have a few other places in the standard library where beyond-the-end-of-iteration side-effects are being elided under some circumstances but not others.

Inspired by https://old.reddit.com/r/rust/comments/yaft60/zerocost_iterator_abstractionsnot_so_zerocost/

19 months agoAuto merge of #104023 - Nilstrieb:cleanup-query, r=cjgillot
bors [Tue, 8 Nov 2022 03:03:38 +0000 (03:03 +0000)]
Auto merge of #104023 - Nilstrieb:cleanup-query, r=cjgillot

Several query cleanups

A few cleanups, mostly about naming in `rustc_query_system`.

r? `@cjgillot`

19 months agoAuto merge of #104013 - notriddle:notriddle/rustdoc-sizeof, r=GuillaumeGomez
bors [Tue, 8 Nov 2022 00:02:45 +0000 (00:02 +0000)]
Auto merge of #104013 - notriddle:notriddle/rustdoc-sizeof, r=GuillaumeGomez

rustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`

19 months agodocument and improve array Guard type
The 8472 [Mon, 7 Nov 2022 23:13:26 +0000 (00:13 +0100)]
document and improve array Guard type

The type is unsafe and now exposed to the whole crate.
Document it properly and add an unsafe method so the
caller can make it visible that something unsafe is happening.

19 months agosimplification: do not process the ArrayChunks remainder in fold()
The 8472 [Sun, 23 Oct 2022 19:29:15 +0000 (21:29 +0200)]
simplification: do not process the ArrayChunks remainder in fold()

19 months agospecialize iter::ArrayChunks::fold for TrustedRandomAccess iters
The 8472 [Sun, 23 Oct 2022 17:19:37 +0000 (19:19 +0200)]
specialize iter::ArrayChunks::fold for TrustedRandomAccess iters

This is fairly safe use of TRA since it consumes the iterator so
no struct in an unsafe state will be left exposed to user code

19 months agomake the array initialization guard available to other modules
The 8472 [Sun, 23 Oct 2022 17:17:41 +0000 (19:17 +0200)]
make the array initialization guard available to other modules

19 months agoadd benchmark for iter::ArrayChunks::fold specialization
The 8472 [Sun, 23 Oct 2022 17:16:49 +0000 (19:16 +0200)]
add benchmark for iter::ArrayChunks::fold specialization

This also updates the existing iter::Copied::next_chunk benchmark so
that the thing it benches doesn't get masked by the ArrayChunks specialization

19 months agoAuto merge of #103934 - notriddle:notriddle/backtrace-deps, r=Mark-Simulacrum
bors [Mon, 7 Nov 2022 20:05:09 +0000 (20:05 +0000)]
Auto merge of #103934 - notriddle:notriddle/backtrace-deps, r=Mark-Simulacrum

std: sync "Dependencies of the `backtrace` crate" with `backtrace`

Compare:

https://github.com/rust-lang/backtrace-rs/blob/07872f28cd8a65c3c7428811548dc85f1f2fb05b/Cargo.toml#L43

https://github.com/rust-lang/rust/blob/160b19429523ea44c4c3b7cad4233b2a35f58b8f/library/std/Cargo.toml#L26

19 months agoAuto merge of #103569 - RalfJung:miri-test-macos, r=Mark-Simulacrum
bors [Mon, 7 Nov 2022 17:04:06 +0000 (17:04 +0000)]
Auto merge of #103569 - RalfJung:miri-test-macos, r=Mark-Simulacrum

fix and (re-)enable Miri cross-target checks on macOS and Windows

Fixes https://github.com/rust-lang/rust/issues/103519
r? `@Mark-Simulacrum`

19 months agoAuto merge of #104102 - Dylan-DPC:rollup-0eakshe, r=Dylan-DPC
bors [Mon, 7 Nov 2022 13:19:36 +0000 (13:19 +0000)]
Auto merge of #104102 - Dylan-DPC:rollup-0eakshe, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #103757 (Mention const and lifetime parameters in error E0207)
 - #103986 (Don't silently eat label before block in block-like expr)
 - #104003 (Move some tests to more reasonable directories)
 - #104038 (Normalize types when deducing closure signature from supertraits)
 - #104052 (Fix `resolution_failure` ICE)
 - #104090 (Modify comment syntax error)

Failed merges:

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

19 months agoRollup merge of #104090 - wanghaha-dev:master, r=Dylan-DPC
Dylan DPC [Mon, 7 Nov 2022 13:05:26 +0000 (18:35 +0530)]
Rollup merge of #104090 - wanghaha-dev:master, r=Dylan-DPC

Modify comment syntax error

Modify comment syntax error

19 months agoRollup merge of #104052 - TaKO8Ki:fix-103997, r=notriddle
Dylan DPC [Mon, 7 Nov 2022 13:05:26 +0000 (18:35 +0530)]
Rollup merge of #104052 - TaKO8Ki:fix-103997, r=notriddle

Fix `resolution_failure` ICE

Fixes #103997

19 months agoRollup merge of #104038 - compiler-errors:super-norm-closure-sig, r=lcnr
Dylan DPC [Mon, 7 Nov 2022 13:05:25 +0000 (18:35 +0530)]
Rollup merge of #104038 - compiler-errors:super-norm-closure-sig, r=lcnr

Normalize types when deducing closure signature from supertraits

Elaborated supertraits should be normalized, since there's no guarantee they don't contain projections :sweat_smile:

Fixes #104025
r? types

19 months agoRollup merge of #104003 - c410-f3r:moar-errors, r=petrochenkov
Dylan DPC [Mon, 7 Nov 2022 13:05:25 +0000 (18:35 +0530)]
Rollup merge of #104003 - c410-f3r:moar-errors, r=petrochenkov

Move some tests to more reasonable directories

r? `@petrochenkov`

19 months agoRollup merge of #103986 - compiler-errors:oh-no-bad-block-should-not-have-label,...
Dylan DPC [Mon, 7 Nov 2022 13:05:24 +0000 (18:35 +0530)]
Rollup merge of #103986 - compiler-errors:oh-no-bad-block-should-not-have-label, r=lcnr

Don't silently eat label before block in block-like expr

Fixes #103983
cc #92823 (where the regression was introduced)

19 months agoRollup merge of #103757 - ffmancera:ff/clarify_E0207, r=jackh726
Dylan DPC [Mon, 7 Nov 2022 13:05:23 +0000 (18:35 +0530)]
Rollup merge of #103757 - ffmancera:ff/clarify_E0207, r=jackh726

Mention const and lifetime parameters in error E0207

Error Index for E0207 must mention const and lifetime parameters. In addition, add code examples for these situations.

Fixes #80862

19 months agoAuto merge of #101395 - saethlin:strict-provenance-codegen, r=nikic
bors [Mon, 7 Nov 2022 10:36:48 +0000 (10:36 +0000)]
Auto merge of #101395 - saethlin:strict-provenance-codegen, r=nikic

Add a codegen test for rust-lang/rust#96152

This is a regression test for https://github.com/rust-lang/rust/issues/96152, it is intended to check that our codegen for a particular strict provenance pattern is always as good as the ptr2int2ptr/provenance-ignoring style.

r? `@nikic`

19 months agoadd FIXME to replace this env var in the future
Ralf Jung [Mon, 7 Nov 2022 08:14:49 +0000 (09:14 +0100)]
add FIXME to replace this env var in the future

19 months agoAuto merge of #103218 - CastilloDel:infer, r=jackh726
bors [Mon, 7 Nov 2022 07:38:05 +0000 (07:38 +0000)]
Auto merge of #103218 - CastilloDel:infer, r=jackh726

Remove #![allow(rustc::potential_query_instability)] from rustc_infer

Related to #84447

This PR probably needs to be benchmarked to check for regressions.

19 months agofully move `on_unimplemented` to error reporting
lcnr [Mon, 7 Nov 2022 07:10:25 +0000 (08:10 +0100)]
fully move `on_unimplemented` to error reporting

19 months agoModify comment syntax error
wanghaha-dev [Mon, 7 Nov 2022 06:33:33 +0000 (14:33 +0800)]
Modify comment syntax error

19 months agoMigrate linker-plugin-lto.md compatibility table to show Rust ranges
Jack Grigg [Mon, 7 Nov 2022 03:25:54 +0000 (03:25 +0000)]
Migrate linker-plugin-lto.md compatibility table to show Rust ranges

The helper shell script has been rewritten as a helper Python script
that generates the range-based table.

19 months agoAuto merge of #104083 - JohnTitor:rollup-lo3wbzs, r=JohnTitor
bors [Mon, 7 Nov 2022 02:15:39 +0000 (02:15 +0000)]
Auto merge of #104083 - JohnTitor:rollup-lo3wbzs, r=JohnTitor

Rollup of 9 pull requests

Successful merges:

 - #103885 (rustdoc: various cross-crate reexport fixes)
 - #103914 (Make underscore_literal_suffix a hard error.)
 - #104045 (Add type_array to BaseTypeMethods)
 - #104056 (Vec: IntoIterator signature consistency)
 - #104059 (Fix typo in `rustc_middle/lint.rs`)
 - #104062 (rustdoc: remove unused CSS `#sidebar-filler`)
 - #104065 (Migrate rust logo filter to CSS variables)
 - #104066 (LLVM 16: Update RISCV data layout)
 - #104074 (rustdoc: Add an example for round that is different from truncate)

Failed merges:

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

19 months agoreturn `None` when def_kind is `DefKind::Use`
Takayuki Maeda [Sun, 6 Nov 2022 11:58:16 +0000 (20:58 +0900)]
return `None` when def_kind is `DefKind::Use`

19 months agofix debuginfo for windows_gnullvm_base.rs
jeremyd2019 [Sun, 6 Nov 2022 19:51:12 +0000 (11:51 -0800)]
fix debuginfo for windows_gnullvm_base.rs

These lines (including the FIXME comment) were added to windows_gnu_base.rs in cf2c492ef8c87c049b4e3a62f43c841aafc88cba but windows_gnullvm_base.rs was not updated.  This resulted in an error `LLVM ERROR: dwo only supported with ELF and Wasm` attempting to build on aarch64-pc-windows-gnullvm.

Signed-off-by: Jeremy Drake <github@jdrake.com>
19 months agoRollup merge of #104074 - yancyribbens:add-example-to-round, r=Mark-Simulacrum
Yuki Okushi [Mon, 7 Nov 2022 00:46:29 +0000 (09:46 +0900)]
Rollup merge of #104074 - yancyribbens:add-example-to-round, r=Mark-Simulacrum

rustdoc: Add an example for round that is different from truncate

The current examples for [round](https://github.com/rust-lang/rust/blob/master/library/std/src/f64.rs#L75) would have the same results as the example for [truncate](https://github.com/rust-lang/rust/blob/master/library/std/src/f64.rs#L95).  This PR adds one more example to `round` that will have a different result from `truncate`.

19 months agoRollup merge of #104066 - TimNN:riscv-layout, r=nikic
Yuki Okushi [Mon, 7 Nov 2022 00:46:28 +0000 (09:46 +0900)]
Rollup merge of #104066 - TimNN:riscv-layout, r=nikic

LLVM 16: Update RISCV data layout

The RISCV data layout was changed in https://github.com/llvm/llvm-project/commit/974e2e690b4024c2677dde26cc76ec31e0047c1d.

This updates all `riscv64*` targets, though I don't really know what the difference between the `gc` and `imac` ones is.

Passes `x test codegen` at LLVM head and with the currently bundled LLVM version. Without this patch, some tests fail with:

> error: internal compiler error: compiler/rustc_codegen_llvm/src/context.rs:192:13: data-layout for target `riscv64gc-unknown-none-elf`, `e-m:e-p:64:64-i64:64-i128:128-n64-S128`, differs from LLVM target's `riscv64` default layout, `e-m:e-p:64:64-i64:64-i128:128-n32:64-S128

19 months agoRollup merge of #104065 - GuillaumeGomez:css-migrate-logo-filter, r=notriddle
Yuki Okushi [Mon, 7 Nov 2022 00:46:28 +0000 (09:46 +0900)]
Rollup merge of #104065 - GuillaumeGomez:css-migrate-logo-filter, r=notriddle

Migrate rust logo filter to CSS variables

19 months agoRollup merge of #104062 - notriddle:notriddle/sidebar-filler, r=GuillaumeGomez
Yuki Okushi [Mon, 7 Nov 2022 00:46:27 +0000 (09:46 +0900)]
Rollup merge of #104062 - notriddle:notriddle/sidebar-filler, r=GuillaumeGomez

rustdoc: remove unused CSS `#sidebar-filler`

This hack was removed in 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, but the CSS was left in.

19 months agoRollup merge of #104059 - Rejyr:rustc_middle-lint-typo, r=petrochenkov
Yuki Okushi [Mon, 7 Nov 2022 00:46:27 +0000 (09:46 +0900)]
Rollup merge of #104059 - Rejyr:rustc_middle-lint-typo, r=petrochenkov

Fix typo in `rustc_middle/lint.rs`

19 months agoRollup merge of #104056 - ripytide:patch-1, r=Mark-Simulacrum
Yuki Okushi [Mon, 7 Nov 2022 00:46:26 +0000 (09:46 +0900)]
Rollup merge of #104056 - ripytide:patch-1, r=Mark-Simulacrum

Vec: IntoIterator signature consistency

Also makes the code dryer.

19 months agoRollup merge of #104045 - Ayush1325:type_array, r=nikic
Yuki Okushi [Mon, 7 Nov 2022 00:46:26 +0000 (09:46 +0900)]
Rollup merge of #104045 - Ayush1325:type_array, r=nikic

Add type_array to BaseTypeMethods

Moved `type_array` function to `rustc_codegen_ssa::BaseTypeMethods` trait. This allows using normal `alloca` function to create arrays as suggested in https://github.com/rust-lang/rust/pull/104022.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoRollup merge of #103914 - nnethercote:close-42326, r=petrochenkov
Yuki Okushi [Mon, 7 Nov 2022 00:46:26 +0000 (09:46 +0900)]
Rollup merge of #103914 - nnethercote:close-42326, r=petrochenkov

Make underscore_literal_suffix a hard error.

It's been a warning for 5.5 years. Time to make it a hard error.

Closes #42326.

r? ``@pnkfelix``

19 months agoRollup merge of #103885 - fmease:rustdoc-various-cross-crate-reexport-fixes, r=cjgill...
Yuki Okushi [Mon, 7 Nov 2022 00:46:25 +0000 (09:46 +0900)]
Rollup merge of #103885 - fmease:rustdoc-various-cross-crate-reexport-fixes, r=cjgillot,GuillaumeGomez

rustdoc: various cross-crate reexport fixes

Fixes for various smaller cross-crate reexport issues.
The PR is split into several commits for easier review. Will be squashed after approval.

Most notable changes:

* We finally render late-bound lifetimes in the generic parameter list of cross-crate functions & methods.
  Previously, we would display the re-export of `pub fn f<'s>(x: &'s str) {}` as `pub fn f(x: &'s str)`
* We now render unnamed parameters of cross-crate functions and function pointers as underscores
  since that's exactly what we do for local definitions, too. Mentioned as a bug in #44306.
* From now on, the rendering of cross-crate trait-object types is more correct:
  * `for<>` parameter lists (for higher-ranked lifetimes) are now shown
  * the return type of `Fn{,Mut,Once}` trait bounds is now displayed

Regarding the last list item, here is a diff for visualization (before vs. after):

```patch
- dyn FnOnce(&'any str) + 'static
+ dyn for<'any> FnOnce(&'any str) -> bool + 'static
```

The redundant `+ 'static` will be removed in a follow-up PR that will hide trait-object lifetime-bounds if they coincide with [their default](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) (see [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/clean_middle_ty.3A.20I.20need.20to.20add.20a.20parameter/near/307143097)). `FIXME(fmease)`s were added.

``@rustbot`` label A-cross-crate-reexports
r? ``@GuillaumeGomez``

19 months agoDon't normalize constants unless they need normalization
Michael Goulet [Sun, 6 Nov 2022 17:14:05 +0000 (17:14 +0000)]
Don't normalize constants unless they need normalization

19 months agoMake underscore_literal_suffix a hard error.
Nicholas Nethercote [Thu, 3 Nov 2022 01:02:33 +0000 (12:02 +1100)]
Make underscore_literal_suffix a hard error.

It's been a warning for 5.5 years. Time to make it a hard error.

Closes #42326.

19 months agorustdoc: Add an example for round that is different from truncate
yancy [Sun, 6 Nov 2022 22:05:16 +0000 (23:05 +0100)]
rustdoc: Add an example for round that is different from truncate

19 months agoAdd a codegen test for rust-lang/rust#96152
Ben Kimock [Sat, 3 Sep 2022 22:06:25 +0000 (18:06 -0400)]
Add a codegen test for rust-lang/rust#96152

19 months agoExtend rust-logo GUI test to check there is no filter for other logos
Guillaume Gomez [Sun, 6 Nov 2022 19:20:43 +0000 (20:20 +0100)]
Extend rust-logo GUI test to check there is no filter for other logos

19 months agoLLVM 16: Update RISCV data layout
Tim Neumann [Sun, 6 Nov 2022 19:03:22 +0000 (19:03 +0000)]
LLVM 16: Update RISCV data layout

19 months agoAuto merge of #99943 - compiler-errors:tuple-trait, r=jackh726
bors [Sun, 6 Nov 2022 17:48:33 +0000 (17:48 +0000)]
Auto merge of #99943 - compiler-errors:tuple-trait, r=jackh726

Implement `std::marker::Tuple`, use it in `extern "rust-call"` and `Fn`-family traits

Implements rust-lang/compiler-team#537

I made a few opinionated decisions in this implementation, specifically:
1. Enforcing `extern "rust-call"` on fn items during wfcheck,
2. Enforcing this for all functions (not just ones that have bodies),
3. Gating this `Tuple` marker trait behind its own feature, instead of grouping it into (e.g.) `unboxed_closures`.

Still needing to be done:
1. Enforce that `extern "rust-call"` `fn`-ptrs are well-formed only if they have 1/2 args and the second one implements `Tuple`. (Doing this would fix ICE in #66696.)
2. Deny all explicit/user `impl`s of the `Tuple` trait, kinda like `Sized`.
3. Fixing `Tuple` trait built-in impl for chalk, so that chalkification tests are un-broken.

Open questions:
1. Does this need t-lang or t-libs signoff?

Fixes #99820

19 months agoMigrate rust logo filter to CSS variables
Guillaume Gomez [Sun, 6 Nov 2022 17:20:28 +0000 (18:20 +0100)]
Migrate rust logo filter to CSS variables

19 months agorustdoc: remove unused CSS `#sidebar-filler`
Michael Howell [Sun, 6 Nov 2022 16:55:16 +0000 (09:55 -0700)]
rustdoc: remove unused CSS `#sidebar-filler`

This hack was removed in 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, but the
CSS was left in.

19 months agofix: typo
Rejyr [Sun, 6 Nov 2022 16:22:29 +0000 (11:22 -0500)]
fix: typo

19 months agoVec: IntoIterator signature consistency
ripytide [Sun, 6 Nov 2022 15:25:00 +0000 (15:25 +0000)]
Vec: IntoIterator signature consistency

Also makes the code dryer.

19 months agoAuto merge of #103861 - compiler-errors:codegen-select-in-vtable-slot, r=nagisa
bors [Sun, 6 Nov 2022 14:03:59 +0000 (14:03 +0000)]
Auto merge of #103861 - compiler-errors:codegen-select-in-vtable-slot, r=nagisa

Use `codegen_select` in `vtable_trait_upcasting_coercion_new_vptr_slot`

A super tiny clean up

19 months agoRename `Ctxt` and `CTX` to `Tcx` and `Qcx`
Nilstrieb [Sat, 5 Nov 2022 20:04:19 +0000 (21:04 +0100)]
Rename `Ctxt` and `CTX` to `Tcx` and `Qcx`

This makes it consistent and clear which context is used.

19 months agoRename `tcx` to `qcx` when it's a `QueryContext`
Nilstrieb [Sat, 5 Nov 2022 19:58:10 +0000 (20:58 +0100)]
Rename `tcx` to `qcx` when it's a `QueryContext`

19 months agoImprove tracing logging
Nilstrieb [Sat, 5 Nov 2022 19:40:42 +0000 (20:40 +0100)]
Improve tracing logging

19 months agoRename `incremental_verify_ich_cold` to `incremental_verify_ich_failed`
Nilstrieb [Sat, 5 Nov 2022 19:26:41 +0000 (20:26 +0100)]
Rename `incremental_verify_ich_cold` to `incremental_verify_ich_failed`

19 months agoRemove one lifetime from `QueryKeyStringBuilder`
Nilstrieb [Sat, 5 Nov 2022 19:20:38 +0000 (20:20 +0100)]
Remove one lifetime from `QueryKeyStringBuilder`

19 months agoAuto merge of #103720 - crlf0710:most_translation_attr, r=compiler-errors
bors [Sun, 6 Nov 2022 11:23:24 +0000 (11:23 +0000)]
Auto merge of #103720 - crlf0710:most_translation_attr, r=compiler-errors

Lint against usages of `struct_span_lint_hir`.

r? `@compiler-errors`

19 months agoAdd type_array to BaseTypeMethods
Ayush Singh [Sun, 6 Nov 2022 08:31:46 +0000 (14:01 +0530)]
Add type_array to BaseTypeMethods

Moved type_array function to rustc_codegen_ssa::BaseTypeMethods trait.
This allows using normal alloca function to create arrays as suggested in
https://github.com/rust-lang/rust/pull/104022.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoAuto merge of #104043 - matthiaskrgr:rollup-sttf9e8, r=matthiaskrgr
bors [Sun, 6 Nov 2022 08:13:56 +0000 (08:13 +0000)]
Auto merge of #104043 - matthiaskrgr:rollup-sttf9e8, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #103012 (Suggest use .. to fill in the rest of the fields of Struct)
 - #103851 (Fix json flag in bootstrap doc)
 - #103990 (rustdoc: clean up `.logo-container` layout CSS)
 - #104002 (fix a comment in UnsafeCell::new)
 - #104014 (Migrate test-arrow to CSS variables)
 - #104016 (Add internal descriptions to a few queries)
 - #104035 (Add 'closure match' test to weird-exprs.rs.)

Failed merges:

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

19 months agoRollup merge of #104035 - m-ou-se:weird-expr-closure-match, r=compiler-errors
Matthias Krüger [Sun, 6 Nov 2022 07:35:28 +0000 (08:35 +0100)]
Rollup merge of #104035 - m-ou-se:weird-expr-closure-match, r=compiler-errors

Add 'closure match' test to weird-exprs.rs.

Having fun with patterns that look like closures.

19 months agoRollup merge of #104016 - Nilstrieb:query-descs-more, r=compiler-errors
Matthias Krüger [Sun, 6 Nov 2022 07:35:28 +0000 (08:35 +0100)]
Rollup merge of #104016 - Nilstrieb:query-descs-more, r=compiler-errors

Add internal descriptions to a few queries

helps with #104008

19 months agoRollup merge of #104014 - GuillaumeGomez:run-button-css-var, r=notriddle
Matthias Krüger [Sun, 6 Nov 2022 07:35:27 +0000 (08:35 +0100)]
Rollup merge of #104014 - GuillaumeGomez:run-button-css-var, r=notriddle

Migrate test-arrow to CSS variables

There should be no UI changes. I kept both `color` and `background-color` properties even though only the ayu theme is actually completely making use of them on hover.

r? ``@notriddle``

19 months agoRollup merge of #104002 - RalfJung:unsafecell-new, r=JohnTitor
Matthias Krüger [Sun, 6 Nov 2022 07:35:27 +0000 (08:35 +0100)]
Rollup merge of #104002 - RalfJung:unsafecell-new, r=JohnTitor

fix a comment in UnsafeCell::new

There are several safe methods that access the inner value: `into_inner` has existed since forever and `get_mut` also exists since recently. So this comment seems just wrong. But `&self` methods return raw pointers and thus require unsafe code (though the methods themselves are still safe).

19 months agoRollup merge of #103990 - notriddle:notriddle/logo-container, r=GuillaumeGomez
Matthias Krüger [Sun, 6 Nov 2022 07:35:26 +0000 (08:35 +0100)]
Rollup merge of #103990 - notriddle:notriddle/logo-container, r=GuillaumeGomez

rustdoc: clean up `.logo-container` layout CSS

This commit should result in no appearance changes.

To make the logo container exactly the desired height, you want to get rid of the part of the box used for typographic descenders (you know, the part of g, y, and j that descends below the baseline). After all, it contains no text, but the space is still left open in the layout by default, because `<img>` is `display:inline`. The CSS used to employ three different tricks to accomplish this:

* By making `.sidebar .logo-container` a flex container, the image becomes a flex item and is [blockified], without synthesizing any inline boxes. No inline boxes means no descenders.
* By giving `.mobile-topbar .logo-container` a max-height exactly the same as the height of the image plus the padding, the descender area gets cut off.
* By setting `.sub-logo-container { line-height: 0 }`, we ensure that the only box that contributes to the height of the line box is the image itself, and not any zero-content text boxes that neighbor it. See the [logical height algorithm].

This commit gets rid of the first two hacks, leaving only the third, since it requires only one line of code to accomplish and doesn't require setting the value based on math.

[blockified]: https://drafts.csswg.org/css-flexbox-1/#flex-items
[logical height algorithm]: https://www.w3.org/TR/css-inline-3/#inline-height

19 months agoRollup merge of #103851 - viandoxdev:103816_bootstrap_fix_json_doc, r=jyn514
Matthias Krüger [Sun, 6 Nov 2022 07:35:26 +0000 (08:35 +0100)]
Rollup merge of #103851 - viandoxdev:103816_bootstrap_fix_json_doc, r=jyn514

Fix json flag in bootstrap doc

Fix the `--json` flag not working with x.py (Closes #103816)

While this works I'm not sure about the `should_run` of `JsonStd`, had to change it because https://github.com/rust-lang/rust/blob/ab5a2bc7316012ee9b2a4a4f3821673f2677f3d5/src/bootstrap/builder.rs#L334 would match with JsonStd and remove the paths that Std matched. So I did [this](https://github.com/viandoxdev/rust/blob/ffd4078264c4892b5098d6191e0adfe3564d62ca/src/bootstrap/doc.rs#L526-L534) but that looks more like a hack/workaround than anything. I'm guessing there's something to do with the default condition thing but idk how it works

19 months agoRollup merge of #103012 - chenyukang:fix-102806, r=davidtwco,compiler-errors
Matthias Krüger [Sun, 6 Nov 2022 07:35:26 +0000 (08:35 +0100)]
Rollup merge of #103012 - chenyukang:fix-102806, r=davidtwco,compiler-errors

Suggest use .. to fill in the rest of the fields of Struct

Fixes #102806

19 months agoAuto merge of #102618 - aliemjay:simplify-closure-promote, r=compiler-errors
bors [Sun, 6 Nov 2022 05:26:09 +0000 (05:26 +0000)]
Auto merge of #102618 - aliemjay:simplify-closure-promote, r=compiler-errors

rework applying closure requirements in borrowck

Previously the promoted closure constraints were registered under the category `ConstraintCategory::ClosureBounds` in `type_check::prove_closure_bounds()` and then mapped back their original category in `regions_infer::best_blame_constraint` using the complicated map `closure_bounds_mapping`.

Now we're registering promoted constraints under their original category and span earlier in `type_check::prove_closure_bounds`.

See commit messages.

Fixes #99245

19 months agoMove fallback_has_occurred to FnCtxt
Michael Goulet [Wed, 2 Nov 2022 01:34:17 +0000 (01:34 +0000)]
Move fallback_has_occurred to FnCtxt

19 months agoFix typo
Michael Goulet [Sun, 6 Nov 2022 02:33:12 +0000 (19:33 -0700)]
Fix typo

19 months agoAuto merge of #103975 - oli-obk:tracing, r=jackh726
bors [Sun, 6 Nov 2022 02:21:34 +0000 (02:21 +0000)]
Auto merge of #103975 - oli-obk:tracing, r=jackh726

Some tracing and comment cleanups

Pulled out of https://github.com/rust-lang/rust/pull/101900 to see if that is the perf impact

19 months agoNormalize signature when deducing closure signature from supertraits
Michael Goulet [Sun, 6 Nov 2022 01:59:03 +0000 (01:59 +0000)]
Normalize signature when deducing closure signature from supertraits

19 months agoAdd more nonsense to weird-exprs.rs.
Mara Bos [Sun, 6 Nov 2022 00:22:31 +0000 (01:22 +0100)]
Add more nonsense to weird-exprs.rs.

19 months agorustdoc: print usize with less string manipulation
Michael Howell [Sat, 5 Nov 2022 23:55:40 +0000 (16:55 -0700)]
rustdoc: print usize with less string manipulation

19 months agoAuto merge of #104009 - Nilstrieb:query-unify-config-desc, r=jyn514
bors [Sat, 5 Nov 2022 23:21:01 +0000 (23:21 +0000)]
Auto merge of #104009 - Nilstrieb:query-unify-config-desc, r=jyn514

Merge `QueryDescription` into `QueryConfig`

`QueryDescription` has gone through a lot of refactoring and doesn't make sense anymore.

r? `@jyn514`

19 months agorustdoc: add test case for huge logo
Michael Howell [Sat, 5 Nov 2022 17:14:31 +0000 (10:14 -0700)]
rustdoc: add test case for huge logo

19 months agoAuto merge of #102458 - JohnTitor:stabilize-instruction-set, r=oli-obk
bors [Sat, 5 Nov 2022 20:39:06 +0000 (20:39 +0000)]
Auto merge of #102458 - JohnTitor:stabilize-instruction-set, r=oli-obk

Stabilize the `instruction_set` feature

Closes https://github.com/rust-lang/rust/issues/74727
FCP is complete on https://github.com/rust-lang/rust/issues/74727#issuecomment-1242773253
r? `@pnkfelix` and/or `@nikomatsakis`
cc `@xd009642`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
19 months agoBless more tests
Michael Goulet [Sun, 2 Oct 2022 19:41:54 +0000 (19:41 +0000)]
Bless more tests

19 months agoMerge conflicts and rebase onto master
Michael Goulet [Sun, 2 Oct 2022 06:57:01 +0000 (06:57 +0000)]
Merge conflicts and rebase onto master

19 months agoBless chalk tests
Michael Goulet [Sat, 30 Jul 2022 05:43:26 +0000 (05:43 +0000)]
Bless chalk tests

19 months agoAdjust diagnostics, bless tests
Michael Goulet [Sat, 30 Jul 2022 05:37:48 +0000 (05:37 +0000)]
Adjust diagnostics, bless tests

19 months agoEnforce rust-check ABI in signatures, calls
Michael Goulet [Sat, 30 Jul 2022 03:41:53 +0000 (03:41 +0000)]
Enforce rust-check ABI in signatures, calls

19 months agoAuto merge of #104017 - matthiaskrgr:rollup-k8i0j9m, r=matthiaskrgr
bors [Sat, 5 Nov 2022 17:39:16 +0000 (17:39 +0000)]
Auto merge of #104017 - matthiaskrgr:rollup-k8i0j9m, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #101702 (rustdoc: add hash to filename of toolchain files)
 - #103920 (Move browser opening logic in `Builder`)
 - #103927 (Do not make typo suggestions when suggesting pattern matching)
 - #103972 (Remove an option and choose a behaviour-preserving default instead.)
 - #103988 (Fix search result bottom border color)

Failed merges:

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

19 months agoEnforce Tuple trait on Fn traits
Michael Goulet [Sat, 30 Jul 2022 01:53:53 +0000 (01:53 +0000)]
Enforce Tuple trait on Fn traits

19 months agofix out dir being wrong in json
viandoxdev [Sat, 5 Nov 2022 17:30:01 +0000 (18:30 +0100)]
fix out dir being wrong in json

19 months agoRollup merge of #103988 - GuillaumeGomez:fix-bottom-border-color, r=notriddle
Matthias Krüger [Sat, 5 Nov 2022 17:06:07 +0000 (18:06 +0100)]
Rollup merge of #103988 - GuillaumeGomez:fix-bottom-border-color, r=notriddle

Fix search result bottom border color

It reverts a color change while keeping the improvement made in #103938.

I think it'll need to be backported once merged too.

r? `@notriddle`

19 months agoRollup merge of #103972 - oli-obk:unoptional, r=fee1-dead
Matthias Krüger [Sat, 5 Nov 2022 17:06:07 +0000 (18:06 +0100)]
Rollup merge of #103972 - oli-obk:unoptional, r=fee1-dead

Remove an option and choose a behaviour-preserving default instead.

r? ``@fee1-dead``

19 months agoRollup merge of #103927 - fee1-dead-contrib:E0425-no-typo-when-pattern-matching,...
Matthias Krüger [Sat, 5 Nov 2022 17:06:06 +0000 (18:06 +0100)]
Rollup merge of #103927 - fee1-dead-contrib:E0425-no-typo-when-pattern-matching, r=cjgillot

Do not make typo suggestions when suggesting pattern matching

Fixes #103909.

19 months agoRollup merge of #103920 - ferrocene:pa-maybe-open-in-browser, r=jyn514
Matthias Krüger [Sat, 5 Nov 2022 17:06:06 +0000 (18:06 +0100)]
Rollup merge of #103920 - ferrocene:pa-maybe-open-in-browser, r=jyn514

Move browser opening logic in `Builder`

This allows `open()` to be called from other places in bootstrap (I need this for Ferrocene, as we keep our custom steps in `src/bootstrap/ferrocene`), and it simplifies the callers by moving the `was_invoked_explicitly` check into the function.

19 months agoRollup merge of #101702 - jsha:static-files2, r=notriddle,GuillaumeGomez
Matthias Krüger [Sat, 5 Nov 2022 17:06:05 +0000 (18:06 +0100)]
Rollup merge of #101702 - jsha:static-files2, r=notriddle,GuillaumeGomez

rustdoc: add hash to filename of toolchain files

All static files used by rustdoc are now stored in static.files/ and their filenames include a hash of their contents. Their filenames no longer include the contents of the --resource-suffix flag. This clarifies caching semantics. Anything in static.files can use Cache-Control: immutable because any updates will show up as a new URL.

Invocation-specific files like crates-NN.js, search-index-NN.js, and sidebar-items-NN.js still get the resource suffix.

This has a useful side effect: once toolchain files aren't affected by resource suffix, it will become possible for docs.rs to include crate version in the resource suffix. That should fix a caching issue with `/latest/` URLs: https://github.com/rust-lang/docs.rs/issues/1593. My goal is that it should be safe to serve all rustdoc JS, CSS, and fonts with infinite caching headers, even when new versions of a crate are uploaded in the same place as old versions.

The --disable-minification flag is removed because it would vary the output of static files based on invocation flags. Instead, for rustdoc development purposes it's preferable to symlink static files to a non-minified copy for quick iteration.

Example listing:

```
$ cd build/x86_64-unknown-linux-gnu/doc/ && find . | egrep 'js$|css$' | egrep -v 'sidebar-items|implementors' | sort
./crates1.65.0.js
./rust.css
./search-index1.65.0.js
./source-files1.65.0.js
./static.files/ayu-2bfd0af01c176fd5.css
./static.files/dark-95d11b5416841799.css
./static.files/light-c83a97e93a11f15a.css
./static.files/main-efc63f77fb116394.js
./static.files/normalize-76eba96aa4d2e634.css
./static.files/noscript-5bf457055038775c.css
./static.files/rustdoc-7a422337900fa894.css
./static.files/scrape-examples-3dd10048bcead3a4.js
./static.files/search-47f3c289722672cf.js
./static.files/settings-17b08337296ac774.js
./static.files/settings-3f95eacb845293c0.css
./static.files/source-script-215e9db86679192e.js
./static.files/storage-26d846fcae82ff09.js
```

Fixes #98413

19 months agoAdd internal descriptions to a few queries
Nilstrieb [Sat, 5 Nov 2022 16:54:15 +0000 (17:54 +0100)]
Add internal descriptions to a few queries

19 months agoSimplify code
Nilstrieb [Sat, 5 Nov 2022 16:54:06 +0000 (17:54 +0100)]
Simplify code

19 months agoExtend GUI test for run button
Guillaume Gomez [Sat, 5 Nov 2022 16:22:38 +0000 (17:22 +0100)]
Extend GUI test for run button

19 months agoMigrate test-arrow to CSS variables
Guillaume Gomez [Sat, 5 Nov 2022 16:22:25 +0000 (17:22 +0100)]
Migrate test-arrow to CSS variables

19 months agorustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`
Michael Howell [Sat, 5 Nov 2022 16:02:10 +0000 (09:02 -0700)]
rustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`

19 months agoUpdate GUI test for bottom border color
Guillaume Gomez [Fri, 4 Nov 2022 21:36:14 +0000 (22:36 +0100)]
Update GUI test for bottom border color