]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoMove codegen_select_candidate to a rustc_traits
Michael Goulet [Thu, 8 Dec 2022 05:16:39 +0000 (05:16 +0000)]
Move codegen_select_candidate to a rustc_traits

20 months agoMove vtable methods into its own module
Michael Goulet [Thu, 8 Dec 2022 04:51:46 +0000 (04:51 +0000)]
Move vtable methods into its own module

20 months agoMove has_structural_eq_impls provider to rustc_ty_utils
Michael Goulet [Thu, 8 Dec 2022 04:02:50 +0000 (04:02 +0000)]
Move has_structural_eq_impls provider to rustc_ty_utils

20 months agoadd a test case for `generic_const_exprs` in trait items
Takayuki Maeda [Thu, 8 Dec 2022 05:11:29 +0000 (14:11 +0900)]
add a test case for `generic_const_exprs` in trait items

20 months agoPull out logic into distinct functions
Michael Goulet [Wed, 7 Dec 2022 20:30:42 +0000 (20:30 +0000)]
Pull out logic into distinct functions

20 months agoFix a typo.
Nicholas Nethercote [Thu, 8 Dec 2022 04:53:31 +0000 (15:53 +1100)]
Fix a typo.

20 months agoRemove `UnsafetyState`.
Nicholas Nethercote [Thu, 8 Dec 2022 04:42:12 +0000 (15:42 +1100)]
Remove `UnsafetyState`.

`FnCtxt::ps` is the only occurrence. It gets updated during HIR
typechecking, but is never looked at.

20 months agoAuto merge of #105425 - matthiaskrgr:rollup-3ngvxmt, r=matthiaskrgr
bors [Thu, 8 Dec 2022 03:04:51 +0000 (03:04 +0000)]
Auto merge of #105425 - matthiaskrgr:rollup-3ngvxmt, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #105267 (Don't ICE in ExprUseVisitor on FRU for non-existent struct)
 - #105343 (Simplify attribute handling in rustc_ast_lowering)
 - #105368 (Remove more `ref` patterns from the compiler)
 - #105400 (normalize before handling simple checks for evaluatability of `ty::Const`)
 - #105403 (rustdoc: simplify CSS selectors for item table `.stab`)
 - #105418 (fix: remove hack from link.rs)

Failed merges:

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

20 months agoFix warning when libcore is compiled with no_fp_fmt_parse
Gary Guo [Thu, 8 Dec 2022 00:07:00 +0000 (00:07 +0000)]
Fix warning when libcore is compiled with no_fp_fmt_parse

20 months agoCI: add missing line continuation marker
Dan Johnson [Wed, 7 Dec 2022 22:15:56 +0000 (14:15 -0800)]
CI: add missing line continuation marker

Resolves this docker warning:

```
[WARNING]: Empty continuation line found in:
    RUN apt-get update && apt-get install -y --no-install-recommends   g++   gcc-multilib   make   ninja-build   file   curl   ca-certificates   python2.7   python3.9   git   cmake   sudo   gdb   llvm-13-tools   llvm-13-dev   libedit-dev   libssl-dev   pkg-config   zlib1g-dev   xz-utils   nodejs     apt-transport-https software-properties-common &&     curl -s "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" > packages-microsoft-prod.deb &&     dpkg -i packages-microsoft-prod.deb &&     apt-get update &&     apt-get install -y powershell     && rm -rf /var/lib/apt/lists/*
Warning: : Empty continuation lines will become errors in a future release.
```

20 months agoAvoid heap allocation when truncating thread names
Gavin Li [Sun, 4 Dec 2022 05:54:38 +0000 (21:54 -0800)]
Avoid heap allocation when truncating thread names

Ensure that heap allocation does not occur in a thread until std::thread
is ready. This fixes issues with custom allocators that call
std::thread::current(), since doing so prematurely initializes
THREAD_INFO and causes the following thread_info::set() to fail.

20 months agoUse `Symbol` for the crate name instead of `String`/`str`
Oli Scherer [Tue, 6 Dec 2022 12:46:10 +0000 (12:46 +0000)]
Use `Symbol` for the crate name instead of `String`/`str`

20 months agoImprove calculation of scraped example minimized height
Will Crichton [Wed, 7 Dec 2022 18:24:16 +0000 (10:24 -0800)]
Improve calculation of scraped example minimized height

20 months agoProperly print generator interior type sizes
Michael Goulet [Wed, 7 Dec 2022 18:33:26 +0000 (18:33 +0000)]
Properly print generator interior type sizes

20 months agoRevert crate_types change, add new bin_crate field
Will Crichton [Tue, 6 Dec 2022 20:56:02 +0000 (12:56 -0800)]
Revert crate_types change, add new bin_crate field

