about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-05-03Rollup merge of #111154 - djkoloski:use_builtin_ffx_isolation, r=tmandryManish Goregaokar-92/+45
Use builtin FFX isolation for Fuchsia test runner FFX has new builtin support for isolating the daemon's environment. This switches the manual isolation originally written to that new builtin feature. r? ````@tmandry````
2023-05-03Rollup merge of #111146 - petrochenkov:decident, r=compiler-errorsManish Goregaokar-42/+88
rustc_middle: Fix `opt_item_ident` for non-local def ids Noticed while working on https://github.com/rust-lang/rust/pull/110855.
2023-05-03Rollup merge of #111127 - xfix:const-slice-flatten, r=scottmcmManish Goregaokar-1/+1
Constify slice flatten method ACP: https://github.com/rust-lang/libs-team/issues/218
2023-05-03Rollup merge of #111104 - Manishearth:icuup, r=compiler-errorsManish Goregaokar-2042/+212
Update ICU4X to 1.2 Was released a couple weeks ago. Also needed to make progress on https://github.com/rust-lang/rust/issues/109302 (though this PR does not achieve that part just yet)
2023-05-03Rollup merge of #110970 - est31:test_dirs_relax, r=petrochenkovManish Goregaokar-5/+2
tidy: remove ENTRY_LIMIT maximum checking and set it to 900 Removes checking of `ENTRY_LIMIT` towards an actually reached maximum, and sets it to 900. The number 900 is safely below github's limit of 1000 entries for a directory. PRs to move tests can still decrease the sizes of various directories, but adjusting the limit won't be neccessary any more. In fact, such reduction PRs are a great idea so that no unrelated PR is hitting the limit: ideally there would always be a (manually maintained) safety margin between the actually reached maximum and `ENTRY_LIMIT`, for all directories. In general, the limit is a bad tool to direct people to put tests into fitting directories because when those are available, usually the limit is not hit, while the limit is hit in directories that have a weak substructure themselves. I got into this situation myself when writing #110694: tests/ui/parser is hitting the limit, but has few directories of its own. Suggested by ```@petrochenkov``` in https://github.com/rust-lang/rust/pull/110694#discussion_r1177694339. r? ```@petrochenkov```
2023-05-03Rollup merge of #110928 - loongarch-rs:tests, r=petrochenkovManish Goregaokar-23/+364
tests: Add tests for LoongArch64
2023-05-03Rollup merge of #110371 - notriddle:notriddle/search-corrections, ↵Manish Goregaokar-205/+361
r=GuillaumeGomez rustdoc: restructure type search engine to pick-and-use IDs Fixes #110029 Preview: https://notriddle.com/rustdoc-demo-html-3/search-corrections/std/index.html?search=-%3E%20streaming ![image](https://user-images.githubusercontent.com/1593513/233494900-ae77d5b4-e395-41f8-bbac-53ee55bb4a76.png) This change makes it so, instead of mixing string distance with type unification, function signature search works by mapping names to IDs at the start, reporting to the user any cases where it had to make corrections, and then matches with IDs when going through the items. This only changes function searches. Name searches are left alone, and corrections are only done when there's a single item in the search query.
2023-05-03Rollup merge of #105695 - joboet:remove_generic_parker, r=m-ou-seManish Goregaokar-129/+17
Replace generic thread parker with explicit no-op parker With #98391 merged, all platforms supporting threads now have their own parking implementations. Therefore, the generic implementation can be removed. On the remaining platforms (really just WASM without atomics), parking is not supported, so calls to `thread::park` now return instantly, which is [allowed by their API](https://doc.rust-lang.org/nightly/std/thread/fn.park.html). This is a change in behaviour, as spurious wakeups do not currently occur since all platforms guard against them. It is invalid to depend on this, but I'm still going to tag this as libs-api for confirmation. ````@rustbot```` label +T-libs +T-libs-api +A-atomic r? rust-lang/libs
2023-05-03Rollup merge of #105452 - rcvalle:rust-cfi-3, r=bjorn3Manish Goregaokar-404/+1510
Add cross-language LLVM CFI support to the Rust compiler This PR adds cross-language LLVM Control Flow Integrity (CFI) support to the Rust compiler by adding the `-Zsanitizer-cfi-normalize-integers` option to be used with Clang `-fsanitize-cfi-icall-normalize-integers` for normalizing integer types (see https://reviews.llvm.org/D139395). It provides forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space). For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653. Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and -Zsanitizer-cfi-normalize-integers, and requires proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto). Thank you again, ``@bjorn3,`` ``@nikic,`` ``@samitolvanen,`` and the Rust community for all the help!
2023-05-03Rollup merge of #97594 - WaffleLapkin:array_tuple_conv, r=ChrisDentonManish Goregaokar-5/+78
Implement tuple<->array convertions via `From` This PR adds the following impls that convert between homogeneous tuples and arrays of the corresponding lengths: ```rust impl<T> From<[T; 1]> for (T,) { ... } impl<T> From<[T; 2]> for (T, T) { ... } /* ... */ impl<T> From<[T; 12]> for (T, T, T, T, T, T, T, T, T, T, T, T) { ... } impl<T> From<(T,)> for [T; 1] { ... } impl<T> From<(T, T)> for [T; 2] { ... } /* ... */ impl<T> From<(T, T, T, T, T, T, T, T, T, T, T, T)> for [T; 12] { ... } ``` IMO these are quite uncontroversial but note that they are, just like any other trait impls, insta-stable.
2023-05-03Update documentation for LLVM CFI supportRamon de C Valle-17/+126
This commit updates the documentation for the LLVM Control Flow Integrity (CFI) support in the Rust compiler.
2023-05-03Add cross-language LLVM CFI support to the Rust compilerRamon de C Valle-387/+1384
This commit adds cross-language LLVM Control Flow Integrity (CFI) support to the Rust compiler by adding the `-Zsanitizer-cfi-normalize-integers` option to be used with Clang `-fsanitize-cfi-icall-normalize-integers` for normalizing integer types (see https://reviews.llvm.org/D139395). It provides forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space). For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653. Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and -Zsanitizer-cfi-normalize-integers, and requires proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto).
2023-05-03Mention array<->tuple convs in docsMaybe Waffle-0/+40
2023-05-03Auto merge of #111153 - Dylan-DPC:rollup-0pq0hh3, r=Dylan-DPCbors-579/+846
Rollup of 11 pull requests Successful merges: - #107978 (Correctly convert an NT path to a Win32 path in `read_link`) - #110436 (Support loading version information from xz tarballs) - #110791 (Implement negative bounds for internal testing purposes) - #110874 (Adjust obligation cause code for `find_and_report_unsatisfied_index_impl`) - #110908 (resolve: One more attempt to simplify `module_children`) - #110943 (interpret: fail more gracefully on uninit unsized locals) - #111062 (Don't bail out early when checking invalid `repr` attr) - #111069 (remove pointless `FIXME` in `bootstrap::download`) - #111086 (Remove `MemEncoder`) - #111097 (Avoid ICEing miri on layout query cycles) - #111112 (Add some triagebot notifications for nnethercote.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-03Use builtin FFX isolation for Fuchsia test runnerDavid Koloski-92/+45
FFX has new builtin support for isolating the daemon's environment. This switches the manual isolation originally written to that new builtin feature.
2023-05-04Rollup merge of #111112 - nnethercote:triagebot, r=compiler-errorsDylan DPC-3/+11
Add some triagebot notifications for nnethercote. r? ````@compiler-errors````
2023-05-04Rollup merge of #111097 - oli-obk:🚲_layout, r=compiler-errorsDylan DPC-44/+119
Avoid ICEing miri on layout query cycles Miri has special logic for catching panics during interpretation. Raising a fatal error in rustc uses unwinding to abort compilation. Thus miri ends up catching that fatal error and thinks it saw an ICE. While we should probably change that to ignore `Fatal` payloads, I think it's also neat to continue compilation after a layout query cycle 😆 Query cycles now (in addition to reporting an error just like before), return `Err(Cycle)` instead of raising a fatal error. This allows the interpreter to wind down via the regular error paths. r? `@RalfJung` for a first round, feel free to reroll for the compiler team once the miri side looks good
2023-05-04Rollup merge of #111086 - nnethercote:rm-MemEncoder, r=cjgillotDylan DPC-248/+63
Remove `MemEncoder` `MemEncoder` only has one non-test use, and `FileEncoder` would be more appropriate there anyway. r? ``@cjgillot``
2023-05-04Rollup merge of #111069 - ozkanonur:remove-pointless-fixme, r=albertlarsan68Dylan DPC-1/+0
remove pointless `FIXME` in `bootstrap::download` The suggestion given by `FIXME` to use `CompilerMetadata` for `download_toolchain` in `bootstrap::download` can result in more confusion. This is because `stamp_key` is not always a date; it can also be a commit hash. Additionally, unlike in `download_beta_toolchain`, in the `download_ci_rustc` function, `version` and `commit` values are calculated separately.
2023-05-04Rollup merge of #111062 - clubby789:invalid-repr-unchecked, r=petrochenkovDylan DPC-8/+25
Don't bail out early when checking invalid `repr` attr Fixes #111051 An invalid repr delays a bug. If there are other invalid attributes on the item, we emit a warning and exit without re-checking the repr here, so no error is emitted and the delayed bug ICEs
2023-05-04Rollup merge of #110943 - RalfJung:interpret-unsized-arg-ice, r=oli-obkDylan DPC-1/+20
interpret: fail more gracefully on uninit unsized locals r? `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/68538
2023-05-04Rollup merge of #110908 - petrochenkov:notagain4, r=compiler-errorsDylan DPC-53/+45
resolve: One more attempt to simplify `module_children` If the next step is performed and `fn module_children_local` is merged with the `module_children` query, then it causes perf regressions, regardless of whether query result feeding is [used](https://perf.rust-lang.org/compare.html?start=43a78029b4f4d92978b8fde0a677ea300b113c41&end=2eb5bcc5068b9d92f74bcb1797da664865d6981d&stat=instructions:u) or [not](https://perf.rust-lang.org/compare.html?start=2fce2290865f012391b8f3e581c3852a248031fa&end=2a33d6cd99481d1712037a79e7d66a8aefadbf72&stat=instructions:u).
2023-05-04Rollup merge of #110874 - compiler-errors:index-op-specific, r=oli-obkDylan DPC-15/+28
Adjust obligation cause code for `find_and_report_unsatisfied_index_impl` Makes the error message a bit easier to read.
2023-05-04Rollup merge of #110791 - compiler-errors:negative-bounds, r=oli-obkDylan DPC-185/+478
Implement negative bounds for internal testing purposes Implements partial support the `!` negative polarity on trait bounds. This is incomplete, but should allow us to at least be able to play with the feature. Not even gonna consider them as a public-facing feature, but I'm implementing them because would've been nice to have in UI tests, for example in #110671.
2023-05-04Rollup merge of #110436 - Mark-Simulacrum:support-xz-version, r=pietroalbiniDylan DPC-7/+31
Support loading version information from xz tarballs This is intended to allow us to move recompression from xz (produced in CI) to gz after an initial manifest run, which produces a list of actually required artifacts. The rest are then deleted, which means that we can avoid recompressing them, saving a bunch of time. This is essentially untested and more might be needed, will run a patched promote-release against try artifacts from this PR. If we do go ahead with this we'll either need to backport this patch to beta/stable, wait for it to propagate, or temporarily recompress to gzip but not xz tarballs (or similar). r? `@pietroalbini`
2023-05-04Rollup merge of #107978 - ChrisDenton:nt-to-win32, r=m-ou-seDylan DPC-14/+26
Correctly convert an NT path to a Win32 path in `read_link` This can be done by simply changing the `\??\` prefix to `\\?\`. Currently it strips off the prefix which could lead to the wrong path being returned (e.g. if it's not a drive path or if the path contains trailing spaces, etc). r? libs
2023-05-03rustc_middle: Fix `opt_item_ident` for non-local def idsVadim Petrochenkov-42/+88
2023-05-03Auto merge of #110865 - cuviper:ct-ng-1.25, r=pietroalbinibors-10265/+346
ci: upgrade and refactor crosstool-ng builders The first commit upgrades our builders from crosstool-ng 1.24.0 to 1.25.0. There are otherwise no changes intended to the toolchains we're using, but there are some minor version upgrades as a result, especially GCC 8.3.0 to 8.5.0. The newer crosstool-ng will position us well to make toolchain upgrades in the future though, as we were maxed out before and it now goes up to GCC 11. The second commit refactors our config management to only commit a "mini-defconfig" for each target, produced by `ct-ng savedefconfig`. This makes it much clearer which settings we're actually changing, and also makes it easier to ensure consistency for things like mirror management.
2023-05-03Constify slice flatten methodKonrad Borowski-1/+1
2023-05-03Use `from_wide_to_user_path` in `read_link`Chris Denton-4/+7
2023-05-03Correctly convert an NT path to a Win32 pathChris Denton-12/+21
This can be done by simply changing the `\??\` prefix to `\\?\` and then attempting to convert to a user path. Currently it simply strips off the prefix which could lead to the wrong path being returned (e.g. if it's not a drive path or if the path contains trailing spaces, etc).
2023-05-03Auto merge of #110846 - jdno:reduce-builder-sizes, r=pietroalbinibors-14/+18
Optimize builder sizes The infra-team is continuously monitoring the efficiency of the CI system in an effort to improve overall build times and resource usage. Some builders have used much less than their allocated resources, so we are testing smaller builder sizes for them. r? `@pietroalbini`
2023-05-03Auto merge of #111107 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 16 commits in 9e586fbd8b931494067144623b76c37d213b1ab6..ac84010322a31f4a581dafe26258aa4ac8dea9cd 2023-04-25 22:09:11 +0000 to 2023-05-02 13:41:16 +0000 - docs(registry): Further specify owner-remove response (rust-lang/cargo#12056) (rust-lang/cargo#12068) - Remove repeated definite articles (rust-lang/cargo#12067) - Document that adding `#[non_exhaustive]` on existing items is breaking. (rust-lang/cargo#10877) - docs(commands): add missed preposition (rust-lang/cargo#12073) - Fix warning with unused mut (rust-lang/cargo#12065) - chore: move build-man workflow away from shell (rust-lang/cargo#12048) - feat: Add `-Zmsrv-policy` feature flag (rust-lang/cargo#12043) - chore: new xtask to check stale paths in autolabel defintions (rust-lang/cargo#12051) - cargo-tree: Handle -e no-proc-macro when building the graph (rust-lang/cargo#12044) - chore: update trigger_files in autolabel (rust-lang/cargo#12052) - fix broken markdown in docs (rust-lang/cargo#12049) - home: fix & enhance documentation (rust-lang/cargo#12047) - chore: Mark unpublished crates as such (rust-lang/cargo#12045) - Include rust-version in publish request (rust-lang/cargo#12041) - chore(xtask): Add `cargo xtask unpublished` (rust-lang/cargo#12039) - docs(ref): Specify 'rust_version' in Index format (rust-lang/cargo#12040) r? `@ghost`
2023-05-03Auto merge of #110579 - nnethercote:restrict-From-for-Diagnostics, r=davidtwcobors-787/+791
Restrict `From<S>` for `{D,Subd}iagnosticMessage`. Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile. r? `@davidtwco`
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-787/+791
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-05-02Rustfmt support for negative bounds, testMichael Goulet-2/+17
2023-05-02Make negative trait bounds work with the old trait solverMichael Goulet-14/+36
2023-05-02Make tools happyMichael Goulet-0/+7
2023-05-02Disallow associated type constraints on negative boundsMichael Goulet-2/+76
2023-05-02Implement negative boundsMichael Goulet-185/+360
2023-05-03Amend the triagebot comment for `Cargo.lock` changes.Nicholas Nethercote-3/+3
I don't like the current wording. It's obnoxious to be told by a bot that a change I made intentionally is "probably unintentional"! I also don't like describing unintentional changes as "Random", it's not the right word.
2023-05-03Add some triagebot notifications for nnethercote.Nicholas Nethercote-0/+8
2023-05-02Auto merge of #109729 - fortanix:raoul/bugfix_libtest_json_synchronization, ↵bors-70/+62
r=pietroalbini Ensure test library issues json string line-by-line #108659 introduces a custom test display implementation. It does so by using libtest to output json. The stdout is read line by line and parsed. The code trims the line read and checks whether it starts with a `{` and ends with a `}`. Unfortunately, there is a race condition in how json data is written to stdout. The `write_message` function calls `self.out.write_all` repeatedly to write a buffer that contains (partial) json data, or a new line. There is no lock around the `self.out.write_all` functions. Similarly, the `write_message` function itself is called with only partial json data. As these functions are called from concurrent threads, this may result in json data ending up on the same stdout line. This PR avoids this by buffering the complete json data before issuing a single `self.out.write_all`. (#109484 implemented a partial fix for this issue; it only avoids that failed json parsing would result in a panic.) cc: `@jethrogb,` `@pietroalbini`
2023-05-02Update cargoWeihang Lo-0/+0
2023-05-02Auto merge of #111028 - compiler-errors:attr-query-no-caching, r=cjgillotbors-10/+0
Make some simple queries no longer cache on disk I don't think we need to cache queries with really simple local providers, like loading hir and accessing an attr r? `@ghost`
2023-05-02Regen baked dataManish Goregaokar-2018/+188
2023-05-02Update ICU4X to 1.2Manish Goregaokar-24/+24
2023-05-02Avoid ICEing miri on layout query cyclesOli Scherer-44/+119
2023-05-02--bless testsMaybe Waffle-5/+18
2023-05-02Remove `[]` <-> `()` `From` convertionsMaybe Waffle-14/+0
... with this convertions some tests fail :(