about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-05-04Don't compute trait super bounds unless they're positiveMichael Goulet-5/+25
2023-05-04Auto merge of #111174 - matthiaskrgr:rollup-ncnqivh, r=matthiaskrgrbors-182/+326
Rollup of 8 pull requests Successful merges: - #110859 (Explicitly reject negative and reservation drop impls) - #111020 (Validate resolution for SelfCtor too.) - #111024 (Use the full Fingerprint when stringifying Svh) - #111027 (Remove `allow(rustc::potential_query_instability)` for `builtin_macros`) - #111039 (Encode def span for foreign return-position `impl Trait` in trait) - #111070 (Don't suffix `RibKind` variants) - #111094 (Add needs-unwind annotations to tests that need stack unwinding) - #111103 (correctly recurse when expanding anon consts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-04Rollup merge of #111103 - BoxyUwU:normal_fold_with_gce_norm, r=compiler-errorsMatthias Krüger-12/+15
correctly recurse when expanding anon consts recursing with `super_fold_with` is wrong in case `bac` is itself normalizable, the test that was supposed to test for this being wrong did not actually test for this in reality because of the usage of `{ (N) }` instead of `{{ N }}`. The former resulting in a simple `ConstKind::Param` instead of `ConstKind::Unevaluated`. Tbh generally this test seems very brittle and it will be a lot easier to test once we have normalization of assoc consts since then we can just test that `T::ASSOC` normalizes to some `U::OTHER` which normalizes to some third thing. r? `@compiler-errors`
2023-05-04Rollup merge of #111094 - bjorn3:fix_test_annotations, r=jyn514Matthias Krüger-0/+13
Add needs-unwind annotations to tests that need stack unwinding This allows filtering them out when running the rustc test suite for cg_clif.
2023-05-04Rollup merge of #111070 - WaffleLapkin:break_ribs, r=lcnrMatthias Krüger-116/+113
Don't suffix `RibKind` variants This PR - Removes `use RibKind::*` - Renames `RibKind::{SomethingRibKind => Something}` It seems unnecessary to have "RibKind" in the end of all variants, if we can just use it as a normal enum. Additionally previously it was weird that `MacroDefinition` is the only unsuffixed variant.
2023-05-04Rollup merge of #111039 - compiler-errors:foreign-span-rpitit, r=tmiaskoMatthias Krüger-7/+32
Encode def span for foreign return-position `impl Trait` in trait Fixes #111031, yet another def-span encoding issue :/ Includes a smaller repro than the issue, but I can confirm it ICEs: ``` query stack during panic: #0 [def_span] looking up span for `rpitit::Foo::bar::{opaque#0}` #1 [object_safety_violations] determining object safety of trait `rpitit::Foo` #2 [check_is_object_safe] checking if trait `rpitit::Foo` is object safe #3 [typeck] type-checking `main` #4 [used_trait_imports] finding used_trait_imports `main` #5 [analysis] running analysis passes on this crate ``` Luckily since this only affects nightly, this desn't need to be backported.
2023-05-04Rollup merge of #111027 - clubby789:query-instability-builtin-macros, ↵Matthias Krüger-11/+13
r=petrochenkov Remove `allow(rustc::potential_query_instability)` for `builtin_macros` cc #84447
2023-05-04Rollup merge of #111024 - saethlin:stringify-full-svh, r=oli-obkMatthias Krüger-6/+11
Use the full Fingerprint when stringifying Svh Finally circling back, per https://github.com/rust-lang/rust/pull/110367#discussion_r1168340739 r? `@oli-obk`
2023-05-04Rollup merge of #111020 - cjgillot:validate-self-ctor, r=petrochenkovMatthias Krüger-2/+55
Validate resolution for SelfCtor too. Fixes https://github.com/rust-lang/rust/issues/89868 r? `@petrochenkov`
2023-05-04Rollup merge of #110859 - compiler-errors:no-negative-drop-impls, r=oli-obkMatthias Krüger-28/+74
Explicitly reject negative and reservation drop impls Fixes #110858 It doesn't really make sense for a type to have a `!Drop` impl. Or at least, I don't want us to implicitly assign a meaning to it by the way the compiler *currently* handles it (incompletely), and rather I would like to see a PR (or an RFC...) assign a meaning to `!Drop` if we actually wanted one for it.
2023-05-04Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnrbors-180/+245
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
2023-05-04Auto merge of #111169 - Manishearth:rollup-55sfaad, r=Manishearthbors-2948/+2678
Rollup of 10 pull requests Successful merges: - #97594 (Implement tuple<->array convertions via `From`) - #105452 (Add cross-language LLVM CFI support to the Rust compiler) - #105695 (Replace generic thread parker with explicit no-op parker) - #110371 (rustdoc: restructure type search engine to pick-and-use IDs) - #110928 (tests: Add tests for LoongArch64) - #110970 (tidy: remove ENTRY_LIMIT maximum checking and set it to 900) - #111104 (Update ICU4X to 1.2) - #111127 (Constify slice flatten method) - #111146 (rustc_middle: Fix `opt_item_ident` for non-local def ids) - #111154 (Use builtin FFX isolation for Fuchsia test runner) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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-03Auto merge of #111141 - ChrisDenton:ps-exitcode, r=jyn514bors-0/+7
Return error code from x.ps1 Fixes #111136 This works around a bug where `ExitCode` does not return the exit code. See: https://stackoverflow.com/a/23797762
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-03Validate resolution for SelfCtor too.Camille GILLOT-2/+55
2023-05-03Return error code from x.ps1Chris Denton-0/+7
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.