20 months agoFix rustdoc error with no providec crate-type, fix scrape examples button colors...
Will Crichton [Tue, 6 Dec 2022 19:24:26 +0000 (11:24 -0800)]
Fix rustdoc error with no providec crate-type, fix scrape examples button colors w/ themes

20 months agoFix es-check
Will Crichton [Tue, 6 Dec 2022 18:22:23 +0000 (10:22 -0800)]
Fix es-check

20 months agoUpdate scrape-examples help, fix documentation typos
Will Crichton [Tue, 6 Dec 2022 18:11:55 +0000 (10:11 -0800)]
Update scrape-examples help, fix documentation typos

20 months agoFactor scrape-examples toggle test into a new file
Will Crichton [Tue, 6 Dec 2022 17:59:49 +0000 (09:59 -0800)]
Factor scrape-examples toggle test into a new file

20 months agoInclude additional documentation for scrape-examples changes
Will Crichton [Tue, 6 Dec 2022 17:34:37 +0000 (09:34 -0800)]
Include additional documentation for scrape-examples changes

20 months agoOnly put title over example on large screens
Will Crichton [Tue, 6 Dec 2022 07:48:07 +0000 (23:48 -0800)]
Only put title over example on large screens

20 months agoAdd explanations to scrape-examples integration test
Will Crichton [Tue, 6 Dec 2022 07:34:02 +0000 (23:34 -0800)]
Add explanations to scrape-examples integration test

20 months agoImprove several aspects of the Rustdoc scrape-examples UI.
Will Crichton [Sun, 27 Nov 2022 19:11:21 +0000 (13:11 -0600)]
Improve several aspects of the Rustdoc scrape-examples UI.
* Examples take up less screen height.
* Snippets from binary crates are prioritized.
* toggle-all-docs does not expand "More examples" sections.

20 months agoMove closure/generator type info methods to TyCtxt
Michael Goulet [Wed, 7 Dec 2022 17:00:33 +0000 (17:00 +0000)]
Move closure/generator type info methods to TyCtxt

20 months agoMake some trivial functions `#[inline(always)]`
Eduardo Sánchez Muñoz [Wed, 7 Dec 2022 16:11:17 +0000 (17:11 +0100)]
Make some trivial functions `#[inline(always)]`

20 months agoDon't silently ignore errors that happen during rendering
Guillaume Gomez [Wed, 7 Dec 2022 15:08:13 +0000 (16:08 +0100)]
Don't silently ignore errors that happen during rendering

20 months agoRollup merge of #105418 - BelovDV:fix-libc-hack, r=petrochenkov
Matthias Krüger [Wed, 7 Dec 2022 14:39:09 +0000 (15:39 +0100)]
Rollup merge of #105418 - BelovDV:fix-libc-hack, r=petrochenkov

fix: remove hack from link.rs

This logic implemented in libc.

r? `@petrochenkov`

20 months agoRollup merge of #105403 - notriddle:notriddle/item-stab-css, r=GuillaumeGomez
Matthias Krüger [Wed, 7 Dec 2022 14:39:09 +0000 (15:39 +0100)]
Rollup merge of #105403 - notriddle:notriddle/item-stab-css, r=GuillaumeGomez

rustdoc: simplify CSS selectors for item table `.stab`

The module-item and import-item classes are attached to the item-left. Just target that, instead.

20 months agoRollup merge of #105400 - BoxyUwU:braced_param_evaluatability, r=oli-obk
Matthias Krüger [Wed, 7 Dec 2022 14:39:08 +0000 (15:39 +0100)]
Rollup merge of #105400 - BoxyUwU:braced_param_evaluatability, r=oli-obk

normalize before handling simple checks for evaluatability of `ty::Const`

`{{{{{{{ N }}}}}}}` is desugared into a `ConstKind::Unevaluated` for an anonymous `const` item so when calling `is_const_evaluatable` on it we skip the `ConstKind::Param(_) => Ok(())` arm which is incorrect.

20 months agoRollup merge of #105368 - WaffleLapkin:deref-even-harder, r=TaKO8Ki
Matthias Krüger [Wed, 7 Dec 2022 14:39:07 +0000 (15:39 +0100)]
Rollup merge of #105368 - WaffleLapkin:deref-even-harder, r=TaKO8Ki

Remove more `ref` patterns from the compiler

Previous PR: #105045

20 months agoRollup merge of #105343 - nbdd0121:hir, r=fee1-dead
Matthias Krüger [Wed, 7 Dec 2022 14:39:07 +0000 (15:39 +0100)]
Rollup merge of #105343 - nbdd0121:hir, r=fee1-dead

