about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-07-14Rollup merge of #113698 - compiler-errors:rpitit-check, r=spastorinoMatthias Krüger-10/+14
Make it clearer that we're just checking for an RPITIT Tiny nit to use `is_impl_trait_in_trait` more, to make it clearer that we're just checking whether a def-id is an RPITIT, rather than doing something meaningful with the `opt_rpitit_info`. r? `@spastorino`
2023-07-14Rollup merge of #113692 - krasimirgg:llvm-17-no-opaque, r=nikicMatthias Krüger-0/+2
tests: adapt for removal of -opaque-pointers in LLVM 17 The commit https://github.com/llvm/llvm-project/commit/53717cabf837a589dd54a47dd8b4b3b9677f0b85 removed the flag from LLVM. Found via our experimental rust + LLVM@HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/20777#01895454-40b2-4e2f-978b-1294a83e1cce
2023-07-14Rollup merge of #113688 - krasimirgg:llvm-17-small-string, r=nikicMatthias Krüger-0/+1
llvm-wrapper: update for LLVM API change No functional changes intended. Adds an include for `llvm::SmallString`. Previously, this must have been implicitly provided by some of the existing headers. With recent LLVM changes, not anymore: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/20776#01895448-44a4-4a1e-8407-9d41d0186132/209-690
2023-07-14Rollup merge of #113685 - Kobzol:opt-dist-binary-sizes, r=Mark-SimulacrumMatthias Krüger-5/+45
Print artifact sizes in `opt-dist` The Python PGO script printed a nice table of artifact sizes (`librustc_driver.so`, `libLLVM.so`, ...) at the end of the CI run, which was useful to quickly see the sizes of important files. I forgot to port this functionality into the Rust (`opt-dist`) version in https://github.com/rust-lang/rust/pull/112235. This PR fixes that. r? bootstrap
2023-07-14Rollup merge of #113682 - lcnr:toml-file, r=Mark-SimulacrumMatthias Krüger-1/+1
trait system refactor ping: also apply to nested modules of `solve`
2023-07-14Rollup merge of #113681 - aDotInTheVoid:rdj-priv-supertrait, r=GuillaumeGomezMatthias Krüger-0/+15
rustdoc-json: Add test for private supertrait. Helps with https://github.com/rust-lang/rust/issues/81359 r? ``@GuillaumeGomez``
2023-07-14Rollup merge of #113662 - pedroclobo:vec-deque-rotate, r=thomccMatthias Krüger-25/+25
Rename VecDeque's `rotate_left` and `rotate_right` parameters This pull request introduces a modification to the `VecDeque` collection, specifically the `rotate_left` and `rotate_right` functions, by renaming the parameter associated with these functions. The rationale behind this change is to provide clearer and more consistent naming for the parameter that specifies the number of places to rotate the double-ended queue. By using `n` as the parameter name in both functions, it becomes easier to understand and remember the purpose of the parameter.
2023-07-14Rollup merge of #113599 - chenyukang:yukang-fix-use-maybe_body_owned_by, ↵Matthias Krüger-118/+280
r=cjgillot Use maybe_body_owned_by for multiple suggestions This is a continued work from https://github.com/rust-lang/rust/pull/113567 We have several other suggestions not working for closure, this PR use `maybe_body_owned_by` to fix them and add test cases for them.
2023-07-14Auto merge of #113591 - mdibaiee:genericargs-cleanup, r=oli-obkbors-4605/+4575
refactor(rustc_middle): Substs -> GenericArg resolves #110793 - [x] rename `SubstsRef` and `InternalSubsts` to `GenericArgsRef<'tcx>` and `GenericArgs<'tcx>`. - [x] rename variables and fields currently using `substs` to `args`. - [x] update the module name of `ty::subst` to `ty::generic_args` or sth. Make that module private and publicly reexport its content in the ty module. - [x] rename `EarlyBinder::subst(_identity)` to `EarlyBinder::instantiate(_identity)`. - [x] types called `[a-zA-Z]+Substs` renamed to `XArgs`. - [x] functions containing `substs` now use `args` or `generic_args` (mostly the former). However, the verb of "substituting" is still being used here and there, mostly in comments. I think that can be a separate PR as part of https://github.com/rust-lang/rust/issues/110254 to change the verb to `replace_generics` or something similar.
2023-07-14Make it clearer that we're just checking for an RPITITMichael Goulet-10/+14
2023-07-14Print artifact sizes in `opt-dist`Jakub Beránek-5/+45
2023-07-14tests: adapt for removal of -opaque-pointers in LLVM 17Krasimir Georgiev-0/+2
The commit https://github.com/llvm/llvm-project/commit/53717cabf837a589dd54a47dd8b4b3b9677f0b85 removed the flag from LLVM.
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-4605/+4575
2023-07-14llvm-wrapper: update for LLVM API changeKrasimir Georgiev-0/+1
No functional changes intended. Adds an include for llvm::SmallString. Previously, this must have been implicitly provided by some of the existing headers. With recent LLVM changes, not anymore: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/20776#01895448-44a4-4a1e-8407-9d41d0186132/209-690
2023-07-14Auto merge of #112982 - lukas-code:bootstrap-alias-default-crates, ↵bors-89/+118
r=albertlarsan68 bootstrap: update defaults for `compiler` and `library` aliases * `x doc compiler` now documents all of compiler, not just `rustc_driver`. * `x doc` with compiler docs enabled now includes `rustc-main` and `rustc_smir`. `rustc_codegen_llvm` is only included if the LLVM backend is enabled, which is the default. * `x doc library` now excludes `sysroot`. * `x check compiler` and `x check library` now properly check tests/benches/examples of all compiler or library crates, respectively. Note that `x check compiler` will check the library artifacts, but not tests. fixes the fallout from https://github.com/rust-lang/rust/pull/111955, cc `@jyn514`
2023-07-14Auto merge of #113328 - michaelwoerister:no_hashmap_in_typeck, r=cjgillot,lcnrbors-172/+212
Enable potential_query_instability lint in rustc_hir_typeck. Fix linting errors by using `FxIndex(Map|Set)` and `Unord(Map|Set)` as appropriate. Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533). I really like the `potential_query_instability` lint! r? `@lcnr`
2023-07-14fix docs for `rustc_smir`Lukas Markeffsky-3/+4
2023-07-14bootstrap: update defaults for `compiler` and `library` aliasesLukas Markeffsky-86/+114
2023-07-14also apply to nested modules of `solve`lcnr-1/+1
2023-07-14Introduce ExtentUnord trait for collections that can safely consume UnordItems.Michael Woerister-26/+39
2023-07-14Enable potential_query_instability lint in rustc_hir_typeck.Michael Woerister-148/+175
Fix linting errors by using FxIndex(Map|Set) and Unord(Map|Set) as appropriate.
2023-07-14Auto merge of #113639 - ericmarkmartin:more-smir-types, r=oli-obkbors-3/+8
Add more ty conversions to smir add str, slice, and array to smir types r? `@spastorino`
2023-07-14rustdoc-json: Add test for private supertrait.Alona Enraght-Moony-0/+15
2023-07-14Auto merge of #113609 - nnethercote:maybe_lint_level_root_bounded-cache, ↵bors-32/+71
r=cjgillot Add a cache for `maybe_lint_level_root_bounded` `maybe_lint_level_root_bounded` is called many times and traces node sub-paths many times. This PR adds a cache that lets many of these tracings be skipped, avoiding lots of calls to functions like `Map::attrs` and `Map::parent_id`. r? `@cjgillot`
2023-07-14Auto merge of #113519 - SparrowLii:parallel_typeck, r=cjgillotbors-29/+47
typeck in parallel #108118 caused `typeck` to be transferred to the serial part (`check_unused`), which made the performance of parallel rustc significantly reduced. This pr re-parallelize this part, which increases the average performance improvement of parallel rustc in `full` and `incr-full` scenarios from [14.4%](https://github.com/rust-lang/rust/pull/110284#issuecomment-1545354608) to [23.2%](https://github.com/rust-lang/rust/pull/110284#issuecomment-1624770626). r? `@cjgillot` cc `@oli-obk` `@Zoxc`
2023-07-14Auto merge of #113113 - Amanieu:box-vec-zst, r=Mark-Simulacrumbors-26/+115
Eliminate ZST allocations in `Box` and `Vec` This PR fixes 2 issues with `Box` and `RawVec` related to ZST allocations. Specifically, the `Allocator` trait requires that: - If you allocate a zero-sized layout then you must later deallocate it, otherwise the allocator may leak memory. - You cannot pass a ZST pointer to the allocator that you haven't previously allocated. These restrictions exist because an allocator implementation is allowed to allocate non-zero amounts of memory for a zero-sized allocation. For example, `malloc` in libc does this. Currently, ZSTs are handled differently in `Box` and `Vec`: - `Vec` never allocates when `T` is a ZST or if the vector capacity is 0. - `Box` just blindly passes everything on to the allocator, including ZSTs. This causes problems due to the free conversions between `Box<[T]>` and `Vec<T>`, specifically that ZST allocations could get leaked or a dangling pointer could be passed to `deallocate`. This PR fixes this by changing `Box` to not allocate for zero-sized values and slices. It also fixes a bug in `RawVec::shrink` where shrinking to a size of zero did not actually free the backing memory.
2023-07-13add str, slice, and array to smir typesEric Mark Martin-3/+8
2023-07-14Auto merge of #113676 - matthiaskrgr:rollup-n01iiy8, r=matthiaskrgrbors-58/+150
Rollup of 5 pull requests Successful merges: - #112525 (Adjustments for RustyHermit) - #112729 (Add machine-applicable suggestion for `unused_qualifications` lint) - #113618 (update ancient note) - #113640 (Make `nodejs` control the default for RustdocJs tests instead of a hard-off switch) - #113668 (Correct `the` -> `there` typo in items.md) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-14fix the issue of shorthand in suggest_cloningyukang-46/+53
2023-07-14use maybe_body_owned_by for closureyukang-74/+229
2023-07-14Rollup merge of #113668 - kupiakos:patch-1, r=calebcartwrightMatthias Krüger-1/+1
Correct `the` -> `there` typo in items.md
2023-07-14Rollup merge of #113640 - jyn514:nodejs-defaults, r=GuillaumeGomezMatthias Krüger-43/+39
Make `nodejs` control the default for RustdocJs tests instead of a hard-off switch If someone says `x test rustdoc-js-std` explicitly on the command line, it's because they want to run the tests. Give an error instead of doing nothing and reporting success. Before: ``` ; x t rustdoc-js No nodejs found, skipping "tests/rustdoc-js" tests Build completed successfully in 0:00:00 ``` After: ``` ; x t rustdoc-js thread 'main' panicked at 'need nodejs to run js-doc-test suite', test.rs:1566:13 Build completed unsuccessfully in 0:00:00 ``` I recommend viewing the diff with whitespace changes disabled. r? ````@GuillaumeGomez````
2023-07-14Rollup merge of #113618 - tshepang:patch-1, r=jyn514Matthias Krüger-2/+2
update ancient note
2023-07-14Rollup merge of #112729 - jieyouxu:unused-qualifications-suggestion, r=b-naberMatthias Krüger-1/+98
Add machine-applicable suggestion for `unused_qualifications` lint ``` error: unnecessary qualification --> $DIR/unused-qualifications-suggestion.rs:17:5 | LL | foo::bar(); | ^^^^^^^^ | note: the lint level is defined here --> $DIR/unused-qualifications-suggestion.rs:3:9 | LL | #![deny(unused_qualifications)] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with the unqualified path | LL | bar(); | ~~~ ``` Closes #92198.
2023-07-14Rollup merge of #112525 - hermitcore:devel, r=m-ou-seMatthias Krüger-11/+10
Adjustments for RustyHermit The interface between `libstd` and the OS changed and some changes are not correctly merged for RustHermit. For instance, the crate `hermit_abi` isn't defined as public, although it provided the socket interface for the application. In addition, the support of thread::available_parallelism is realized. It returns the number of available processors.
2023-07-13Auto merge of #113673 - matthiaskrgr:rollup-zcume6k, r=matthiaskrgrbors-137/+310
Rollup of 6 pull requests Successful merges: - #113536 (avoid building proof trees in select) - #113558 (Only use max_line_length = 100 for *.rs) - #113570 (refactor proof tree formatting) - #113623 (Add jump to doc) - #113629 (Add Adt to SMIR) - #113631 (make MCP510 behavior opt-in to avoid conflicts between the CLI and target flavors) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-13Rollup merge of #113631 - lqd:fix-113597, r=petrochenkovMatthias Krüger-2/+17
make MCP510 behavior opt-in to avoid conflicts between the CLI and target flavors Fixes #113597, which contains more details on how this happens through the code, and showcases an unexpected `Gnu(Cc::Yes, Lld::Yes)` flavor. #112910 added support to use `lld` when the flavor requests it, but didn't explicitly do so only when using `-Clink-self-contained=+linker` or one of the unstable `-Clinker-flavor`s. The problem: some targets have a `lld` linker and flavor, e.g. `thumbv6m-none-eabi` from that issue. Users can override the linker but there are no linker flavors precise enough to describe the linker opting out of lld: when using `-Clinker=arm-none-eabi-gcc`, we infer this is a `Cc::Yes` linker flavor, but the `lld` component is unknown and therefore defaulted to the target's linker flavor, `Lld::Yes`. <details> <summary>Walkthrough of how this happens</summary> The linker flavor used is a mix between what can be inferred from the CLI (`-C linker`) and the target's default linker flavor: - there is no linker flavor on the CLI (and that also offers another workaround on nightly: `-C linker-flavor=gnu-cc -Zunstable-options`), so it will have to be inferred [from here](https://github.com/lqd/rust/blob/5dac6b320be868f898a3c753934eabc79ff2e406/compiler/rustc_codegen_ssa/src/back/link.rs#L1334-L1336) to [here](https://github.com/lqd/rust/blob/5dac6b320be868f898a3c753934eabc79ff2e406/compiler/rustc_codegen_ssa/src/back/link.rs#L1321-L1327). - in [`infer_linker_hints`](https://github.com/lqd/rust/blob/5dac6b320be868f898a3c753934eabc79ff2e406/compiler/rustc_target/src/spec/mod.rs#L320-L352) `-C linker=arm-none-eabi-gcc` infers a `Some(Cc::Yes)` cc hint, and no hint about lld. - the target's `linker_flavor` is combined in `with_cli_hints` with these hints. We have our `Cc::Yes`, but there is no hint about lld, [so the target's flavor `lld` component is used](https://github.com/lqd/rust/blob/5dac6b320be868f898a3c753934eabc79ff2e406/compiler/rustc_target/src/spec/mod.rs#L356-L358). It's [`Gnu(Cc::No, Lld::Yes)`](https://github.com/rust-lang/rust/blob/993deaa0bf8bab9dd3eadfd1fbeb093328e95afe/compiler/rustc_target/src/spec/thumb_base.rs#L35). - so we now have our `Gnu(Cc::Yes, Lld::Yes)` flavor </details> This results in a `Gnu(Cc::Yes, Lld::Yes)` flavor on a non-lld linker, causing an additional unexpected `-fuse-ld=lld` argument to be passed. I don't know if this target defaulting to `rust-lld` is expected, but until MCP510's new linker flavor are stable, when people will be able to describe their linker/flavor accurately, this PR keeps the stable behavior of not doing anything when the linker/flavor on the CLI unexpectedly conflict with the target's. I've tested this on a `no_std` `-C linker=arm-none-eabi-gcc -C link-arg=-nostartfiles --target thumbv6m-none-eabi` example, trying to simulate one of `cortex-m`'s test mentioned in issue #113597 (I don't know how to build a local complete `thumbv6m-none-eabi` toolchain to run the exact test), and checked that `-fuse-lld` was indeed gone and the error disappeared. r? `````@petrochenkov`````
2023-07-13Rollup merge of #113629 - spastorino:smir-types-3, r=oli-obkMatthias Krüger-13/+58
Add Adt to SMIR r? ````@oli-obk````
2023-07-13Rollup merge of #113623 - GuillaumeGomez:add-jump-to-doc, r=notriddleMatthias Krüger-37/+148
Add jump to doc I'm using the source code pages of the compiler quite a lot, but one thing missing is the possibility to jump back from the source code to the item documentation. Since I also got a few others complaining about it, I think it's fine to add it since this option is nightly only. This PR adds a link to jump back to item's documentation on the item definition (so on `Bar` in `struct Bar {... }`, as described in the unofficial [RFC](https://github.com/GuillaumeGomez/rfcs/blob/rustdoc-jump-to-definition/text/000-rustdoc-jump-to-definition.md)). r? ````@notriddle````
2023-07-13Rollup merge of #113570 - lcnr:inspect-format, r=BoxyUwUMatthias Krüger-57/+63
refactor proof tree formatting mostly: - handle indentation via a separate formatter - change nested to use a closure tested it after rebasing on top of #113536 and everything looks good. r? `````@BoxyUwU`````
2023-07-13Rollup merge of #113558 - cuviper:rs100, r=Mark-SimulacrumMatthias Krüger-0/+2
Only use max_line_length = 100 for *.rs This setting was added to match rustfmt, but it's been taking effect on all file editing, which I notice most on git `COMMIT_EDITMSG`. I want to keep my default 72-width commit messages, please. :)
2023-07-13Rollup merge of #113536 - lcnr:proof-tree-select, r=BoxyUwUMatthias Krüger-28/+22
avoid building proof trees in select otherwise we ICE because select isn't currently set up to print proof trees. r? `````@BoxyUwU`````
2023-07-13Correct `the` -> `there` typo in items.mdAlyssa Haroldsen-1/+1
2023-07-13Auto merge of #113637 - Mark-Simulacrum:bootstrap-bump, r=ozkanonurbors-1442/+1804
Bump bootstrap to 1.72 beta
2023-07-13Fix VecDeque's rotate_left and rotate_right panic testsPedro Lobo-2/+2
2023-07-13Rename VecDeque's rotate_left and rotate_right parametersPedro Lobo-23/+23
2023-07-13Auto merge of #113646 - matthiaskrgr:rollup-1q6tmow, r=matthiaskrgrbors-32/+227
Rollup of 7 pull requests Successful merges: - #113353 (Implement selection for `Unsize` for better coercion behavior) - #113553 (Make Placeholder, GeneratorWitness*, Infer and Error unreachable on SMIR rustc_ty_to_ty) - #113598 (Update cargo) - #113603 (Test simd-wide-sum for codegen error) - #113613 (Allow to have `-` in rustdoc-json test file name) - #113615 (llvm-wrapper: adapt for LLVM API change) - #113616 (Fix bootstrap.py uname error) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-13Add Adt to SMIRSantiago Pastorino-5/+55
2023-07-13Eliminate ZST allocations in `Box` and `Vec`Amanieu d'Antras-26/+115
2023-07-13Ignore the let-else reformatting in git blameMark Rousskov-0/+2