about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-05-25Auto merge of #125552 - matthiaskrgr:rollup-f1yybpn, r=matthiaskrgrbors-222/+590
Rollup of 7 pull requests Successful merges: - #121377 (Stabilize `LazyCell` and `LazyLock`) - #122986 (Fix c_char on AIX) - #123803 (Fix `VecDeque::shrink_to` UB when `handle_alloc_error` unwinds.) - #124080 (Some unstable changes to where opaque types get defined) - #124667 (Stabilize `div_duration`) - #125472 (tidy: validate LLVM component names in tests) - #125523 (Exit the process a short time after entering our ctrl-c handler) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-25Rollup merge of #125523 - saethlin:ctrlc-timeout, r=bjorn3Matthias Krüger-9/+8
Exit the process a short time after entering our ctrl-c handler Fixes https://github.com/rust-lang/rust/issues/124212 r? `@bjorn3`
2024-05-25Rollup merge of #125472 - erikdesjardins:component, r=clubby789Matthias Krüger-0/+30
tidy: validate LLVM component names in tests LLVM component names are not immediately obvious (they usually omit any suffixes on the target arch name), and if they're incorrect, the test will silently never run. This happened [here](https://github.com/rust-lang/rust/pull/125220#discussion_r1612626002), and it would be nice to prevent it.
2024-05-25Rollup merge of #124667 - newpavlov:stabilize_div_duration, r=jhprattMatthias Krüger-7/+8
Stabilize `div_duration` Closes #63139
2024-05-25Rollup merge of #124080 - oli-obk:define_opaque_types10, r=compiler-errorsMatthias Krüger-122/+364
Some unstable changes to where opaque types get defined None of these can be reached from stable afaict. r? ``@compiler-errors`` cc https://github.com/rust-lang/rust/issues/116652
2024-05-25Rollup merge of #123803 - Sp00ph:shrink_to_fix, r=Mark-SimulacrumMatthias Krüger-1/+118
Fix `VecDeque::shrink_to` UB when `handle_alloc_error` unwinds. Fixes #123369 For `VecDeque` it's relatively simple to restore the buffer into a consistent state so this PR does just that. Note that with its current implementation, `shrink_to` may change the internal arrangement of elements in the buffer, so e.g. `[D, <uninit>, A, B, C]` will become `[<uninit>, A, B, C, D]` and `[<uninit>, <uninit>, A, B, C]` may become `[B, C, <uninit>, <uninit>, A]` if `shrink_to` unwinds. This shouldn't be an issue though as we don't make any guarantees about the stability of the internal buffer arrangement (and this case is impossible to hit on stable anyways). This PR also includes a test with code adapted from #123369 which fails without the new `shrink_to` code. Does this suffice or do we maybe need more exhaustive tests like in #108475? cc `@Amanieu` `@rustbot` label +T-libs
2024-05-25Rollup merge of #122986 - taiki-e:aix-c-char, r=Mark-SimulacrumMatthias Krüger-1/+2
Fix c_char on AIX Closes https://github.com/rust-lang/rust/issues/122985
2024-05-25Rollup merge of #121377 - pitaj:lazy_cell_fn_pointer, r=dtolnayMatthias Krüger-82/+60
Stabilize `LazyCell` and `LazyLock` Closes #109736 This stabilizes the [`LazyLock`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html) and [`LazyCell`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html) types: ```rust static HASHMAP: LazyLock<HashMap<i32, String>> = LazyLock::new(|| { println!("initializing"); let mut m = HashMap::new(); m.insert(13, "Spica".to_string()); m.insert(74, "Hoyten".to_string()); m }); let lazy: LazyCell<i32> = LazyCell::new(|| { println!("initializing"); 92 }); ``` r? libs-api
2024-05-25Auto merge of #125515 - weihanglo:target-toml-override, r=onur-ozkanbors-5/+59
bootstrap: support target specific config overrides Can't find any previous discussion about not supporting this, so I get it done. The motivation of this is from <https://github.com/rust-lang/rust/pull/125473#issuecomment-2129954990>.
2024-05-25Auto merge of #121571 - clarfonthey:unchecked-math-preconditions, r=saethlinbors-199/+291
Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr} methods (Old PR is haunted, opening a new one. See #117494 for previous discussion.) This ensures that these preconditions are actually checked in debug mode, and hopefully should let people know if they messed up. I've also replaced the calls (I could find) in the code that use these intrinsics directly with those that use these methods, so that the asserts actually apply. More discussions on people misusing these methods in the tracking issue: https://github.com/rust-lang/rust/issues/85122.
2024-05-25Auto merge of #125502 - weihanglo:update-rustc-perf, r=Kobzolbors-0/+0
Update rustc-perf Just check if the latest commit works. https://github.com/rust-lang/rustc-perf/compare/4f313add609f43e928e98132358e8426ed3969ae...cc81f9654dac3fe08de286907dba747538417afd See discussion on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/tempfile.20in.20rustc-perf.20make.20it.20hard.20to.20configure.20vendor/near/440442827 r? ghost
2024-05-25Auto merge of #125541 - matthiaskrgr:rollup-4gwt4xp, r=matthiaskrgrbors-1134/+797
Rollup of 8 pull requests Successful merges: - #125271 (use posix_memalign on almost all Unix targets) - #125451 (Fail relating constants of different types) - #125478 (Bump bootstrap compiler to the latest beta compiler) - #125498 (Stop using the avx512er and avx512pf x86 target features) - #125510 (remove proof tree formatting, make em shallow) - #125513 (Don't eagerly monomorphize drop for types that are impossible to instantiate) - #125514 (Structurally resolve before `builtin_index` in EUV) - #125527 (Add manual Sync impl for ReentrantLockGuard) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-25Rollup merge of #125527 - programmerjake:patch-2, r=workingjubileeMatthias Krüger-0/+38
Add manual Sync impl for ReentrantLockGuard Fixes: #125526 Tracking Issue: #121440 this impl is even shown in the summary in the tracking issue, but apparently was forgotten in the actual implementation
2024-05-25Rollup merge of #125514 - compiler-errors:builtin-index, r=lcnrMatthias Krüger-3/+31
Structurally resolve before `builtin_index` in EUV r? lcnr
2024-05-25Rollup merge of #125513 - compiler-errors:impossible-drop, r=jackh726Matthias Krüger-0/+27
Don't eagerly monomorphize drop for types that are impossible to instantiate Self-explanatory title I think Fixes #125509
2024-05-25Rollup merge of #125510 - lcnr:change-proof-trees-to-be-shallow, ↵Matthias Krüger-505/+135
r=compiler-errors remove proof tree formatting, make em shallow Debugging via tracing `RUSTC_LOG=rustc_trait_selection::solve=debug` is now imo slightly more readable then the actual proof tree formatter. Removing everything that's not needed for the `analyse` visitor allows us to remove a bunch of code. I personally believe that we should continue to use tracing over proof trees for debugging: - it eagerly prints, allowing us to debug ICEs - the proof tree builder ends up going out of sync with the actual runtime behavior, which is confusing - using shallow proof trees is a lot more performant as we frequently do not recurse into all nested goals when using an analyse visitor - this allows us to clean up the implementation and remove some code r? ```@compiler-errors```
2024-05-25Rollup merge of #125498 - zmodem:avx512er, r=workingjubileeMatthias Krüger-6/+2
Stop using the avx512er and avx512pf x86 target features They are no longer supported by LLVM 19. Fixes #125492
2024-05-25Rollup merge of #125478 - Urgau:check-cfg-config-bump-stage0, r=Mark-SimulacrumMatthias Krüger-431/+428
Bump bootstrap compiler to the latest beta compiler This PR updates the bootstrap compiler, aka stage0 to the latest beta version, since it contains rust-lang/cargo#13925. It removes those unconditional Cargo warnings: ``` warning: [...]/rust/library/core/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg warning: [...]/rust/library/std/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg warning: [...]/rust/library/alloc/Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg ``` for all contributors/users of this repository (including CI). I don't know if that's something we do, or if it's even advisable, feel free to close. r? `@Mark-Simulacrum`
2024-05-25Rollup merge of #125451 - oli-obk:const_type_mismatch, r=compiler-errorsMatthias Krüger-180/+129
Fail relating constants of different types fixes #121585 fixes #121858 fixes #124151 I gave this several attempts before, but we lost too many important diagnostics until I managed to make compilation never bail out early. We have reached this point, so now we can finally fix all those ICEs by bubbling up an error instead of continueing when we encounter a bug.
2024-05-25Rollup merge of #125271 - RalfJung:posix_memalign, r=workingjubileeMatthias Krüger-9/+7
use posix_memalign on almost all Unix targets Seems nice to be able to use a single common codepath for all of them. :) The `libc` crate says this symbol exists for all Unix targets. I did locally do check-builds to ensure this still builds, but I can't really test more than that. - For redox, I found indications posix_memalign really exists [here](https://gitlab.redox-os.org/redox-os/relibc/-/merge_requests/271) - For esp-idf, I found indications [here](https://github.com/playable-tech/esp-idf/commit/c5b297a86f3d65081bc690e81ab53db47b18d31c) - ~~For horizon and vita (these seem to be gaming console OSes? "Horizon OS" also has some hits for a Facebook product but that seems unrelated), they seem to be based on "newlib", where posix_memalign [seems to exist](https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=3ba2c39fb2a12cd7332ef16b1b3e3df994f7c6f5).~~ Turns out no, this 20-year-old standard POSIX function is unfortunately [not supported](https://github.com/rust-lang/rust/pull/125271#issuecomment-2119221419) here.
2024-05-25Auto merge of #125524 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 7 commits in 84dc5dc11a9007a08f27170454da6097265e510e..a8d72c675ee52dd57f0d8f2bae6655913c15b2fb 2024-05-20 18:57:08 +0000 to 2024-05-24 03:34:17 +0000 - Improve error description when deserializing partial field struct (rust-lang/cargo#13956) - fix: remove symlink dir on Windows (rust-lang/cargo#13910) - Fix wrong type of rustc-flags in documentation (rust-lang/cargo#13957) - Add more high level traces (rust-lang/cargo#13951) - upgrade gix from 0.62 to 0.63 (rust-lang/cargo#13948) - Use `i32` rather than `usize` as "default integer" in library template (rust-lang/cargo#13939) - fetch specific commits even if the github fast path fails (rust-lang/cargo#13946) r? ghost
2024-05-24Don't eagerly monomorphize drop for types that are impossible to instantiateMichael Goulet-0/+27
2024-05-24Stabilize the runtime of libtest-paddingBen Kimock-6/+2
The body of these benchmarks is close to empty but not literally empty. This was making the runtime of the benchmarks (which are compiled without optimizations!) flicker between 9 ns and 10 ns runtime, which changes the padding and breaks the test. Recent changes to the standard library have pushed the runtime closer to 10 ns when unoptimized, which is why we haven't seen such failures before in CI. Contributors can also induce such failures before this PR by running the run-make tests while the system is under heavy load.
2024-05-25Auto merge of #124187 - compiler-errors:self-ctor, r=petrochenkovbors-176/+244
Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned https://github.com/rust-lang/rust/pull/117246#discussion_r1374648388. This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of https://github.com/rust-lang/rust/pull/117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
2024-05-24Add manual Sync impl for ReentrantLockGuardJacob Lifshay-0/+38
Fixes: #125526
2024-05-24Update cargoWeihang Lo-0/+0
2024-05-24Exit the process a short time after entering our ctrl-c handlerBen Kimock-9/+8
2024-05-24Auto merge of #125521 - matthiaskrgr:rollup-ph2bz3h, r=matthiaskrgrbors-121/+171
Rollup of 7 pull requests Successful merges: - #125467 (Only suppress binop error in favor of semicolon suggestion if we're in an assignment statement) - #125483 (compiler: validate.rs belongs next to what it validates) - #125485 (Migrate `run-make/rustdoc-with-output-dir-option` to `rmake.rs`) - #125497 (Fix some SIMD intrinsics documentation) - #125501 (Resolve anon const's parent predicates to direct parent instead of opaque's parent) - #125503 (rustdoc-json: Add test for keywords with `--document-private-items`) - #125519 (tag more stuff with `WG-trait-system-refactor`) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-24Rollup merge of #125519 - lcnr:tag-next-solver, r=compiler-errorsMatthias Krüger-1/+4
tag more stuff with `WG-trait-system-refactor` r? `@compiler-errors`
2024-05-24Rollup merge of #125503 - aDotInTheVoid:rdj-keyword-attr, r=GuillaumeGomezMatthias Krüger-0/+20
rustdoc-json: Add test for keywords with `--document-private-items` Turns out this does work as-expected. I was worried that the rustdoc's clean would produce a `ItemKind::KeywordItem` for the module, and loose the module itself. But turns out we get this right. Prompted by [this discussion on zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Where.20to.20find.20keyword.20entries.20in.20JSON.20rustdoc) r? `@GuillaumeGomez`
2024-05-24Rollup merge of #125501 - compiler-errors:opaque-opaque-anon-ct, r=BoxyUwUMatthias Krüger-97/+71
Resolve anon const's parent predicates to direct parent instead of opaque's parent When an anon const is inside of an opaque, #99801 added a hack to resolve the anon const's parent predicates *not* to the opaque's predicates, but to the opaque's *parent's* predicates. This is insufficient when considering nested opaques. This means that the `predicates_of` an anon const might reference duplicated lifetimes (installed by `compute_bidirectional_outlives_predicates`) when computing known outlives in MIR borrowck, leading to these ICEs: Fixes #121574 Fixes #118403 ~~Instead, we should be using the `OpaqueTypeOrigin` to acquire the owner item (fn/type alias/etc) of the opaque, whose predicates we're fine to mention.~~ ~~I think it's a bit sketchy that we're doing this at all, tbh; I think it *should* be fine for the anon const to inherit the predicates of the opaque it's located inside. However, that would also mean that we need to make sure the `generics_of` that anon const line up in the same way.~~ ~~None of this is important to solve right now; I just want to fix these ICEs so we can land #125468, which accidentally fixes these issues in a different and unrelated way.~~ edit: We don't need this special case anyways because we install the right parent item in `generics_of` anyways: https://github.com/rust-lang/rust/blob/213ad10c8f0fc275648552366275dc4e07f97462/compiler/rustc_hir_analysis/src/collect/generics_of.rs#L150 r? `@BoxyUwU`
2024-05-24Rollup merge of #125497 - meesfrensel:patch-1, r=calebzulawskiMatthias Krüger-4/+4
Fix some SIMD intrinsics documentation Spotted some mistakes in the docs of some SIMD intrinsics.
2024-05-24Rollup merge of #125485 - GuillaumeGomez:migrate-rmake-rustdoc, r=jieyouxuMatthias Krüger-9/+16
Migrate `run-make/rustdoc-with-output-dir-option` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `@jieyouxu`
2024-05-24Rollup merge of #125483 - ↵Matthias Krüger-9/+9
workingjubilee:move-transform-validate-to-mir-transform, r=oli-obk compiler: validate.rs belongs next to what it validates It's hard to find code that is deeply nested and far away from its callsites, so let's move `rustc_const_eval::transform::validate` into `rustc_mir_transform`, where all of its callers are. As `rustc_mir_transform` already depends on `rustc_const_eval`, the added visible dependency edge doesn't mean the dependency tree got any worse. This also lets us unnest the `check_consts` module. I did look into moving everything inside `rustc_const_eval::transform` into `rustc_mir_transform`. It turned out to be a much more complex operation, with more concerns and real edges into the `const_eval` crate, whereas this was both faster and more obvious.
2024-05-24Rollup merge of #125467 - compiler-errors:binop-in-bool-expectation, r=estebankMatthias Krüger-1/+47
Only suppress binop error in favor of semicolon suggestion if we're in an assignment statement Similar to #123722, we are currently too aggressive when delaying a binop error with the expectation that we'll emit another error elsewhere. This adjusts that heuristic to be more accurate, at the cost of some possibly poorer suggestions. Fixes #125458
2024-05-24tag more stuff with `WG-trait-system-refactor`lcnr-1/+4
2024-05-24Structurally resolve before builtin_index in EUVMichael Goulet-1/+18
2024-05-24bootstrap: test target specific config overridesWeihang Lo-4/+45
Debug, PartialEq, and Eq are derived for testing purposes.
2024-05-24bootstrap: support target specific config overridesWeihang Lo-1/+14
2024-05-24Better ICE message for unresolved upvarsMichael Goulet-2/+13
2024-05-24Auto merge of #125499 - matthiaskrgr:rollup-84i5z5w, r=matthiaskrgrbors-56/+185
Rollup of 5 pull requests Successful merges: - #125455 (Make `clamp` inline) - #125477 (Run rustfmt on files that need it.) - #125481 (Fix the dead link in the bootstrap README) - #125482 (Notify kobzol after changes to `opt-dist`) - #125489 (Revert problematic opaque type change) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-24remove proof tree formatter, make em shallowlcnr-505/+135
2024-05-24Stop using the avx512er and avx512pf x86 target featuresHans Wennborg-6/+2
They are no longer supported by LLVM 19. Fixes #125492
2024-05-24Actually just remove the special case altogetherMichael Goulet-97/+71
2024-05-24miri: receive the blessings of validate.rsJubilee Young-1/+1
2024-05-24clippy: unnest check_constsJubilee Young-1/+1
2024-05-24compiler: unnest rustc_const_eval::check_constsJubilee Young-4/+3
2024-05-24compiler: const_eval/transform/validate.rs -> mir_transform/validate.rsJubilee Young-3/+4
2024-05-24rustdoc-json: Add test for keywords with `--document-private-items`Alona Enraght-Moony-0/+20
2024-05-24Rollup merge of #125489 - oli-obk:revert_stuff_2, r=compiler-errorsMatthias Krüger-37/+138
Revert problematic opaque type change fixes https://github.com/rust-lang/rust/issues/124891 fixes https://github.com/rust-lang/rust/issues/125192 reverts https://github.com/rust-lang/rust/pull/123979