Simplify attribute handling in rustc_ast_lowering

Given that attributes is stored in a separate BTreeMap, it's not necessary to pass it in when constructing `hir::Expr`. We can just construct `hir::Expr` and then call `self.lower_attrs` later if it needs attributes.

As most desugaring code don't use attributes, this allows some code cleanup.

20 months agoRollup merge of #105267 - compiler-errors:issue-104613, r=oli-obk
Matthias Krüger [Wed, 7 Dec 2022 14:39:06 +0000 (15:39 +0100)]
Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obk

Don't ICE in ExprUseVisitor on FRU for non-existent struct

Fixes #104613
Fixes #105202

20 months agoAuto merge of #103459 - ChrisDenton:propagate-nulls, r=thomcc
bors [Wed, 7 Dec 2022 13:52:52 +0000 (13:52 +0000)]
Auto merge of #103459 - ChrisDenton:propagate-nulls, r=thomcc

Pass on null handle values to child process

Fixes #101645

In Windows, stdio handles are (semantically speaking) `Option<Handle>` where `Handle` is a non-zero value. When spawning a process with `Stdio::Inherit`, Rust currently turns zero values into `-1` values. This has the unfortunate effect of breaking console subprocesses (which typically need stdio) that are spawned from gui applications (that lack stdio by default) because the console process won't be assigned handles from the newly created console (as they usually would in that situation). Worse, `-1` is actually [a valid handle](https://doc.rust-lang.org/std/os/windows/io/struct.OwnedHandle.html) which means "the current process". So if a console process, for example, waits on stdin and it has a `-1` value then the process will end up waiting on itself.

This PR fixes it by propagating the nulls instead of converting them to `-1`.

While I think the current behaviour is a mistake, changing it (however justified) is an API change so I think this PR should at least have some input from t-libs-api. So choosing at random...

r? `@joshtriplett`

20 months agoMake -Zsimulate-remapped-rust-src-base reproducible on CI
Oli Scherer [Wed, 7 Dec 2022 10:36:08 +0000 (10:36 +0000)]
Make -Zsimulate-remapped-rust-src-base reproducible on CI

20 months agoAuto merge of #104799 - pcc:linkage-fn, r=tmiasko
bors [Wed, 7 Dec 2022 10:24:59 +0000 (10:24 +0000)]
Auto merge of #104799 - pcc:linkage-fn, r=tmiasko

Support Option and similar enums as type of static variable with linkage attribute

Compiler MCP:
rust-lang/compiler-team#565

20 months agofix: remove hack from link.rs (moved to libc)
Daniil Belov [Wed, 7 Dec 2022 10:13:58 +0000 (13:13 +0300)]
fix: remove hack from link.rs (moved to libc)

20 months agoAvoid remapping paths back to `$SRC_DIR` in CI
Oli Scherer [Wed, 7 Dec 2022 09:19:49 +0000 (09:19 +0000)]
Avoid remapping paths back to `$SRC_DIR` in CI

20 months agoSplit `EarlyContextAndPasses::check_id` in two.
Nicholas Nethercote [Wed, 7 Dec 2022 03:58:48 +0000 (14:58 +1100)]
Split `EarlyContextAndPasses::check_id` in two.

20 months agoInline some hot lint pass functions.
Nicholas Nethercote [Wed, 7 Dec 2022 03:52:28 +0000 (14:52 +1100)]
Inline some hot lint pass functions.

These each have a single call site, due to being called from a
"combined" lint pass.

20 months agoRename `$passes` as `$pass` in several macros.
Nicholas Nethercote [Wed, 7 Dec 2022 05:54:02 +0000 (16:54 +1100)]
Rename `$passes` as `$pass` in several macros.

Because it makes more sense that way.

20 months agoAdd some useful comments.
Nicholas Nethercote [Wed, 7 Dec 2022 03:18:19 +0000 (14:18 +1100)]
Add some useful comments.

20 months agoRemove `$hir` argument from `late_lint_methods!`.
Nicholas Nethercote [Wed, 7 Dec 2022 02:27:04 +0000 (13:27 +1100)]
Remove `$hir` argument from `late_lint_methods!`.

