Commit Graph

238672 Commits

Author SHA1 Message Date
Guillaume Gomez
e05e4f38b5
Rollup merge of #117263 - onur-ozkan:change-id-fix, r=saethlin
handle the case when the change-id isn't found

When we switch back and forth between the old and recent branches, if there was a breaking change in the bootstrap configuration in between, we have to update the change-id in the build configuration with each checkout, which can be exhausting. This change fixes that.

r? saethlin
2023-11-08 17:14:35 +01:00
bors
341efb1017 Auto merge of #117560 - lqd:issue-117146, r=matthewjasper
Compute polonius loan scopes over the region graph

In issue #117146 a loan flows into an SCC containing a placeholder, and whose representative is an existential region. Since we currently compute loan scopes by looking at SCCs and their representatives only, polonius would compute kill points for this loan here whereas NLLs would not of course.

There are a few ways to fix this:
- don't try to be efficient by doing the computation over SCCs, and simply look for free regions and placeholders in the successors of the issuing region.
- change how the SCC representatives are picked, biasing towards placeholders over existential regions. They *shouldn't* matter much, but some downstream code may subtly depend on the current scheme (though no tests fail if we do such a change). This is for unrelated reasons also the way #116891 changes the representative computation. So that PR would also fix issue #117146.
- try to remove placeholders from the main path, and contain them to a pre-pass + a post-pass kind of polonius leak check. If possible, it would fix this issue by turning an outlives constraints to a placeholder into a constraint to 'static. This should also fix the issue, as the representative would be the free region in the SCC. We want to prototype this change to see if it's possible to try to simplify the borrowck main path from having to deal with placeholders and higher-ranked subtyping 🤞.

I'd like to take advantage of fuzzing and a crater run sooner rather than later, so that we grow more confidence that the 2 models are indeed equivalent empirically. Therefore this PR implements option 1 to fix the issue now.

We can take care of efficiency later after validation, and once we implement option 3 (which could also impact option 2 and that associated PR, maybe the lack of placeholders could remove the need to change the representative computation) to traverse SCCs and their representative again.

(Or we maybe will have some kind of naive position-dependent outlives propagation by then and this code would have been changed)

Fixes #117146.

r? `@matthewjasper`
2023-11-08 16:13:37 +00:00
Ramon de C Valle
7c385f5a03 Update exploit mitigations documentation
Updates the rustc book with most up to date information about exploit
mitigations supported by the Rust compiler.
2023-11-08 07:27:57 -08:00
Guillaume Gomez
33edea60f0 Add test for reexported hidden item with --document-hidden-items 2023-11-08 15:44:58 +01:00
Max Tilley
1854776fa9 Reorder type mismatch suggestions
Suggestions are reordered to to make sure potential missing expect on Option/Result runs
before the suggestion to remove the last method call
2023-11-08 14:15:25 +00:00
bors
28acba3c61 Auto merge of #115460 - zachs18:borrowedcursor_write_no_panic, r=dtolnay
Don't panic in `<BorrowedCursor as io::Write>::write`

