Commit Graph

142482 Commits

Author SHA1 Message Date
bors
a161ab00db Auto merge of #113637 - Mark-Simulacrum:bootstrap-bump, r=ozkanonur
Bump bootstrap to 1.72 beta
2023-07-13 18:15:14 +00:00
Matthias Krüger
7ea4387a93
Rollup merge of #113616 - edg-l:fix_bootstrap, r=albertlarsan68
Fix bootstrap.py uname error

The x.py script fails with `ValueError: too many values to unpack (expected 3)` when uname -smp gives more than 3 words

The error I got:
```
❯ ./x check
Traceback (most recent call last):
  File "/data1/edgar/rust/x.py", line 50, in <module>
    bootstrap.main()
  File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 1113, in main
    bootstrap(args)
  File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 1070, in bootstrap
    build = RustBuild(config_toml, args)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 505, in __init__
    self.build = args.build or self.build_triple()
                               ^^^^^^^^^^^^^^^^^^^
  File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 976, in build_triple
    return config or default_build_triple(self.verbose)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 259, in default_build_triple
    kernel, cputype, processor = uname.decode(default_encoding).split()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)
```

This is because

```
❯ uname -smp
Linux x86_64 AMD Ryzen 7 5800X 8-Core Processor
```
Returns more than 3 space separated words.
2023-07-13 12:19:25 +02:00
Matthias Krüger
253a4ca43f
Rollup merge of #113613 - GuillaumeGomez:allow-dash-in-file-name, r=notriddle
Allow to have `-` in rustdoc-json test file name

I extracted this commit from https://github.com/rust-lang/rust/pull/113574.

When I added the test, it kept saying that the JSON file couldn't be found. After investigating for a while, I discovered that we were expecting files to always use `_`, which is quite bad. So I added support for `-` in file names.

r? ``@notriddle``
2023-07-13 12:19:24 +02:00
Matthias Krüger
fc72c0fe8f
Rollup merge of #113603 - workingjubilee:test-for-98016, r=oli-obk
Test simd-wide-sum for codegen error

This adds the necessary test infrastructure to "build-pass" codegen tests, for the purpose of doing that for a single revision of a codegen test. When mir-opts are tested, the output may vary from the usual, and maybe for positive reasons... but we don't necessarily want to output such bad LLVMIR that LLVM starts crashing on it.

Currently when enabling MIR opts at higher levels this LLVMIR is still emitted, but it was previously disabled for getting in mir-opt's way and as this new revision without `// [mir-opt3]build-pass` would make it more likely to, I would like to not see the testing for the actual results regress again just because it was bundled with an ICE check as well.

This fixes https://github.com/rust-lang/rust/issues/98016
2023-07-13 12:19:23 +02:00
Matthias Krüger
a6fed6a0ca
Rollup merge of #113598 - weihanglo:update-cargo, r=weihanglo
Update cargo