Because it's always `'tcx`.

20 months agoUpdate LLVM submodule
Nikita Popov [Wed, 7 Dec 2022 07:40:49 +0000 (08:40 +0100)]
Update LLVM submodule

20 months agoAuto merge of #105395 - sunfishcode:sunfishcode/update-wasi, r=pietroalbini
bors [Wed, 7 Dec 2022 06:16:19 +0000 (06:16 +0000)]
Auto merge of #105395 - sunfishcode:sunfishcode/update-wasi, r=pietroalbini

Update the wasi toolchain.

Update the WASI build to LLVM 15.0 and the wasi-libc version from [wasi-sdk-17].

This will require a ci-mirrors.rust-lang.org file load. Specifically, we need [this LLVM release tarball] uploaded to be downloadable from [this URL].

The biggest change in wasi-sdk-17 is that user exports no longer automatically run constructor functions. More details at: https://github.com/WebAssembly/WASI/issues/493.

[this LLVM release tarball]: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[this URL]: https://ci-mirrors.rust-lang.org/rustc/2022-12-06-clang%2Bllvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[wasi-sdk-17]: https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-17

20 months agoconsider `parent_count` for const param defaults
Takayuki Maeda [Wed, 7 Dec 2022 03:55:30 +0000 (12:55 +0900)]
consider `parent_count` for const param defaults

20 months agoAuto merge of #105291 - nnethercote:remove-LintPassObjects, r=cjgillot
bors [Wed, 7 Dec 2022 03:52:19 +0000 (03:52 +0000)]
Auto merge of #105291 - nnethercote:remove-LintPassObjects, r=cjgillot

Remove `{Early,Late}LintPassObjects`.

`EarlyContextAndPass` wraps a single early lint pass. We aggregate multiple passes into that single pass by using `EarlyLintPassObjects`.

This commit removes `EarlyLintPassObjects` by changing `EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes a level of indirection. This makes the code simpler and slightly faster.

The commit does likewise for late lints.

r? `@cjgillot`

20 months agoCompute generator sizes with -Zprint_type_sizes
Michael Goulet [Sat, 5 Nov 2022 18:25:41 +0000 (18:25 +0000)]
Compute generator sizes with -Zprint_type_sizes

20 months agoAdd help for `#![feature(impl_trait_in_fn_trait_return)]`
Josh Stone [Wed, 7 Dec 2022 01:53:50 +0000 (17:53 -0800)]
Add help for `#![feature(impl_trait_in_fn_trait_return)]`

This adds a new variant `ImplTraitContext::FeatureGated`, so we can
generalize the help for `return_position_impl_trait_in_trait` to also
work for `impl_trait_in_fn_trait_return`.

20 months agoStop passing -export-dynamic to wasm-ld.
Dan Gohman [Wed, 7 Dec 2022 00:50:29 +0000 (16:50 -0800)]
Stop passing -export-dynamic to wasm-ld.

-export-dynamic was a temporary hack added in the early days of the Rust
wasm32 target when Rust didn't have a way to specify wasm exports in the
source code. This flag causes all global symbols, and some compiler-internal
symbols, to be exported, which is often more than needed.

Rust now does have a way to specify exports in the source code:
`#[export_name = "..."]`.

So as the original comment suggests, -export-dynamic can now be removed,
allowing users to have smaller binaries and better encapsulation in
their wasm32-unknown-unknown modules.

It's possible that this change will require existing wasm32-unknown-unknown
users will to add explicit `#[export_name = "..."]` directives to
exporrt the symbols that their programs depend on having exported.

20 months agoAuto merge of #105397 - matthiaskrgr:rollup-xv5imz8, r=matthiaskrgr
bors [Wed, 7 Dec 2022 00:32:57 +0000 (00:32 +0000)]
Auto merge of #105397 - matthiaskrgr:rollup-xv5imz8, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #105298 (llvm-wrapper: adapt for an LLVM API change)
 - #105358 (Add a test for #104260)
 - #105380 (add const generics ping files things for me)
 - #105382 (remove an excess `this`)
 - #105388 (rustdoc: remove redundant CSS `.import-item .stab { font-size }`)
 - #105390 (unstable-book: Add `ignore` to `abi_efiapi` example code)

Failed merges:

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

20 months agorustdoc: simplify CSS selectors for item table `.stab`
Michael Howell [Wed, 7 Dec 2022 00:05:43 +0000 (17:05 -0700)]
rustdoc: simplify CSS selectors for item table `.stab`

The module-item and import-item classes are attached to the item-left.
Just target that, instead.

20 months agonormalize before matching on `ConstKind`
Boxy [Tue, 6 Dec 2022 22:53:08 +0000 (22:53 +0000)]
normalize before matching on `ConstKind`

20 months agoRollup merge of #105390 - nicholasbishop:bishop-example-ignore, r=ehuss
Matthias Krüger [Tue, 6 Dec 2022 22:13:52 +0000 (23:13 +0100)]
Rollup merge of #105390 - nicholasbishop:bishop-example-ignore, r=ehuss

unstable-book: Add `ignore` to `abi_efiapi` example code

This example doesn't compile on targets that don't support UEFI, as reported here:
https://github.com/rust-lang/rust/pull/104793#issuecomment-1339783727

