about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-05-31Migrate GUI colors test to original CSS color formatGuillaume Gomez-3/+3
2023-05-30Auto merge of #111768 - oli-obk:pair_const_llvm, r=cjgillotbors-83/+120
Optimize scalar and scalar pair representations loaded from ByRef in llvm in https://github.com/rust-lang/rust/pull/105653 I noticed that we were generating suboptimal LLVM IR if we had a `ConstValue::ByRef` that could be represented by a `ScalarPair`. Before https://github.com/rust-lang/rust/pull/105653 this is probably rare, but after it, every slice will go down this suboptimal code path that requires LLVM to untangle a bunch of indirections and translate static allocations that are only used once to read a scalar pair from.
2023-05-30Auto merge of #112083 - scottmcm:simpler-range-next, r=thomccbors-46/+143
Make `TrustedStep` require `Copy` All the implementations of the trait already are `Copy`, and this seems to be enough to simplify the implementations enough to make the MIR inliner willing to inline basics like `Range::next`. r? `@thomcc`
2023-05-30Auto merge of #112075 - WaffleLapkin:unmkII, r=lcnrbors-234/+292
Replace `tcx.mk_re_*` with `Region::new_*` Second step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
2023-05-30Auto merge of #111989 - klensy:deps-up-26-05-23, r=Mark-Simulacrumbors-123/+22
deps: bump crates Updates few deps: drops a lot of cxx* crates: ```console $ cargo update -p iana-time-zone-haiku Updating crates.io index Updating cc v1.0.77 -> v1.0.79 Removing codespan-reporting v0.11.1 Removing cxx v1.0.94 Removing cxx-build v1.0.94 Removing cxxbridge-flags v1.0.94 Removing cxxbridge-macro v1.0.94 Updating iana-time-zone-haiku v0.1.1 -> v0.1.2 Removing link-cplusplus v1.0.8 Removing scratch v1.0.5 ``` cc: https://github.com/rust-lang/cc-rs/releases/tag/1.0.78, https://github.com/rust-lang/cc-rs/releases/tag/1.0.79 iana-time-zone-haiku: https://github.com/strawlab/iana-time-zone/releases/tag/haiku%2Fv0.1.2 fixed https://github.com/crossbeam-rs/crossbeam/pull/972 (similar fixed in rust repo https://github.com/rust-lang/rust/pull/110089) ```console $ cargo update -p crossbeam-channel Updating crates.io index Updating crossbeam-channel v0.5.6 -> v0.5.8 ``` https://github.com/crossbeam-rs/crossbeam/blob/master/crossbeam-channel/CHANGELOG.md#version-058 dedupes memoffset versions: ```console $ cargo update -p crossbeam-epoch Updating crates.io index Updating crossbeam-epoch v0.9.13 -> v0.9.14 Removing memoffset v0.7.1 ``` https://github.com/crossbeam-rs/crossbeam/blob/master/crossbeam-epoch/CHANGELOG.md#version-0914 https://github.com/Gilnaa/memoffset/compare/v0.6.5...v0.8.0 https://github.com/rust-lang/rust/pull/108638#discussion_r1193157265 dedupes bstr versions ```console $ cargo update -p ignore -p opener Updating crates.io index Removing bstr v0.2.17 Updating globset v0.4.9 -> v0.4.10 Updating ignore v0.4.18 -> v0.4.20 Updating opener v0.5.0 -> v0.5.2 ``` globset https://github.com/BurntSushi/ripgrep/commit/ac8fecbbf2e3be6dc3fca2ebc1a31a046d57553a ignore https://github.com/BurntSushi/ripgrep/commits/master/crates/ignore hard to track, but drop dep on crossbeam-utils (https://github.com/BurntSushi/ripgrep/commit/e95254a86f484eec663be4714924d91d3cf39cb8), don't stat git if require_git is false (https://github.com/BurntSushi/ripgrep/commit/009dda1488ac6a01725b3e49ec9b81a1edf8036d) and added bunch of formats to ignore list opener https://github.com/Seeker14491/opener/compare/v0.5.0...v0.5.2 nothing interesting
2023-05-29Auto merge of #112080 - matthiaskrgr:rollup-pmpbe49, r=matthiaskrgrbors-83/+385
Rollup of 6 pull requests Successful merges: - #111558 (Move tests) - #111827 (Add build instructions for cranelift backend as part of Rust repo) - #111988 (Make `TyKind: Debug` have less verbose output) - #112022 (Check nested obligations during coercion unify in new solver) - #112057 (Suggest correct `self_ty`) - #112063 (Add a test for issue 110457/incremental ICE with closures with the same span) Failed merges: - #112068 (Move tests from `ui/discrim` dir) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-29Update a MIRI fake-time test that this makes "faster"Scott McMurray-1/+1
2023-05-29Make `TrustedStep` require `Copy`Scott McMurray-45/+142
All the implementations of the trait already are `Copy`, and this seems to be enough to simplify the implementations enough to make the MIR inliner willing to inline basics like `Range::next`.
2023-05-29Rollup merge of #112063 - WaffleLapkin:test_incremental_ice, r=cjgillotMatthias Krüger-0/+137
Add a test for issue 110457/incremental ICE with closures with the same span Closes #110457 It's probably possible to minimize the test case more, considering that we now know the underlying reason for the ICE, but I didn't. r? `@cjgillot`
2023-05-29Rollup merge of #112057 - MU001999:fix/self-sugg, r=compiler-errorsMatthias Krüger-2/+24
Suggest correct `self_ty` Fixes #112036
2023-05-29Rollup merge of #112022 - compiler-errors:coercion-check-deep, r=lcnrMatthias Krüger-1/+20
Check nested obligations during coercion unify in new solver Found when triaging failing opaque tests with new solver. r? `@lcnr`
2023-05-29Rollup merge of #111988 - BoxyUwU:make_tykind_debug_good, r=compiler-errorsMatthias Krüger-78/+176
Make `TyKind: Debug` have less verbose output Current `TyKind: Debug` impl is basically unusable for debugging, its too verbose even for verbose debugging :rofl: This PR replaces the debug logic for `TyKind` with a more manual debug impl instead of a hand expanded derived impl. This should help make #107084 more reasonable to land since the output of `Ty: Debug` will be better. This isn't a fully completed change to the `Debug` impl of `TyKind` as there's still logic from the derive macro for some variants. Some of the variants are also not consisten with the `-Zverbose` printing of `Ty`, ideally `-Zverbose` printing of `Ty` would also just defer to the debug impl instead of having lots of checks in pretty printing. I plan on fixing this in follow up PRs since it seems tricky to do in this one and its already a large PR :sweat_smile:
2023-05-29Rollup merge of #111827 - AngelicosPhosphoros:add_docs_to_cranelift, r=bjorn3Matthias Krüger-0/+26
Add build instructions for cranelift backend as part of Rust repo All other instructions assume that user works with separate repository than Rust compiler repository. When one follows default instructions, cranelift codegen tries to use different sys-root and compiler internal crates which leads to compiler errors when building it. I needed to do all this steps while adding new intrinsic to rustc. r? bjorn3
2023-05-29Rollup merge of #111558 - c410-f3r:t3st3ss, r=WaffleLapkinMatthias Krüger-2/+2
Move tests r? `@petrochenkov`
2023-05-29Rename `tcx.mk_re_*` => `Region::new_*`Maybe Waffle-234/+292
2023-05-29Address commentCaio-0/+0
2023-05-29Add a test for issue 110457Maybe Waffle-0/+137
2023-05-29Auto merge of #111235 - loongarch-rs:stabilize-asm, r=Amanieubors-16/+2
Stabilize inline asm for LoongArch64 This PR is used to tracking for stabilize `inline asm` for LoongArch64. **Status** - [x] https://github.com/rust-lang/rust/pull/111237 - [x] https://github.com/rust-lang/rust/pull/111332 - [ ] https://github.com/rust-lang/reference/pull/1357 Any others I missed? r? `@Amanieu`
2023-05-29Auto merge of #111329 - jyn514:metadata-ice, r=bjorn3bors-34/+64
Load only the crate header for `locator::crate_matches` Previously, we used the following info to determine whether to load the crate: 1. The METADATA_HEADER, which includes a METADATA_VERSION constant 2. The embedded rustc version 3. Various metadata in the `CrateRoot`, including the SVH This worked ok most of the time. Unfortunately, when building locally the rustc version is always the same because `omit-git-hash` is on by default. That meant that we depended only on 1 and 3, and we are not very good about bumping METADATA_VERSION (it's currently at 7) so in practice we were only depending on 3. `CrateRoot` is a very large struct and changes somewhat regularly, so this led to a steady stream of crashes from trying to load it. Change the logic to add an intermediate step between 2 and 3: introduce a new `CrateHeader` struct that contains only the minimum info needed to decide whether the crate should be loaded or not. That avoids having to load all of `CrateRoot`, which in practice means we should crash much less often. Note that this works because the SVH should be different between any two dependencies, even if the compiler has changed, because we use `-Zbinary-dep-depinfo` in bootstrap. See https://github.com/rust-lang/rust/pull/111329#issuecomment-1538303474 for more details about how the original crash happened.
2023-05-29Auto merge of #111748 - nnethercote:Cow-DiagnosticMessage, r=WaffleLapkinbors-287/+308
Use `Cow` in `{D,Subd}iagnosticMessage`. Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment: ``` // FIXME(davidtwco): can a `Cow<'static, str>` be used here? ``` This commit answers that question in the affirmative. It's not the most compelling change ever, but it might be worth merging. This requires changing the `impl<'a> From<&'a str>` impls to `impl From<&'static str>`, which involves a bunch of knock-on changes that require/result in call sites being a little more precise about exactly what kind of string they use to create errors, and not just `&str`. This will result in fewer unnecessary allocations, though this will not have any notable perf effects given that these are error paths. Note that I was lazy within Clippy, using `to_string` in a few places to preserve the existing string imprecision. I could have used `impl Into<{D,Subd}iagnosticMessage>` in various places as is done in the compiler, but that would have required changes to *many* call sites (mostly changing `&format("...")` to `format!("...")`) which didn't seem worthwhile. r? `@WaffleLapkin`
2023-05-29Determine `self_ty` with expected `ty`mu001999-2/+24
2023-05-29Auto merge of #112055 - matthiaskrgr:rollup-y3exx8c, r=matthiaskrgrbors-11/+135
Rollup of 5 pull requests Successful merges: - #112029 (Recover upon mistyped error on typo'd `const` in const param def) - #112037 (Add details about `unsafe_op_in_unsafe_fn` to E0133) - #112039 (compiler: update solaris/illumos to enable tsan support.) - #112042 (Migrate GUI colors test to original CSS color format) - #112045 (Followup to #111973) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-29Rollup merge of #112045 - Sp00ph:update_current_impl, r=AmanieuMatthias Krüger-2/+3
Followup to #111973 I somehow forgot to update the comment on `select_nth_unstable_by_key` in #111973, so this PR fixes that. r? `@Amanieu`
2023-05-29Rollup merge of #112042 - GuillaumeGomez:migrate-gui-test-color-8, r=notriddleMatthias Krüger-6/+6
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? `@notriddle`
2023-05-29Rollup merge of #112039 - devnexen:solarish_compiler_spec_update, r=jackh726Matthias Krüger-2/+2
compiler: update solaris/illumos to enable tsan support.
2023-05-29Rollup merge of #112037 - Nemo157:e0133-unsafe_op_in_unsafe_fn, r=petrochenkovMatthias Krüger-1/+18
Add details about `unsafe_op_in_unsafe_fn` to E0133 This was mentioned in https://github.com/rust-lang/rust/pull/99827#discussion_r933899901
2023-05-29Rollup merge of #112029 - jieyouxu:typo-const-in-const-param-def, r=cjgillotMatthias Krüger-0/+106
Recover upon mistyped error on typo'd `const` in const param def And add machine-applicable fix for the typo'd `const` keyword. ### Before ``` error: expected one of `,`, `:`, `=`, or `>`, found `N` --> src/lib.rs:1:18 | 1 | pub fn bar<Const N: u8>() {} | ^ expected one of `,`, `:`, `=`, or `>` ``` ### After This PR ``` error: `const` keyword was mistyped as `Const` --> test.rs:1:8 | 1 | fn bar<Const N: u8>() {} | ^^^^^ | help: use the `const` keyword | 1 | fn bar<const N: u8>() {} | ~~~~~ ``` Fixes #111941.
2023-05-29Auto merge of #111963 - nnethercote:inline-derived-hash, r=lqdbors-19/+27
Inline derived `hash` Because most of the other derived functions are inlined: `clone`, `default`, `eq`, `partial_cmp`, `cmp`. The exception is `fmt`, but it tends to not be on hot paths as much. r? `@ghost`
2023-05-29Use `Cow` in `{D,Subd}iagnosticMessage`.Nicholas Nethercote-287/+308
Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment: ``` // FIXME(davidtwco): can a `Cow<'static, str>` be used here? ``` This commit answers that question in the affirmative. It's not the most compelling change ever, but it might be worth merging. This requires changing the `impl<'a> From<&'a str>` impls to `impl From<&'static str>`, which involves a bunch of knock-on changes that require/result in call sites being a little more precise about exactly what kind of string they use to create errors, and not just `&str`. This will result in fewer unnecessary allocations, though this will not have any notable perf effects given that these are error paths. Note that I was lazy within Clippy, using `to_string` in a few places to preserve the existing string imprecision. I could have used `impl Into<{D,Subd}iagnosticMessage>` in various places as is done in the compiler, but that would have required changes to *many* call sites (mostly changing `&format("...")` to `format!("...")`) which didn't seem worthwhile.
2023-05-28Auto merge of #111813 - scottmcm:pretty-mir, r=cjgillotbors-771/+927
MIR: opt-in normalization of `BasicBlock` and `Local` numbering This doesn't matter at all for actual codegen, but after spending some time reading pre-codegen MIR, I was wishing I didn't have to jump around so much in reading post-inlining code. So this add two passes that are off by default for every mir level, but can be enabled (`-Zmir-enable-passes=+ReorderBasicBlocks,+ReorderLocals`) for humans.
2023-05-28Auto merge of #112006 - kylematsuda:earlybinder-private, r=jackh726bors-113/+123
Make `EarlyBinder`'s inner value private Currently, `EarlyBinder(T)`'s inner value is public, which allows implicitly skipping the binder by indexing into the tuple struct (i.e., `x.0`). `@lcnr` suggested making `EarlyBinder`'s inner value private so users are required to explicitly call `skip_binder` (https://github.com/rust-lang/rust/issues/105779#issuecomment-1549933424) . This PR makes the inner value private, adds `EarlyBinder::new` for constructing a new instance, and replaces uses of `x.0` with `x.skip_binder()` (or similar). It also adds some documentation to `EarlyBinder::skip_binder` explaining how to skip the binder of `&EarlyBinder<T>` to get `&T` now that the inner value is private (since previously we could just do `&x.0`). r? `@lcnr`
2023-05-28Migrate GUI colors test to original CSS color formatGuillaume Gomez-6/+6
2023-05-28Add documentation on skip_binder on how to get &T from &EarlyBinder<T>Kyle Matsuda-0/+3
2023-05-28Make EarlyBinder's inner value private; and fix all of the resulting errorsKyle Matsuda-54/+57
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-59/+63
2023-05-28Update current impl comment for `select_nth_unstable_by_key`Markus Everling-2/+3
2023-05-28Auto merge of #111755 - Zoxc:sharded-switch, r=cjgillotbors-10/+38
Use only one shard with a single thread This changes `Sharded` to only access a single shard using a mask set to `0` when a single thread is used, which leads to cache utilization improvements. Performance improvement with 1 thread and `cfg(parallel_compiler)`: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7402s</td><td align="right">1.7004s</td><td align="right">💚 -2.29%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2633s</td><td align="right">0.2550s</td><td align="right">💚 -3.12%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9716s</td><td align="right">0.9482s</td><td align="right">💚 -2.41%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.5679s</td><td align="right">1.5358s</td><td align="right">💚 -2.05%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.0569s</td><td align="right">5.9272s</td><td align="right">💚 -2.14%</td></tr><tr><td>Total</td><td align="right">10.5999s</td><td align="right">10.3666s</td><td align="right">💚 -2.20%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9760s</td><td align="right">💚 -2.40%</td></tr></table> cc `@SparrowLii`
2023-05-28Add some commentsJohn Kåre Alsaker-0/+4
2023-05-28Don't access self.mask with a single shardJohn Kåre Alsaker-1/+1
2023-05-28compiler: update solaris and illumos spec to support TSAN.David Carlier-2/+2
2023-05-28Auto merge of #112026 - saethlin:misaligned-addrof, r=pnkfelixbors-0/+23
Don't check for misaligned raw pointer derefs inside Rvalue::AddressOf From https://github.com/rust-lang/rust/pull/112026#issuecomment-1565686697: rustc 1.70 (stable next week) added a Mir pass to add pointer alignment checks in debug mode. Adding these checks caused some crates to break, but that was expected, since they contain broken code (https://github.com/rust-lang/rust/issues/111487) for tracking that. However, the checks added are slightly more aggressive than they should have been. Specifically, they also check the place in an `addr_of!` expression. Whether lack of alignment there is or isn't UB is unclear. This PR modifies the pass to not affect those cases. I spot checked the crater regressions and the ones I saw were not the case that this PR is modifying. It still seems good to not land anything overaggressive though
2023-05-28Use only one shard with a single threadJohn Kåre Alsaker-10/+34
2023-05-28Add details about `unsafe_op_in_unsafe_fn` to E0133Wim Looman-1/+18
2023-05-28Auto merge of #112001 - saethlin:enable-matchbranchsimplification, r=cjgillotbors-7/+50
Enable MatchBranchSimplification This pass is one of the small number of benefits from `-Zmir-opt-level=3` that has motivated rustc_codegen_cranelift to use it: https://github.com/rust-lang/rust/blob/19ed0aade60e1c1038fe40554bcd9d01b717effa/compiler/rustc_codegen_cranelift/build_system/build_sysroot.rs#L244-L246 Cranelift's motivation for this is _runtime_ performance improvements in debug builds. Lifting this pass all the way to `-Zmir-opt-level=1` seems to come without significant perf overhead, so that's what I'm suggesting here.
2023-05-28Recover upon encountering mistyped `Const` in const param def许杰友 Jieyou Xu (Joe)-0/+106
2023-05-28Auto merge of #112028 - fee1-dead-contrib:rollup-4xxzxd0, r=fee1-deadbors-11/+13
Rollup of 2 pull requests Successful merges: - #110081 (bump `thiserror` to use syn 2.0) - #112005 (Migrate `item_foreign_type` to Askama ) r? `@ghost` `@rustbot` modify labels: rollup
2023-05-28Rollup merge of #112005 - sladyn98:item-foreign-types, r=GuillaumeGomezfee1-dead-6/+8
Migrate `item_foreign_type` to Askama This PR continues the migration of `print_item.rs` functions to Askama. This piece of work migrates the function `item_foreign_type` Refers https://github.com/rust-lang/rust/issues/108868
2023-05-28Rollup merge of #110081 - fee1-dead-contrib:bump-thiserror, r=Mark-Simulacrumfee1-dead-5/+5
bump `thiserror` to use syn 2.0 cc #109302
2023-05-28bump `thiserror` to use syn 2.0Deadbeef-5/+5
2023-05-28Auto merge of #112000 - wesleywiser:safestack, r=Amanieubors-91/+82
Add support for LLVM SafeStack Adds support for LLVM [SafeStack] which provides backward edge control flow protection by separating the stack into two parts: data which is only accessed in provable safe ways is allocated on the normal stack (the "safe stack") and all other data is placed in a separate allocation (the "unsafe stack"). SafeStack support is enabled by passing `-Zsanitizer=safestack`. [SafeStack]: https://clang.llvm.org/docs/SafeStack.html cc `@rcvalle` #39699