10 commits in 45782b6b8afd1da042d45c2daeec9c0744f72cc7..694a579566a9a1482b20aff8a68f0e4edd99bd28
2023-07-05 16:54:51 +0000 to 2023-07-11 22:28:29 +0000
- fix(embedded): Always generate valid package names (rust-lang/cargo#12349)
- fix(embedded): Error on unsupported commands (rust-lang/cargo#12350)
- chore(ci): Automatically test new packages by using `--workspace` (rust-lang/cargo#12342)
- contrib docs: Add some more detail about how publishing works (rust-lang/cargo#12344)
- docs: Put cargo-add change under nightly (rust-lang/cargo#12343)
- Minor: Use "number" instead of "digit" when explaining Cargo's use of semver (rust-lang/cargo#12340)
- Update criterion (rust-lang/cargo#12338)
- Add profile strip to config docs. (rust-lang/cargo#12337)
- update re: multiple versions that differ only in the metadata tag (rust-lang/cargo#12335)
- doc: state `PackageId`/`SourceId` string is opaque (rust-lang/cargo#12313)

r? ``@ghost``
2023-07-13 12:19:23 +02:00
Matthias Krüger
893a5d2b32
Rollup merge of #113353 - compiler-errors:select-better, r=lcnr
Implement selection for `Unsize` for better coercion behavior

In order for much of coercion to succeed, we need to be able to deal with partial ambiguity of `Unsize` traits during selection. However, I pessimistically implemented selection in the new trait solver to just bail out with ambiguity if it was a built-in impl:
9227ff28af/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs (L126)

This implements a proper "rematch" procedure for dealing with built-in `Unsize` goals, so that even if the goal is ambiguous, we are able to get nested obligations which are used in the coercion selection-like loop:
9227ff28af/compiler/rustc_hir_typeck/src/coercion.rs (L702)

Second commit just moves a `resolve_vars_if_possible` call to fix a bug where we weren't detecting a trait upcasting to occur.

r? ``@lcnr``
2023-07-13 12:19:22 +02:00
Mark Rousskov
cc907f80b9 Re-format let-else per rustfmt update 2023-07-12 21:49:27 -04:00
Mark Rousskov
7559d96be9 Bump bootstrap compiler to latest 2023-07-12 21:26:04 -04:00
bors
33a2c2487a Auto merge of #113621 - ehuss:ignore-clippy-tests, r=Nilstrieb
Ignore flaky clippy tests.

These tests are frequently failing due to an issue in ui_test. ui_test doesn't appear to have a blanket ignore instruction that I could find, so I just approximated it with ignoring both 32 and 64 bit.

Fixes #113585
2023-07-12 15:47:32 +00:00
Eric Huss
fb5efd7008 Ignore flaky clippy tests. 2023-07-12 06:59:57 -07:00
bors
1e6db3486d Auto merge of #113214 - GuillaumeGomez:try-run-fix, r=ozkanonur,jyn514
Don't fail early if `try_run` returns an error

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

Follow-up of #112962.

r? `@jyn514`
2023-07-12 13:58:10 +00:00
bors
da1d099f91 Auto merge of #112945 - compiler-errors:tighten-span-of-adjustment-error, r=oli-obk
(re-)tighten sourceinfo span of adjustments in MIR

Diagnostics rely on the spans of MIR statements being (approximately) correct in order to give suggestions relative to that span (i.e. `shrink_to_hi` and `shrink_to_lo`).

I discovered that we're *intentionally* lowering THIR exprs with their parent expr's span if they come from adjustments that are due to a parent expression. While I understand why that may be desirable to demonstrate the relationship of an adjustment and the expression that requires it, it leads to

1. very verbose borrowck output
2. incorrect spans for suggestions

Some diagnostics get around that by giving suggestions relative to other spans we've collected during MIR lowering, such as the span of the method's identifier (e.g. `name` in `.name()`), but this doesn't work too well when things come from desugaring.

I assume it also has lead to numerous tweaks and complications to diagnostics code down the road, which this PR doesn't necessarily aim to fix but may open the gates to fixing later... The last three commits are simplifications due to the fact that we can assume that the move span actually points to what is being moved (and a test).

This regressed in #89110, which was debated somewhat in #90286. cc `@Aaron1011` who originally made this change.

r? diagnostics

Fixes #113547
Fixes #111016
2023-07-12 12:11:09 +00:00
bors
136dab6614 Auto merge of #113569 - RalfJung:miri, r=oli-obk
miri: protect Move() function arguments during the call

This gives `Move` operands a meaning specific to function calls:
- for the duration of the call, the place the operand comes from is protected, making all read and write accesses insta-UB.
- the contents of that place are reset to `Uninit`, so looking at them again after the function returns, we cannot observe their contents

Turns out we can replace the existing "retag return place" hack with the exact same sort of protection on the return place, which is nicely symmetric.

Fixes https://github.com/rust-lang/rust/issues/112564
Fixes https://github.com/rust-lang/miri/issues/2927

This starts with a Miri rustc-push, since we'd otherwise conflict with a PR that recently landed in Miri.
(The "miri tree borrows" commit is an unrelated cleanup I noticed while doing the PR. I can remove it if you prefer.)
r? `@oli-obk`
2023-07-12 10:19:42 +00:00
Weihang Lo
9f1c760349
Update cargo 2023-07-12 11:19:09 +01:00
Edgar Luque
d68eea61c3
Fix bootstrap.py uname error.
The x.py script fails with `ValueError: too many values to unpack (expected 3)` when uname -smp gives more than 3 words
2023-07-12 11:52:53 +02:00
Guillaume Gomez
18457ea47d Allow to have - in the rustdoc-json test file name 2023-07-12 10:45:49 +02:00
Jubilee
dc78cedd66
Rollup merge of #113579 - ekusiadadus:master, r=albertlarsan68
Revert "fix: 🐛 etc/bash_complettion -> src/etc/... to avoid copy …

## why

- [x] revert my broken PR

https://github.com/rust-lang/rust/pull/110906

This reverts commit 08ce68b6a6.
2023-07-11 21:00:29 -07:00
Jubilee
3518041a84
Rollup merge of #113385 - joshtriplett:style-guide-cleanup-chains, r=calebcartwright
style-guide: Fix chain example to match rustfmt behavior

The style guide gave an example of breaking a multi-line chain element
and all subsequent elements to a new line, but that same example and the
accompanying text also had several chain items stacked on the first
line. rustfmt doesn't do this, except when the rule saying to combine

```
shrt
    .y()
```

into

```
shrt.y()
```

applies.

This is a bugfix to match rustfmt behavior, so it's not a breaking change, and
it just needs a ``@rust-lang/style`` reviewer to r+.
2023-07-11 21:00:28 -07:00
Jubilee
dff07259d0
Rollup merge of #113373 - jyn514:download-rustc-fixes, r=albertlarsan68
various download-rustc fixes

separated out from https://github.com/rust-lang/rust/pull/112143 because it keeps getting stuck in limbo.

best reviewed commit-by-commit
2023-07-11 21:00:27 -07:00
jyn
67b5990472 Revert "Fix x test lint-docs when download-rustc is enabled"
This was not the correct fix. The problem was two-fold:
- `download-rustc` didn't respect `llvm.assertions`
- `rust-dev` was missing a bump to `download-ci-llvm-stamp`

The first is fixed in this PR and the latter was fixed a while ago. Revert this change to avoid breaking `rpath = false`.
2023-07-11 22:30:28 -05:00
jyn
934e7e6c26 Move ci_rustc_dir to Config and use it consistently 2023-07-11 22:30:28 -05:00
Jubilee Young
81dc91efbd Support build-pass in codegen tests 2023-07-11 20:21:15 -07:00
Ralf Jung
e7c6db7d44 fix handling of alignment for dyn-sized places 2023-07-11 21:59:01 +02:00
Ralf Jung
95392ef0c9 miri tree borrows: skip retag_reference early if there is no NewPermission 2023-07-11 21:59:01 +02:00
Ralf Jung
dd453a6a99 miri: protect Move() function arguments during the call 2023-07-11 21:59:01 +02:00
ekusiadadus
05bc71cfaf Revert "fix: 🐛 etc/bash_complettion -> src/etc/... to avoid copy error"
This reverts commit 08ce68b6a6.
2023-07-12 00:54:27 +09:00
Guillaume Gomez
98336f8f6e Don't fail early if try_run returns an error 2023-07-11 17:01:35 +02:00
bors
63ef74b6aa Auto merge of #111717 - Urgau:uplift_fn_null_check, r=oli-obk
Uplift `clippy::fn_null_check` lint

This PR aims at uplifting the `clippy::fn_null_check` lint into rustc.

## `incorrect_fn_null_checks`

(warn-by-default)

The `incorrect_fn_null_checks` lint checks for expression that checks if a function pointer is null.

### Example

```rust
let fn_ptr: fn() = /* somehow obtained nullable function pointer */

if (fn_ptr as *const ()).is_null() { /* ... */ }
```

### Explanation

Function pointers are assumed to be non-null, checking for their nullity is incorrect.

-----

Mostly followed the instructions for uplifting a clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751

`@rustbot` label: +I-lang-nominated
r? compiler
2023-07-11 09:34:48 +00:00
bors
fcaf04e715 Auto merge of #113559 - matthiaskrgr:rollup-jrqyctc, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #113386 (style-guide: Expand example of combinable expressions to include arrays)
 - #113523 (Reuse LLVMConstInBoundsGEP2)
 - #113528 (Dynamically size sigaltstk in rustc)
 - #113543 (Remove `rustc_llvm` from llvm-stamp nags)
 - #113548 (Update books)
 - #113551 (bootstrap: Don't print "Skipping" twice)
 - #113556 (Don't use serde-derive in the rls shim)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-11 02:48:49 +00:00
Matthias Krüger
ad4f303a5d
Rollup merge of #113556 - cuviper:trim-rls, r=Mark-Simulacrum
Don't use serde-derive in the rls shim

The already-small RLS shim can get a little smaller, and faster to
build, if we drop the serde-derive dependency and decode the one
"method" field it needs manually from `serde_json::Value`.
2023-07-11 00:58:18 +02:00
Matthias Krüger
40b1c5b716
Rollup merge of #113551 - jyn514:dry-run-exclude, r=ozkanonur
bootstrap: Don't print "Skipping" twice

Bootstrap executes itself twice: once with DryRun::SelfCheck and DryRun::Disabled. Change it not to print the "Skipping" message if SelfCheck is enabled.

See https://github.com/rust-lang/rust/actions/runs/5503931599/jobs/10029625567?pr=113514#step:24:772.
2023-07-11 00:58:18 +02:00
Matthias Krüger
3413ace988
Rollup merge of #113548 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

1 commits in 21cf840842bdf768a798869f06373c96c1cc5122..668c64760b5c7ea654facb4ba5fe9faddfda27cc
2023-06-29 13:50:36 UTC to 2023-06-29 13:50:36 UTC

- Remove adjective about what kind of number this is

## rust-lang/edition-guide

2 commits in f63e578b92ff43e8cc38fcaa257b660f45c8a8c2..2751bdcef125468ea2ee006c11992cd1405aebe5
2023-07-10 14:29:51 UTC to 2023-07-08 18:05:44 UTC

- Update a link to a section in the cargo workspaces. (rust-lang/edition-guide#283)
- b'...' byte strings -> byte chars (rust-lang/edition-guide#282)

## rust-embedded/book

2 commits in f2aed2fe8e9f55508c86ba3aa4b6789b18a08a22..1e5556dd1b864109985d5871616ae6b9164bcead
2023-06-29 07:34:47 UTC to 2023-06-27 23:43:06 UTC

- add constgebra to list of math crates (rust-embedded/book#358)
- Switch to GHMQ (rust-embedded/book#357)

## rust-lang/nomicon

1 commits in c369e4b489332f8721fbae630354fa83385d457d..302b995bcb24b70fd883980fd174738c3a10b705
2023-07-05 16:08:32 UTC to 2023-07-05 16:08:32 UTC

- Minor improvements (rust-lang/nomicon#414)

## rust-lang/reference

5 commits in 5ca365eac678cb0d41a20b3204546d6ed70c7171..1ea0178266b3f3f613b0fabdaf16a83961c99cdb
2023-07-08 22:11:07 UTC to 2023-06-26 16:51:55 UTC

- Remove doc of unstable feature of never type (rust-lang/reference#1376)
- Typo: 'assingee' to 'assignee' in expressions.md (rust-lang/reference#1377)
- str type: make sentence more readable (rust-lang/reference#1374)
- Remove obsolete note about soundness hole in type-layout.md (rust-lang/reference#1367)
- Typo: 'a' to 'an' in destructors.md (rust-lang/reference#1371)

## rust-lang/rust-by-example

1 commits in 57636d6926762861f34e030d52ca25a71e95e5bf..8a87926a985ce32ca1fad1be4008ee161a0b91eb
2023-07-07 22:44:06 UTC to 2023-07-07 22:44:06 UTC

- Hint for RGB color calculation (rust-lang/rust-by-example#1726)

## rust-lang/rustc-dev-guide

18 commits in 17fe3e948498c50e208047a750f17d6a8d89669b..b5a12d95e32ae53791cc6ab44417774667ed2ac6
2023-07-09 14:50:50 UTC to 2023-06-28 04:55:24 UTC

- fix: update link to function coverage (rust-lang/rustc-dev-guide#1727)
- Fix a bug in getting-started.md (rust-lang/rustc-dev-guide#1726)
- improve explanation of placing tests in separate file (rust-lang/rustc-dev-guide#1721)
- various fixes/improvements to Contributing chapter (rust-lang/rustc-dev-guide#1723)
- ty::ConstKind has moved (rust-lang/rustc-dev-guide#1724)
- document `./x test --rustc-args` option (rust-lang/rustc-dev-guide#1719)
- tests/run-make files have moved (rust-lang/rustc-dev-guide#1716)
- replace dead link (rust-lang/rustc-dev-guide#1717)
- fix link (rust-lang/rustc-dev-guide#1718)
- update link (rust-lang/rustc-dev-guide#1709)
- typo (rust-lang/rustc-dev-guide#1706)
- OwningRef exists no more (rust-lang/rustc-dev-guide#1715)
- Try to avoid confusion (rust-lang/rustc-dev-guide#1713)
- Issue1707 doc simply use x (rust-lang/rustc-dev-guide#1710)
- include rustc-dev-guide's own issues in suggested search (rust-lang/rustc-dev-guide#1708)
- Improve feature gate and x.py docs (rust-lang/rustc-dev-guide#1701)
- Fix some links (rust-lang/rustc-dev-guide#1705)
- Define more lint terms. (rust-lang/rustc-dev-guide#1681)
2023-07-11 00:58:17 +02:00
Matthias Krüger
87f978d83c
Rollup merge of #113386 - joshtriplett:style-guide-combinable-expressions, r=compiler-errors
style-guide: Expand example of combinable expressions to include arrays

Arrays are allowed as combinable expressions, but none of the examples
show that.
2023-07-11 00:58:15 +02:00
bors
1d4f5affbd Auto merge of #113544 - Kobzol:ci-macos-13, r=jyn514
CI: use `macos-13` runner for Apple jobs

Trying if performance of Apple CI improves with macOS 13 and SIP disabled. Speed-up:
```
x86_64-apple-1: ~2h 20m > ~1h 20m
x86_64-apple-2: ~1h 45m > ~1h 15m
```

r? `@pietroalbini`
2023-07-10 22:35:11 +00:00
Josh Stone
dd5fa7d9b3 Don't use serde-derive in the rls shim
The already-small RLS shim can get a little smaller, and faster to
build, if we drop the serde-derive dependency and decode the one
"method" field it needs manually from `serde_json::Value`.
2023-07-10 14:53:57 -07:00
jyn
8c91c8fe84 Don't print "Skipping" twice
Bootstrap executes itself twice: once with DryRun::SelfCheck and DryRun::Disabled.
Change it not to print the "Skipping" message if SelfCheck is enabled.

See https://github.com/rust-lang/rust/actions/runs/5503931599/jobs/10029625567?pr=113514#step:24:772.
2023-07-10 15:19:54 -05:00
Michael Goulet
fe870424a7 Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
rustbot
b706cf80b0 Update books 2023-07-10 12:23:19 -07:00
bors
8ca44ef9ca Auto merge of #112988 - spastorino:new-rpitit-24, r=compiler-errors
Replace RPITIT current impl with new strategy that lowers as a GAT

This PR replaces the current implementation of RPITITs with the new implementation that we had under -Zlower-impl-trait-in-trait-to-assoc-ty flag that lowers the RPIT as a GAT on the trait and on the impls that implement that trait.

Opening this PR as a draft because this goes after #112682, ~#112981~ and ~#112983~.
As soon as those are merged, I can rebase and we should run perf, crater and test a lot.

r? `@compiler-errors`
2023-07-10 19:01:30 +00:00
Jakub Beránek
8e0a87bdf4
CI: use macos-13 runner for Apple jobs 2023-07-10 20:22:15 +02:00
Urgau
c0fbeeab16 Drop uplifted clippy::fn_null_check 2023-07-10 18:12:41 +02:00
bjorn3
470c244c8a Remove the library/term exception in tidy's pal checker code
This crate doesn't exist anymore.
2023-07-10 08:25:50 +00:00
Ralf Jung
a3fdf75d12 Merge from rustc 2023-07-10 10:16:05 +02:00
Ralf Jung
d4034a2035 Preparing for merge from rustc 2023-07-10 10:15:54 +02:00
bors
743333f3dd Auto merge of #108796 - devsnek:personality-pal-exception, r=workingjubilee
move personality to sys

this moves `personality` to sys, removing another PAL exception
2023-07-10 05:19:37 +00:00
Gus Caplan
90e11a2a58 move personality to sys 2023-07-09 22:11:21 -07:00
bors
71f71a5397 Auto merge of #108485 - devsnek:float-pat-exception, r=workingjubilee
move pal cfgs in f32 and f64 to sys

I'd like to push forward on `sys` being a separate crate. To start with, most of these PAL exception cases are very simple little bits of code like this, so I thought I would try tidying them up.
2023-07-10 02:50:53 +00:00
Gus Caplan
45b516c844 move pal cfgs in f32 and f64 to sys 2023-07-09 17:32:26 -07:00
bors
1065d876cd Auto merge of #113341 - Kobzol:stage0-sysroot, r=Mark-Simulacrum
Copy stage0 `rustc` binaries to `stage0-sysroot`

This is basically a revival of https://github.com/rust-lang/rust/pull/101711 and https://github.com/rust-lang/rust/pull/107956, with an added check that the full sysroot will only be created if the original rustc comes from `stage0/bin`.

What is/should be tested:

- [x] `rustup toolchain link stage0` (new libstd is used correctly)
- [x]  `python3 x.py fmt dist --stage 0`
- [x] Custom rustc/cargo in `config.toml` (in this case this logic is ignored)
- [x]  Perfbot (try perf run has succeeded)
- [x] Real use case (https://github.com/rust-lang/backtrace-rs/pull/542)

(Hopefully) fixes: https://github.com/rust-lang/rust/issues/101691

This is not the "end all, be all" solution to this problem, but as long as it resolves the basic use-case, and doesn't break perfbot, I say ship it. This code will probably be nuked anyway Soon™ because of the stage redesign.
2023-07-09 18:41:32 +00:00
bors
a9eba8d793 Auto merge of #113508 - matthiaskrgr:rollup-xzrp4nt, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #111618 (Always name the return place.)
 - #113247 (Add Tests for native wasm exceptions)
 - #113273 (Use String or Int to set the opt level)
 - #113469 (Remove `default_free_fn` feature)
 - #113493 (additional io::copy specializations)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-09 16:07:00 +00:00