20 months agoRollup merge of #105388 - notriddle:notriddle/item-stab-font-size, r=GuillaumeGomez
Matthias Krüger [Tue, 6 Dec 2022 22:13:51 +0000 (23:13 +0100)]
Rollup merge of #105388 - notriddle:notriddle/item-stab-font-size, r=GuillaumeGomez

rustdoc: remove redundant CSS `.import-item .stab { font-size }`

This sets the exact same font size that `.stab` has by default anyway. It used to be slightly different, but dd5ff428edbc7cd4fa600b81f27bbec28589704f made it identical.

20 months agoRollup merge of #105382 - BoxyUwU:fixme_typo_sadface, r=lcnr
Matthias Krüger [Tue, 6 Dec 2022 22:13:51 +0000 (23:13 +0100)]
Rollup merge of #105382 - BoxyUwU:fixme_typo_sadface, r=lcnr

remove an excess `this`

20 months agoRollup merge of #105380 - BoxyUwU:triagebot_ping_pls, r=lcnr
Matthias Krüger [Tue, 6 Dec 2022 22:13:50 +0000 (23:13 +0100)]
Rollup merge of #105380 - BoxyUwU:triagebot_ping_pls, r=lcnr

add const generics ping files things for me

r? `@lcnr`

20 months agoRollup merge of #105358 - TaKO8Ki:fix-104260, r=estebank
Matthias Krüger [Tue, 6 Dec 2022 22:13:50 +0000 (23:13 +0100)]
Rollup merge of #105358 - TaKO8Ki:fix-104260, r=estebank

Add a test for #104260

Fixes #104260

20 months agoRollup merge of #105298 - krasimirgg:llvm-16-dec-1, r=cuviper
Matthias Krüger [Tue, 6 Dec 2022 22:13:49 +0000 (23:13 +0100)]
Rollup merge of #105298 - krasimirgg:llvm-16-dec-1, r=cuviper

llvm-wrapper: adapt for an LLVM API change

Adapts llvm-wrapper for https://github.com/llvm/llvm-project/commit/8c7c20f033c7036a8bf231ca6f9e02172cb581f0.
No functional changes intended.

Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15404#0184d95d-5a68-4db6-ad32-51ddbc3ab543/202-571

20 months agoAuto merge of #105271 - eduardosm:inline-always-int-conv, r=scottmcm
bors [Tue, 6 Dec 2022 21:41:04 +0000 (21:41 +0000)]
Auto merge of #105271 - eduardosm:inline-always-int-conv, r=scottmcm

Make integer-to-integer `From` impls `#[inline(always)]`

Splited from https://github.com/rust-lang/rust/pull/105262

20 months agoUpdate the wasi toolchain.
Dan Gohman [Tue, 6 Dec 2022 21:08:30 +0000 (13:08 -0800)]
Update the wasi toolchain.

Update the WASI build to LLVM 15.0 and the wasi-libc version from [wasi-sdk-17].

This will require a ci-mirrors.rust-lang.org file load. Specifically, we
need [this LLVM release tarball] uploaded to be downloadable from
[this URL].

[this LLVM release tarball]: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[this URL]: https://ci-mirrors.rust-lang.org/rustc/2022-12-06-clang%2Bllvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
[wasi-sdk-17]: https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-17

20 months agounstable-book: Add `ignore` to `abi_efiapi` example code
Nicholas Bishop [Tue, 6 Dec 2022 19:22:56 +0000 (14:22 -0500)]
unstable-book: Add `ignore` to `abi_efiapi` example code

This example doesn't compile on targets that don't support UEFI, as
reported here:
https://github.com/rust-lang/rust/pull/104793#issuecomment-1339783727

20 months agoFilter out precise alloc ids from diagnostics
Oli Scherer [Mon, 5 Dec 2022 10:42:59 +0000 (10:42 +0000)]
Filter out precise alloc ids from diagnostics

20 months agoEmit full spans in miri
Oli Scherer [Thu, 1 Dec 2022 20:25:43 +0000 (20:25 +0000)]
Emit full spans in miri

20 months agoBless 32 bit tests
Oli Scherer [Wed, 30 Nov 2022 12:10:41 +0000 (12:10 +0000)]
Bless 32 bit tests

20 months agoBless after rebase
Oli Scherer [Tue, 29 Nov 2022 16:40:25 +0000 (16:40 +0000)]
Bless after rebase

20 months agoProperly indent messages
Oli Scherer [Tue, 29 Nov 2022 13:35:13 +0000 (13:35 +0000)]
Properly indent messages

20 months agoChange CTFE backtraces to use `note` instead of `label` to preserve their order
Oli Scherer [Tue, 29 Nov 2022 13:10:42 +0000 (13:10 +0000)]
Change CTFE backtraces to use `note` instead of `label` to preserve their order