Instead of panicking if the BorrowedCursor does not have enough capacity for the whole buffer, just return a short write, [like `<&mut [u8] as io::Write>::write` does](https://doc.rust-lang.org/src/std/io/impls.rs.html#349).

(cc `@ChayimFriedman2` https://github.com/rust-lang/rust/issues/78485#issuecomment-1493129588)

(I'm not sure if this needs an ACP? since it's not changing the "API", just what the function does)
2023-11-08 14:08:48 +00:00
Jake Goulding
6909992501 Run tests in CI for aarch64-apple-darwin 2023-11-08 08:54:42 -05:00
Jake Goulding
64090536d4 Install tidy for aarch64-apple-darwin
The GitHub Actions image has this preinstalled for x86_64 but not M1.
2023-11-08 08:54:42 -05:00
Jake Goulding
469d34b39b Mark Rustdoc test as Linux-only
Due to incorrect CI configuration, this test was not being run on
macOS. aarch64-apple-darwin will start running it, so we correct the
configuration.
2023-11-08 08:53:58 -05:00
bors
755629fe59 Auto merge of #117706 - matthiaskrgr:rollup-lscx7dg, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #114316 (Add AIX platform support document)
 - #117531 (rustdoc: properly elide cross-crate host effect args)
 - #117650 (Add -Zcross-crate-inline-threshold=yes)
 - #117663 (bump some deps)
 - #117667 (Document clippy_config in nightly-rustc docs)
 - #117698 (Clarify `space_between`)
 - #117700 (coverage: Rename the `run-coverage` test mode to `coverage-run`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-08 12:06:04 +00:00
lcnr
bf360d407e instrument constituent types computation 2023-11-08 12:24:42 +01:00
onur-ozkan
e0cb1cc296 bootstrap: add more detail on change-id comments
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-08 14:06:45 +03:00
onur-ozkan
e878100386 bootstrap: improve fn check_version
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-08 14:06:01 +03:00
onur-ozkan
ae4d18b2da handle the case when the change-id isn't found
When we switch back and forth between the old and recent branches,
if there was a breaking change in the bootstrap configuration in
between, we have to update the change-id in the build configuration
with each checkout, which can be exhausting. This change fixes that.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-08 14:05:56 +03:00
Matthias Krüger
7e4ffa98b5
Rollup merge of #117700 - Zalathar:rename-run-coverage, r=onur-ozkan
coverage: Rename the `run-coverage` test mode to `coverage-run`

Follow-up to https://github.com/rust-lang/rust/pull/117484#issuecomment-1788916563.

Renaming this test mode to `coverage-run` makes it more consistent with the `coverage-map` mode and the shared `tests/coverage` test directory.

---

``@rustbot`` label +A-code-coverage
2023-11-08 11:25:56 +01:00
Matthias Krüger
55306535dd
Rollup merge of #117698 - nnethercote:space_between-2, r=petrochenkov
Clarify `space_between`

r? ``@petrochenkov``
2023-11-08 11:25:56 +01:00
Matthias Krüger
b1b5a8ea9d
Rollup merge of #117667 - Alexendoo:doc-clippy-config, r=albertlarsan68
Document clippy_config in nightly-rustc docs

A new clippy crate added in https://github.com/rust-lang/rust-clippy/pull/11685
2023-11-08 11:25:56 +01:00
Matthias Krüger
adf4981969
Rollup merge of #117663 - klensy:bump-deps, r=davidtwco
bump some deps

* drop `num_cpus` from rust-installer as not used
* update `rayon`, `rayon-core`, which drops it's deps on `num_cpus` and `crossbeam-channel` (for bootstrap too) (https://github.com/rayon-rs/rayon/blob/v1.8.0/RELEASES.md)
* update `errno`, which drops `errno-dragonfly` (5341791935/CHANGELOG.md)
2023-11-08 11:25:55 +01:00
Matthias Krüger
8198864377
Rollup merge of #117650 - saethlin:inline-me-please, r=davidtwco
Add -Zcross-crate-inline-threshold=yes

``@thomcc`` says this would be useful for

>  seeing if it makes a difference in some code if i do it when building the sysroot, since -Zbuild-std + lto helps more than it seems like it should

And I've changed the possible values as a reference to ``@Manishearth`` saying

> LLVM's inlining heuristic is "yes".
2023-11-08 11:25:54 +01:00
Matthias Krüger
ba7ec56639
Rollup merge of #117531 - fmease:rustdoc-effects-properly-elide-x-crate-host-args, r=GuillaumeGomez
rustdoc: properly elide cross-crate host effect args

Fixes FIXMEs introduced in #116670.
2023-11-08 11:25:54 +01:00
Matthias Krüger
b74a84c0bc
Rollup merge of #114316 - ecnelises:aix_doc, r=workingjubilee
Add AIX platform support document
2023-11-08 11:25:54 +01:00
Tshepang Mbambo
03435e6fdd
accept review suggestion
Co-authored-by: joboet <jonasboettiger@icloud.com>
2023-11-08 12:19:32 +02:00
bors
fab1054e17 Auto merge of #117542 - compiler-errors:only-normalize-predicate, r=lcnr
Only use `normalize_param_env` when normalizing predicate in `check_item_bounds`

Only use the `normalize_param_env` when normalizing the item bound predicate in `check_item_bounds`, instead of using it when processing this obligation as well. This causes <BUG> to reoccur, but hopefully with better caching in the future, we can fix this would having such bad effects on perf.

This PR also fixes #117598. It turns out that the GAT predicate that we install is actually wrong -- given code like:

```
impl<'r> HasValueRef<'r> for Any {
    type Database = Any;
}
```

We currently generate a predicate that looks like `<Any as HasValueRef<'r>>::Database = Any`, where `'r` is an early-bound variable. Really this GAT assumption should be universally quantified over the impl's args, i.e. `for<'r> <Any as HasValueRef<'r>>::Database = Any`, but then we'd need the binder to also include all the WC of the impl as well, which we don't support yet, lol.
2023-11-08 10:08:44 +00:00
Tshepang Mbambo
769ad29c3e
triagebot.toml: use inclusive language 2023-11-08 11:21:44 +02:00
bors
750c2ecd15 Auto merge of #116881 - LuuuXXX:issue-110087, r=onur-ozkan
Add a new `download-ci-llvm = if-unchanged` option and enable it by default for `profile = codegen`

Three tasks have been implemented here.

Add a new `download-ci-llvm = if-unchange` option and enable if by
default for `profile = codegen`.

Include all build artifacts by traversing the llvm-project build output,
Keep the downloadable llvm the same state as if you have just run a full
source build.

After selecting the codegen profile during ./x.py setup, the submodule
will be automatically downloaded.

Resolves #110087
2023-11-08 08:08:50 +00:00
Qiu Chaofan
b9b7982f72 Add AIX platform-support doc 2023-11-08 15:03:56 +08:00
David Wood
ef7ebaa788
rustc_target: move file for uniformity
Signed-off-by: David Wood <david@davidtw.co>
2023-11-08 14:37:54 +08:00
David Wood
1af256fe8a
targets: move target specs to spec/targets
Signed-off-by: David Wood <david@davidtw.co>
2023-11-08 14:25:45 +08:00
David Wood
76aa83e3e1
target: move base specs to spec/base
Signed-off-by: David Wood <david@davidtw.co>
2023-11-08 14:15:26 +08:00
Laurențiu Nicola
626bd33e1e Merge commit '3b7c7f97e4a7bb253a8d398ee4f8346f6cf2817b' into sync-from-ra 2023-11-08 08:15:03 +02:00
Zalathar
a573880373 coverage: Rename the run-coverage test mode to coverage-run
This makes it more consistent with the `coverage-map` mode and the shared
`tests/coverage` test directory.
2023-11-08 16:41:24 +11:00
bors
7cc997d373 Auto merge of #117699 - weihanglo:update-cargo, r=weihanglo
Update cargo

7 commits in 65e297d1ec0dee1a74800efe600b8dc163bcf5db..7046d992f9f32ba209a8079f662ebccf9da8de25
2023-11-03 20:56:31 +0000 to 2023-11-08 03:24:57 +0000
- fix: Report more detailed semver errors (rust-lang/cargo#12924)
- Fix some broken links in the man pages (rust-lang/cargo#12929)
- Add better error message when it can not find the search section (rust-lang/cargo#12865)
- Bug 12920 (rust-lang/cargo#12923)
- Update link in environment-variables.md (rust-lang/cargo#12922)
- refactor(toml): Pull out the schema (rust-lang/cargo#12911)
- tests: Remove plugin tests (rust-lang/cargo#12921)

r? ghost
2023-11-08 05:05:04 +00:00
Weihang Lo
0670466e2c
Update cargo 2023-11-07 23:40:22 -05:00
Nicholas Nethercote
438b9a6e82 More tests for token stream pretty-printing with adjacent punctuation.
We currently do the wrong thing on a lot of these. The next commit will
fix things.
2023-11-08 14:39:59 +11:00
Nicholas Nethercote
783d4b8b26 Clarify space_between.
To avoid `!matches!(...)`, which is hard to think about. Instead every
case now uses direct pattern matching and returns true or false.

Also add a couple of cases to the `stringify.rs` test that currently
print badly.
2023-11-08 14:39:59 +11:00
bors
91cfcb0219 Auto merge of #117484 - Zalathar:tests, r=cjgillot
coverage: Unify `tests/coverage-map` and `tests/run-coverage` into `tests/coverage`

Ever since the introduction of the `coverage-map` suite, it's been awkward to have to manage two separate coverage test directories containing dozens of mostly-identical files.

However, those two suites were separate for good reasons. They have very different requirements (since only one of them requires actually running the test program), running only one suite is noticeably faster than running both, and having separate suites allows them to be blessed separately if desired. So while unifying them was an obvious idea, actually doing so was non-trivial.

---

Nevertheless, this PR finds a way to merge the two suites into one directory while retaining almost all of the developer-experience benefits of having two suites. This required non-trivial implementations of `Step`, but the end result works very smoothly.

---

The first 5 commits are a copy of #117340, which has been closed in favour of this PR.
2023-11-08 03:00:14 +00:00
scottmcm
545175ce87
Fix addition formatting 2023-11-07 18:39:09 -08:00
Michael Goulet
97c9d8f405 Only use normalize_param_env when normalizing predicate in check_item_bounds 2023-11-08 02:35:25 +00:00
LuuuX
1b8dee19e8 Fix issue #110087
Three tasks have been implemented here.

Add a new `download-ci-llvm = if-unchange` option and enable if by
default for `profile = codegen`.

Include all build artifacts by traversing the llvm-project build output,
Keep the downloadable llvm the same state as if you have just run a full
source build.

After selecting the codegen profile during ./x.py setup, the submodule
will be automatically downloaded.
2023-11-08 09:22:28 +08:00
bors
0d5ec963bb Auto merge of #117692 - matthiaskrgr:rollup-umaf5pr, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #113925 (Improve diagnostic for const ctors in array repeat expressions)
 - #116399 (Small changes w/ `query::Erase<_>`)
 - #117625 (Fix some clippy perf lints)
 - #117655 (Method suggestion code tweaks)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-08 01:01:58 +00:00
Matthias Krüger
f72e974e3f
Rollup merge of #117655 - compiler-errors:method-tweaks, r=estebank
Method suggestion code tweaks

I was rummaging around the method suggestion code after https://github.com/rust-lang/rust/pull/117006#discussion_r1384153722 and saw a few things to simplify.

This is two unrelated commits, both in the same file. Review them separately, if you'd like.

r? estebank
2023-11-08 00:47:52 +01:00
Matthias Krüger
7552dd19ad
Rollup merge of #117625 - nnethercote:clippy-perf, r=cuviper
Fix some clippy perf lints

`@matthiaskrgr` gave me the output of a clippy run with perf lints enabled. This PR fixes ones that I thought were worth fixing.

r? `@cuviper`
2023-11-08 00:47:51 +01:00
Matthias Krüger
3c6307240c
Rollup merge of #116399 - WaffleLapkin:erase_small_things, r=cjgillot
Small changes w/ `query::Erase<_>`

r? `@cjgillot`
cc `@Zoxc`
2023-11-08 00:47:51 +01:00
Matthias Krüger
b724d9c90e
Rollup merge of #113925 - clubby789:const-ctor-repeat, r=estebank
Improve diagnostic for const ctors in array repeat expressions

Fixes #113912
2023-11-08 00:47:50 +01:00
Ben Kimock
fcdd99edca Add -Zcross-crate-inline-threshold=yes 2023-11-07 18:45:11 -05:00
Nicholas Nethercote
e8cf29b584 rustdoc: minor changes suggested by clippy perf lints. 2023-11-08 09:35:35 +11:00
bors
3b7c7f97e4 Auto merge of #15849 - HKalbasi:fix-sync, r=HKalbasi
Update rustc dependencies

Except `rustc_parse_format` that was broken by upstream.
2023-11-07 22:13:41 +00:00
bors
ff0b4b6091 Auto merge of #117672 - lqd:ci-gcc-lld, r=Kobzol
ci: bump gcc on dist x64 linux builder to 9.5

Support for `-fuse-ld=lld` was added in GCC 9, so this PR bumps gcc to the latest 9.x release, to prepare for switching to LLD.

`-Clinker-flavor=gnu-lld-cc -Clink-self-contained=+linker` will require our CI's GCC to understand `-fuse-ld=lld` when bootstrapping in a future where `x86_64-unknown-linux-gnu` is using `rust-lld` by default.
2023-11-07 22:07:23 +00:00
Nicholas Nethercote
1b3733e5a4 rustc: minor changes suggested by clippy perf lints. 2023-11-08 08:57:57 +11:00
hkalbasi
1086b294c2 update rustc dependencies 2023-11-08 01:16:47 +03:30