about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-02-26add regression testslcnr-0/+52
2024-02-26update testslcnr-68/+68
2024-02-26use fulfillment in `Coerce::unify'lcnr-11/+15
only checking whether nested goals hold means that we don't consider their inference constraints. Given that we now emit `AliasRelate` when relating aliases and infer vars, this previously resulted in an "unconstrained" inference var in `coerce_unsized`.
2024-02-26always emit `AliasRelate` goals when relating aliaseslcnr-275/+420
Add `StructurallyRelateAliases` to allow instantiating infer vars with rigid aliases. Change `instantiate_query_response` to be infallible in the new solver. This requires canonicalization to not hide any information used by the query, so weaken universe compression. It also modifies `term_is_fully_unconstrained` to allow region inference variables in a higher universe.
2024-02-26add additional logginglcnr-1/+8
2024-02-26Auto merge of #121317 - ChrisDenton:win10-sync, r=Mark-Simulacrumbors-108/+156
Always use WaitOnAddress on Win10+ `WaitOnAddress` and `WakeByAddressSingle` are always available since Windows 8 so they can now be used without needing to delay load. I've also moved the Windows 7 thread parking fallbacks into a separate sub-module.
2024-02-25Add synchronization library to run-make flagsChris Denton-2/+2
2024-02-26Auto merge of #121461 - reitermarkus:generic-nonzero-tests, r=dtolnaybors-517/+520
Use generic `NonZero` in tests. Tracking issue: https://github.com/rust-lang/rust/issues/120257 r? `@dtolnay`
2024-02-25Auto merge of #121182 - majaha:mingw_ci_new, r=Mark-Simulacrumbors-32/+132
Improvements to building and CI for mingw/msys I was getting error messages when trying to follow the build instructions the mingw build for Rust, and managed to track the issue down to an incomparability of Rust's bootstrap program with MSYS2's version of git. Essentially, the problem is that MSYS2's git works in emulated unix-y paths, but bootstrap expects a Windows path. I found a workaround for this by using relative paths instead of absolute paths. Along with that fix, this PR also updates the build instructions for MinGW to be compatible with modern versions of MSYS2, and some changes to CI to make sure that MSYS2's version of git is tested. In particular, I'm suggesting using the [MSYS2 github action](https://github.com/marketplace/actions/setup-msys2) specially made for this purpose, which is much less hacky than the old approach and gives us more control of what packages are installed. I also cleaned up as many alternate versions of key tools as I could find from PATH, to avoid accidental usage, and cleaned up some abuses of the `CUSTOM_MINGW` environment variable. This fixes https://github.com/rust-lang/rust/issues/105696 and fixes https://github.com/rust-lang/rust/issues/117567
2024-02-25Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkinbors-92/+1518
Implement RFC 3373: Avoid non-local definitions in functions This PR implements [RFC 3373: Avoid non-local definitions in functions](https://github.com/rust-lang/rust/issues/120363).
2024-02-25Auto merge of #121591 - matthiaskrgr:rollup-8wfhh3v, r=matthiaskrgrbors-544/+615
Rollup of 9 pull requests Successful merges: - #119590 (Stabilize `cfg_target_abi`) - #120805 (make non-PartialEq-typed consts as patterns a hard error) - #121060 (Add newtypes for bool fields/params/return types) - #121284 (Add test cases for inlining compiler-private items) - #121324 (pattern_analysis: factor out unspecialization) - #121409 (Prevent cycle in implied predicates computation) - #121513 (Fix sgx unit test compilation) - #121570 (Make most bootstrap step types !Copy) - #121586 (Don't use `unwrap()` in `ArrayIntoIter` lint when typeck fails) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-25Rollup merge of #121586 - gurry:121532-ice-unwrap-on-none, r=cjgillotMatthias Krüger-5/+29
Don't use `unwrap()` in `ArrayIntoIter` lint when typeck fails Fixes #121532
2024-02-25Rollup merge of #121570 - Nilstrieb:!copy, r=clubby789Matthias Krüger-99/+99
Make most bootstrap step types !Copy This makes all bootstrap types except for `Compiler` and `TargetSelection` `!Copy`. This makes it easier to modify them by adding !Copy types in the future, something that `@saethlin` has complained about before, and comes at no cost of code clarity, the impls were completely unused. Making `Compiler` and `TargetSelection` `!Copy` (which would allow getting rid of interning) is highly nontrivial as they are used and copied **all over the place**. This should hopefully get most of the benefits.
2024-02-25Rollup merge of #121513 - nshyrei:fix_tests_module, r=cuviperMatthias Krüger-0/+0
Fix sgx unit test compilation Fixes a compilation error: ``` error[E0583]: file not found for module `tests` --> library/std/src/sys/locks/rwlock/sgx.rs:2:1 | 2 | mod tests; | ^^^^^^^^^^ | = help: to create the module `tests`, create file "library/std/src/sys/locks/rwlock/sgx/tests.rs" or "library/std/src/sys/locks/rwlock/sgx/tests/mod.rs" = note: if there is a `mod tests` elsewhere in the crate already, import it with `use crate::...` instead For more information about this error, try `rustc --explain E0583`. error: could not compile `std` (lib test) due to 1 previous error` ``` When running command: ``` `TF_BUILD=True RUST_TEST_THREADS=1 ./x.py test --stage 1 "library/std" tests/assembly tests/run-make --target=x86_64-fortanix-unknown-sgx --no-doc --exclude src/tools/linkchecker --exclude src/tools/rust-demangler --no-fail-fast 2>&1 ``` The fix is done by moving a file to the location suggested by the compiler. The issue was introduced by PR: https://github.com/rust-lang/rust/pull/121177
2024-02-25Rollup merge of #121409 - compiler-errors:atb-cycle, r=cjgillotMatthias Krüger-8/+49
Prevent cycle in implied predicates computation Makes #65913 from hang -> fail. I believe fail is the correct state for this test to remain for the long term.
2024-02-25Rollup merge of #121324 - Nadrieril:unspecialize, r=cjgillotMatthias Krüger-15/+21
pattern_analysis: factor out unspecialization Just moving a dense bit of logic into its own method.
2024-02-25Rollup merge of #121284 - notriddle:notriddle/issue-106421, r=Mark-SimulacrumMatthias Krüger-0/+25
Add test cases for inlining compiler-private items Closes #106421 This was already fixed by #121218, but now the test cases are added.
2024-02-25Rollup merge of #121060 - clubby789:bool-newtypes, r=cjgillotMatthias Krüger-207/+332
Add newtypes for bool fields/params/return types Fixed all the cases of this found with some simple searches for `*/ bool` and `bool /*`; probably many more
2024-02-25Rollup merge of #120805 - RalfJung:const-pat-partial-eq, r=oli-obkMatthias Krüger-112/+27
make non-PartialEq-typed consts as patterns a hard error This lint was introduced in https://github.com/rust-lang/rust/pull/115893, for Rust 1.74, so we just had the third stable release where this is shown as a future-compat lint (which is shown for dependencies). Not a single comment or backreference showed up in the tracking issue, https://github.com/rust-lang/rust/issues/116122. So this seems fairly safe to turn into a hard error. Of course we should do a crater run first. This is part of https://github.com/rust-lang/rust/issues/120362. Closes https://github.com/rust-lang/rust/issues/116122.
2024-02-25Rollup merge of #119590 - ChrisDenton:cfg-target-abi, r=NilstriebMatthias Krüger-98/+33
Stabilize `cfg_target_abi` This stabilizes the `cfg` option called `target_abi`: ```rust #[cfg(target_abi = "eabihf")] ``` Tracking issue: #80970 fixes #78791 resolves #80970
2024-02-25Auto merge of #121337 - ChrisDenton:ProcessPrng, r=Mark-Simulacrumbors-44/+83
Windows: Use ProcessPrng for random keys Windows 10 introduced [`ProcessPrng`](https://learn.microsoft.com/en-us/windows/win32/seccng/processprng) for random number generation. This allows us to replace the overly complicated (and prone to failure) `BCryptGenRandom` with a documented function. For the tier 3 Windows 7 target, we simply use the older `RtlGenRandom`, which is undocumented. It should be fine even on modern systems (for comparability reasons) as it's just a wrapper for `ProcessPrng`. However, it does require loading an extra intermediary DLL which we can avoid when we know we have Windows 10+.
2024-02-25Cranelift: Don't use raw-dylib in stdChris Denton-0/+47
2024-02-25Add ProcessPrng shim to MiriChris Denton-0/+8
This is essentially the same as SystemFunction036 (aka RtlGenRandom) except that the given length is a usize instead of a u32
2024-02-25Windows: Use ProcessPrng for random keysChris Denton-44/+28
2024-02-25Don't use `unwrap()` in `ArrayIntoIter` lint when typeck failsGurinder Singh-5/+29
2024-02-25Auto merge of #118724 - onur-ozkan:refactor-x-install, r=Mark-Simulacrumbors-4/+37
speed up `x install` by skipping archiving and compression Performing archiving and compression on `x install` is nothing more than a waste of time and resources. Additionally, for systems like gentoo(which uses `x install`) this should be highly beneficial. [benchmark report](https://github.com/rust-lang/rust/pull/118724#issuecomment-1848964908) Resolves #109308 r? Mark-Simulacrum (I think you want to review this, feel free to change it if otherwise.)
2024-02-25Use generic `NonZero` in tests.Markus Reiter-517/+520
2024-02-25make non-PartialEq-typed consts as patterns a hard errorRalf Jung-112/+27
2024-02-25Auto merge of #121581 - lnicola:sync-from-ra, r=lnicolabors-704/+1828
Subtree update of `rust-analyzer` r? `@ghost`
2024-02-25Auto merge of #121579 - RalfJung:miri, r=RalfJungbors-322/+460
Miri subtree update r? `@ghost`
2024-02-25Avoid using cfg(FALSE)Laurențiu Nicola-2/+1
2024-02-25Add missing importsLaurențiu Nicola-1/+1
2024-02-25Merge commit '4a8d0f7f565b6df45da5522dd7366a4df3460cd7' into sync-from-raLaurențiu Nicola-703/+1828
2024-02-25bump rustc-build-sysrootRalf Jung-2/+3
2024-02-25Auto merge of #117107 - zachs18:mapped-mutex-guard, r=Amanieubors-4/+985
Implement `MappedMutexGuard`, `MappedRwLockReadGuard`, and `MappedRwLockWriteGuard`. ACP: https://github.com/rust-lang/libs-team/issues/260 Tracking issue: https://github.com/rust-lang/rust/issues/117108 <details> <summary> (Outdated) </summary> `MutexState`/`RwLockState` structs ~~Having `sys::(Mutex|RwLock)` and `poison::Flag` as separate fields in the `Mutex`/`RwLock` would require `MappedMutexGuard`/`MappedRwLockWriteGuard` to hold an additional pointer, so I combined the two fields into a `MutexState`/`RwLockState` struct. This should not noticeably affect perf or layout, but requires an additional field projection when accessing the former `.inner` or `.poison` fields (now `.state.inner` and `.state.poison`).~~ If this is not desired, then `MappedMutexGuard`/`MappedRwLockWriteGuard` can instead hold separate pointers to the two fields. </details> The doc-comments are mostly copied from the existing `*Guard` doc-comments, with some parts from `lock_api::Mapped*Guard`'s doc-comments. Unresolved question: Are more tests needed?
2024-02-25Auto merge of #121114 - Nilstrieb:no-inline!, r=saethlinbors-3/+107
Add `#[rustc_no_mir_inline]` for standard library UB checks should help with #121110 and also with #120848 Because the MIR inliner cannot know whether the checks are enabled or not, so inlining is an unnecessary compile time pessimization when debug assertions are disabled. LLVM knows whether they are enabled or not, so it can optimize accordingly without wasting time. r? `@saethlin`
2024-02-25Auto merge of #120650 - clubby789:switchint-const, r=saethlinbors-5/+80
Use `br` instead of a conditional when switching on a constant boolean r? `@ghost`
2024-02-24Auto merge of #121569 - matthiaskrgr:rollup-awglrax, r=matthiaskrgrbors-970/+592
Rollup of 7 pull requests Successful merges: - #121343 (Add examples for some methods on slices) - #121374 (match lowering: Split off `test_candidates` into several functions and improve comments) - #121474 (Ignore compiletest test directive migration commits) - #121515 (promotion: don't promote int::MIN / -1) - #121530 (Fix incorrect doc of ScopedJoinHandle::is_finished) - #121551 (Forbid use of `extern "C-unwind"` inside standard library) - #121556 (Use `addr_of!`) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-24Add test cases for inlining compiler-private itemsMichael Howell-0/+25
Closes #106421 This was already fixed by f5d43a052b9eb464e54af819143467954d814a24, but now the test cases are added.
2024-02-24Make most bootstrap step types !CopyNilstrieb-99/+99
This makes all bootstrap types except for `Compiler` and `TargetSelection` `!Copy`. This makes it easier to modify them by adding !Copy types in the future and comes at no cost of code clarity, the impls were completely unused.
2024-02-24Rollup merge of #121556 - GrigorenkoPV:addr_of, r=NilstriebMatthias Krüger-83/+92
Use `addr_of!` As per https://github.com/rust-lang/rust/pull/121303#discussion_r1500954662
2024-02-24Rollup merge of #121551 - nbdd0121:ffi_unwind, r=RalfJungMatthias Krüger-0/+3
Forbid use of `extern "C-unwind"` inside standard library Those libraries are build with `-C panic=unwind` and is expected to be linkable to `-C panic=abort` library. To ensure unsoundness compiler needs to prevent a `C-unwind` call to exist, as doing so may leak foreign exceptions into `-C panic=abort`. r? ``@RalfJung``
2024-02-24Rollup merge of #121530 - wgslr:master, r=Mark-SimulacrumMatthias Krüger-1/+1
Fix incorrect doc of ScopedJoinHandle::is_finished Fixes the explanation how to use `is_finished` to achieve a non-blocking join. The updated version matches the documentation of the non-scoped JoinHandle::is_finished.
2024-02-24Rollup merge of #121515 - RalfJung:fallible-promotion, r=oli-obkMatthias Krüger-734/+265
promotion: don't promote int::MIN / -1 Looks like I entirely forgot about this case when adding the div-by-zero check, which was supposed to ensure that we never promote operations that can fail... Cc https://github.com/rust-lang/rust/issues/80619 This is a breaking change, so needs a crater run. r? ``@oli-obk``
2024-02-24Rollup merge of #121474 - jieyouxu:ignore-directives-migration, ↵Matthias Krüger-0/+3
r=Mark-Simulacrum Ignore compiletest test directive migration commits Not sure if the corresponding bors commit need to be included as well, assuming not.
2024-02-24Rollup merge of #121374 - Nadrieril:factor-explain, r=matthewjasperMatthias Krüger-151/+218
match lowering: Split off `test_candidates` into several functions and improve comments The logic of `test_candidates` has three steps: pick a test, sort the candidates, and generate code for everything. So I split it off into three methods. I also ended up reworking the comments that explain the algorithm. In particular I added detailed examples. I removed the digression about https://github.com/rust-lang/rust/issues/29740 because it's no longer relevant to how the code is structured today. r? ``@matthewjasper``
2024-02-24Rollup merge of #121343 - Takashiidobe:takashi/examples-for-slice, ↵Matthias Krüger-1/+10
r=Mark-Simulacrum Add examples for some methods on slices Adds some examples to some methods on slice. `is_empty` didn't have an example for an empty slice, even though `str` and the collections all have one, so I added that in. `first_mut` and `last_mut` didn't have an example for what happens when the slice is empty, whereas `first` and `last` do, so I added that too.
2024-02-24Auto merge of #121549 - matthiaskrgr:rollup-1hvu3lb, r=matthiaskrgrbors-152/+189
Rollup of 7 pull requests Successful merges: - #121435 (Account for RPITIT in E0310 explicit lifetime constraint suggestion) - #121490 (Rustdoc: include crate name in links for local primitives) - #121520 (delay cloning of iterator items) - #121522 (check that simd_insert/extract indices are in-bounds) - #121531 (Ignore less tests in debug builds) - #121539 (compiler/rustc_target/src/spec/base/apple/tests.rs: Avoid unnecessary large move) - #121542 (update stdarch) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-24Stabilize `cfg_target_abi`Chris Denton-98/+33
2024-02-24Add `#[rustc_no_mir_inline]` for standard library UB checksNilstrieb-3/+107
Co-authored-by: Ben Kimock <kimockb@gmail.com>