labels are reordered within the file in which they are reported, which can mess up the stack trace

20 months agoReintroduce the span printing in miri (plus point to spans where possible)
Oli Scherer [Tue, 15 Nov 2022 16:24:52 +0000 (16:24 +0000)]
Reintroduce the span printing in miri (plus point to spans where possible)

20 months agoRemove now-redundant file/line info from const backtraces
Oli Scherer [Tue, 15 Nov 2022 15:44:33 +0000 (15:44 +0000)]
Remove now-redundant file/line info from const backtraces

20 months agoStart emitting labels even if their pointed to file is not available locally
Oli Scherer [Tue, 15 Nov 2022 15:24:54 +0000 (15:24 +0000)]
Start emitting labels even if their pointed to file is not available locally

20 months agoremove an unnecessary `?`
Oli Scherer [Tue, 15 Nov 2022 09:58:43 +0000 (09:58 +0000)]
remove an unnecessary `?`

20 months agoSimplify span fallback
Oli Scherer [Tue, 15 Nov 2022 09:43:04 +0000 (09:43 +0000)]
Simplify span fallback

20 months agoSimplify some nested conditions
Oli Scherer [Mon, 14 Nov 2022 11:12:51 +0000 (11:12 +0000)]
Simplify some nested conditions

20 months agoEnable profiler in dist-powerpc64le-linux
Petr Ogarok [Tue, 6 Dec 2022 18:58:36 +0000 (19:58 +0100)]
Enable profiler in dist-powerpc64le-linux

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

I have verified locally that the runtime builds and the profiler is working fine on the platform.

20 months agorustdoc: remove redundant CSS `.import-item .stab { font-size }`
Michael Howell [Tue, 6 Dec 2022 18:56:22 +0000 (11:56 -0700)]
rustdoc: remove redundant CSS `.import-item .stab { font-size }`

This sets the exact same font size that `.stab` has by default anyway.
It used to be slightly different, but
dd5ff428edbc7cd4fa600b81f27bbec28589704f made it identical.

20 months agoAuto merge of #105378 - matthiaskrgr:rollup-fjeorw5, r=matthiaskrgr
bors [Tue, 6 Dec 2022 18:51:14 +0000 (18:51 +0000)]
Auto merge of #105378 - matthiaskrgr:rollup-fjeorw5, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #104898 (Put all cached values into a central struct instead of just the stable hash)
 - #105004 (Fix `emit_unused_delims_expr` ICE)
 - #105174 (Suggest removing struct field from destructive binding only in shorthand scenario)
 - #105250 (Replace usage of `ResumeTy` in async lowering with `Context`)
 - #105286 (Add -Z maximal-hir-to-mir-coverage flag)
 - #105320 (rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles)
 - #105349 (Point at args in associated const fn pointers)
 - #105362 (Cleanup macro-expanded code in `rustc_type_ir`)
 - #105370 (Remove outdated syntax from trait alias pretty printing)

Failed merges:

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

20 months agollvm-wrapper: adapt for and LLVM API change
Krasimir Georgiev [Mon, 5 Dec 2022 12:04:25 +0000 (12:04 +0000)]
llvm-wrapper: adapt for and LLVM API change

20 months agoSkip test on s390x as LLD does not support the platform
Ulrich Weigand [Tue, 6 Dec 2022 17:43:19 +0000 (18:43 +0100)]
Skip test on s390x as LLD does not support the platform

test/run-make/issue-71519 requires use of lld as linker,
but lld does not currently support the s390x architecture.

20 months agoDon't set `STARTF_USESTDHANDLES` if none are set
Chris Denton [Tue, 6 Dec 2022 16:54:32 +0000 (16:54 +0000)]
Don't set `STARTF_USESTDHANDLES` if none are set

20 months agoFix failing codegen tests on s390x
Ulrich Weigand [Tue, 6 Dec 2022 17:12:46 +0000 (18:12 +0100)]
Fix failing codegen tests on s390x

Several codegen tests are currently failing due to making
assumptions that are not valid for the s390x architecture:

- catch-unwind.rs: fails due to inlining differences.
  Already ignored on another platform for the same reason.
  Solution: Ignore on s390x.

- remap_path_prefix/main.rs: fails due to different alignment
  requirement for string constants.
  Solution: Do not test for the alignment requirement.

- repr-transparent-aggregates-1.rs: many ABI assumptions.
  Already ignored on many platforms for the same reason.
  Solution: Ignore on s390x.

- repr-transparent.rs: no vector ABI by default on s390x.
  Already ignored on another platform for a similar reason.
  Solution: Ignore on s390x.

- uninit-consts.rs: hard-coded little-endian constant.
  Solution: Match both little- and big-endian versions.

Fixes part of https://github.com/rust-lang/rust/issues/105383.

20 months agoCONSISTENCY
Boxy [Tue, 6 Dec 2022 16:45:11 +0000 (16:45 +0000)]
CONSISTENCY

Co-authored-by: lcnr <rust@lcnr.de>
20 months agotypo :(
Boxy [Tue, 6 Dec 2022 16:40:57 +0000 (16:40 +0000)]
typo :(

20 months agoadd cg ping files things
Boxy [Tue, 6 Dec 2022 16:33:19 +0000 (16:33 +0000)]
add cg ping files things

20 months agoRollup merge of #105370 - WaffleLapkin:pp, r=oli-obk
Matthias Krüger [Tue, 6 Dec 2022 15:54:57 +0000 (16:54 +0100)]
Rollup merge of #105370 - WaffleLapkin:pp, r=oli-obk

Remove outdated syntax from trait alias pretty printing

Given the following program:
```rust
#![feature(trait_alias)]
trait A = ?Sized;

fn main() {}
```
Old output of `rustc +nightly ./t.rs -Zunpretty=normal`:
```rust
#![feature(trait_alias)]
trait A for ? Sized ;

fn main() {}
```
New output of `rustc +a ./t.rs -Zunpretty=normal`:
```rust
#![feature(trait_alias)]
trait A = ?Sized;

fn main() {}
```

cc `@durka` (you've written the `FIXME` in #45047, see https://github.com/rust-lang/rust/pull/45047#discussion_r144960751)

20 months agoRollup merge of #105362 - WaffleLapkin:🙅, r=oli-obk
Matthias Krüger [Tue, 6 Dec 2022 15:54:56 +0000 (16:54 +0100)]
Rollup merge of #105362 - WaffleLapkin:🙅, r=oli-obk

Cleanup macro-expanded code in `rustc_type_ir`

We could of course just leave this as-is, but every time I go-to-def to this file it's painful to see all this `(&A(ref __self_1_0),)` stuff.

20 months agoRollup merge of #105349 - compiler-errors:point-at-assoc-ct-fn-ptr-arg, r=cjgillot
Matthias Krüger [Tue, 6 Dec 2022 15:54:56 +0000 (16:54 +0100)]
Rollup merge of #105349 - compiler-errors:point-at-assoc-ct-fn-ptr-arg, r=cjgillot

Point at args in associated const fn pointers

Tiny follow-up to #105201, not so sure it's worth it but :shrug:

The UI test example is a bit more compelling when it's `GlUniformScalar::FACTORY`

r? `@cjgillot`

20 months agoRollup merge of #105320 - notriddle:notriddle/rustdoc-toggle-hideme-2, r=GuillaumeGomez
Matthias Krüger [Tue, 6 Dec 2022 15:54:55 +0000 (16:54 +0100)]
Rollup merge of #105320 - notriddle:notriddle/rustdoc-toggle-hideme-2, r=GuillaumeGomez

rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles

This code uses a special `hideme` class anyway, so just style that.

20 months agoRollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillot
Matthias Krüger [Tue, 6 Dec 2022 15:54:55 +0000 (16:54 +0100)]
Rollup merge of #105286 - willcrichton:maximal-hir-to-mir-coverage, r=cjgillot

Add -Z maximal-hir-to-mir-coverage flag

This PR adds a new unstable flag `-Z maximal-hir-to-mir-coverage` that changes the behavior of `maybe_lint_level_root_bounded`, pursuant to [a discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Mapping.20MIR.20to.20HIR). When enabled, this function will not search upwards for a lint root, but rather immediately return the provided HIR node ID. This change increases the granularity of the mapping between MIR locations and HIR nodes inside the `SourceScopeLocalData` data structures. This increase in granularity is useful for rustc consumers like [Flowistry](https://github.com/willcrichton/flowistry) that rely on getting source-mapping information about the MIR CFG that is as precise as possible.

A test `maximal_mir_to_hir_coverage.rs` has been added to verify that this flag does not break anything.

r? `@cjgillot`

cc `@gavinleroy`

20 months agoRollup merge of #105250 - Swatinem:async-rm-resumety, r=oli-obk
Matthias Krüger [Tue, 6 Dec 2022 15:54:54 +0000 (16:54 +0100)]
Rollup merge of #105250 - Swatinem:async-rm-resumety, r=oli-obk

Replace usage of `ResumeTy` in async lowering with `Context`

Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`.

Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.

fixes https://github.com/rust-lang/rust/issues/104828 and https://github.com/rust-lang/rust/pull/104321#issuecomment-1336363077

r? `@oli-obk`

20 months agoRollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholk
Matthias Krüger [Tue, 6 Dec 2022 15:54:53 +0000 (16:54 +0100)]
Rollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholk

Suggest removing struct field from destructive binding only in shorthand scenario

Fixes #105028

20 months agoRollup merge of #105004 - TaKO8Ki:fix-104897, r=wesleywiser
Matthias Krüger [Tue, 6 Dec 2022 15:54:53 +0000 (16:54 +0100)]
Rollup merge of #105004 - TaKO8Ki:fix-104897, r=wesleywiser

Fix `emit_unused_delims_expr` ICE

Fixes #104897

This is also related to #104433.

20 months agoRollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiser
Matthias Krüger [Tue, 6 Dec 2022 15:54:52 +0000 (16:54 +0100)]
Rollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiser

Put all cached values into a central struct instead of just the stable hash

cc `@nnethercote`

this allows re-use of the type for Predicate without duplicating all the logic for the non-hash cached fields

20 months agoAuto merge of #105229 - saethlin:zst-writes-to-unions, r=oli-obk
bors [Tue, 6 Dec 2022 15:35:55 +0000 (15:35 +0000)]
Auto merge of #105229 - saethlin:zst-writes-to-unions, r=oli-obk

Re-enable removal of ZST writes to unions

This was previously disabled because Miri was lazily allocating unsized locals. But we aren't doing that anymore since  https://github.com/rust-lang/rust/pull/98831, so we can have this optimization back.

20 months ago`rustc_builtin_macros`: remove `ref` patterns
Maybe Waffle [Tue, 6 Dec 2022 13:22:36 +0000 (13:22 +0000)]
`rustc_builtin_macros`: remove `ref` patterns

... and other pattern matching improvements

20 months ago`rustc_attr` remove `ref` patterns
Maybe Waffle [Tue, 6 Dec 2022 12:24:57 +0000 (12:24 +0000)]
`rustc_attr` remove `ref` patterns

...and some if-let-elses too :P

20 months ago`rustc_borrowck`: remove `ref` patterns
Maybe Waffle [Fri, 2 Dec 2022 19:07:57 +0000 (19:07 +0000)]
`rustc_borrowck`: remove `ref` patterns

20 months agoRemove outdated syntax from trait alias pretty printing
Maybe Waffle [Tue, 6 Dec 2022 13:45:11 +0000 (13:45 +0000)]
Remove outdated syntax from trait alias pretty printing

20 months agoAdd debug asserts to hand-implemented `Ord`/`Eq` impls
Maybe Waffle [Tue, 6 Dec 2022 12:20:02 +0000 (12:20 +0000)]
Add debug asserts to hand-implemented `Ord`/`Eq` impls

20 months agoAuto merge of #105365 - matthiaskrgr:rollup-g0mrrt7, r=matthiaskrgr
bors [Tue, 6 Dec 2022 12:29:38 +0000 (12:29 +0000)]
Auto merge of #105365 - matthiaskrgr:rollup-g0mrrt7, r=matthiaskrgr

Rollup of 11 pull requests

Successful merges:

 - #104439 (Add prototype to generate `COPYRIGHT` from REUSE metadata)
 - #105005 (On E0195 point at where clause lifetime bounds)
 - #105098 (propagate the error from parsing enum variant to the parser and emit out)
 - #105243 (remove no-op 'let _ = ')
 - #105254 (Recurse into nested impl-trait when computing variance.)
 - #105287 (Synthesize substitutions for bad auto traits in dyn types)
 - #105310 (Be more careful about unresolved exprs in suggestion)
 - #105318 (Make `get_impl_future_output_ty` work with AFIT)
 - #105339 (support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute`)
 - #105340 (Avoid ICE by accounting for missing type)
 - #105342 (Make `note_obligation_cause_code`  take a `impl ToPredicate` for predicate)

Failed merges:

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

20 months agoRollup merge of #105342 - compiler-errors:note_cause_code-takes-predicate, r=fee1...
Matthias Krüger [Tue, 6 Dec 2022 12:27:45 +0000 (13:27 +0100)]
Rollup merge of #105342 - compiler-errors:note_cause_code-takes-predicate, r=fee1-dead

Make `note_obligation_cause_code`  take a `impl ToPredicate` for predicate

The only usecase that wasn't `impl ToPredicate` was noting overflow errors while revealing opaque types, which passed in an `Obligation<'tcx, Ty<'tcx>>`... Since this only happens in a `RevealAll` environment, which is after typeck (and probably primarily within `normalize_erasing_regions`) we're unlikely to display anything useful while noting this code, evidenced by the lack of UI test changes.