about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-01-30Improve documentation for file lockingJosh Triplett-17/+40
Add notes to each method stating that locks get dropped on close. Clarify the return values of the try methods: they're only defined if the lock is held via a *different* file handle/descriptor. That goes along with the documentation that calling them while holding a lock via the *same* file handle/descriptor may deadlock. Document the behavior of unlock if no lock is held.
2025-01-30Auto merge of #136272 - Zalathar:rollup-6s577l5, r=Zalatharbors-227/+296
Rollup of 5 pull requests Successful merges: - #135847 (optimize slice::ptr_rotate for small rotates) - #136215 (btree/node.rs: remove incorrect comment from pop_internal_level docs) - #136252 (spastorino back from vacations) - #136254 (Rustc dev guide subtree update) - #136259 (Cleanup docs for Allocator) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-30Rollup merge of #136259 - hkBst:patch-30, r=thomccStuart Cook-31/+27
Cleanup docs for Allocator This is an attempt to remove ungrammatical constructions and clean up the prose. I've sometimes had to try hard to understand what was being stated, so it is possible that I've misunderstood the original meaning. In particular, I did not see a difference between: - the borrow-checker lifetime of the allocator type itself. - as long as at least one of the allocator instance and all of its clones has not been dropped.
2025-01-30Rollup merge of #136254 - BoxyUwU:rdg-push, r=KobzolStuart Cook-41/+55
Rustc dev guide subtree update r? `@Kobzol`
2025-01-30Rollup merge of #136252 - spastorino:remove-spastorino-on-vacations, r=jieyouxuStuart Cook-1/+0
spastorino back from vacations
2025-01-30Rollup merge of #136215 - btj:patch-1, r=cuviperStuart Cook-2/+2
btree/node.rs: remove incorrect comment from pop_internal_level docs
2025-01-30Rollup merge of #135847 - edwloef:slice_ptr_rotate_opt, r=scottmcmStuart Cook-152/+212
optimize slice::ptr_rotate for small rotates r? `@scottmcm` This swaps the positions and numberings of algorithms 1 and 2 in `slice::ptr_rotate`, and pulls the entire outer loop into algorithm 3 since it was redundant for the first two. Effectively, `ptr_rotate` now always does the `memcpy`+`memmove`+`memcpy` sequence if the shifts fit into the stack buffer. With this change, an `IndexMap`-style `move_index` function is optimized correctly. Assembly comparisons: - `move_index`, before: https://godbolt.org/z/Kr616KnYM - `move_index`, after: https://godbolt.org/z/1aoov6j8h - the code from `#89714`, before: https://godbolt.org/z/Y4zaPxEG6 - the code from `#89714`, after: https://godbolt.org/z/1dPx83axc related to #89714 some relevant discussion in https://internals.rust-lang.org/t/idea-shift-move-to-efficiently-move-elements-in-a-vec/22184 Behavior tests pass locally. I can't get any consistent microbenchmark results on my machine, but the assembly diffs look promising.
2025-01-30Auto merge of #136035 - SpecificProtagonist:miri-zeroed-alloc, r=oli-obkbors-79/+88
miri: optimize zeroed alloc When allocating zero-initialized memory in MIR interpretation, rustc allocates zeroed memory, marks it as initialized and then re-zeroes it. Remove the last step. I don't expect this to have much of an effect on performance normally, but in my case in which I'm creating a large allocation via mmap it gets in the way.
2025-01-29Auto merge of #135818 - jieyouxu:migrate-translation, r=compiler-errorsbors-81/+208
tests: Port `translation` to rmake.rs Part of #121876. This PR partially supersedes #129011 and is co-authored with `@Oneirical.` ## Summary This PR ports `tests/run-make/translation` to rmake.rs. Notable changes from the Makefile version include: - We now actually fail if the rustc invocations fail... The Makefile did not have `SHELL=/bin/bash -o pipefail`, so all the piped rustc invocations to grep vacuously succeeded, even if the broken ftl test case actually regressed over time and ICEs on current master. - That test case is converted to assert it fails with a FIXME backlinking to #135817. - The test coverage is expanded to not ignore windows. Instead, the test now uses symlink capability detection to gate test execution. - Added some backlinks to relevant tracking issues and the initial translation infra implementation PR. ## Review advice Best reviewed commit-by-commit. r? compiler try-job: aarch64-apple try-job: i686-mingw
2025-01-29Auto merge of #134248 - oli-obk:patkind-path-removal, r=BoxyUwUbors-183/+299
Merge `PatKind::Path` into `PatKind::Expr` Follow-up to #134228 We always had a duplication where `Path`s could be represented as `PatKind::Path` or `PatKind::Lit(ExprKind::Path)`. We had to handle both everywhere, and still do after #134228, so I'm removing it now.
2025-01-29Cleanup docs for AllocatorMarijn Schouten-31/+27
2025-01-29add inline attribute and codegen testedwloef-0/+34
2025-01-29split slice::ptr_rotate into three separate algorithms, to hopefully help ↵edwloef-174/+195
inlining
2025-01-29Rustc pullBoxy-16876/+29059
2025-01-29spastorino back from vacationsSantiago Pastorino-1/+0
2025-01-29Auto merge of #136248 - matthiaskrgr:rollup-leaxgfd, r=matthiaskrgrbors-206/+321
Rollup of 8 pull requests Successful merges: - #133382 (Suggest considering casting fn item as fn pointer in more cases) - #136092 (Test pipes also when not running on Windows and Linux simultaneously) - #136190 (Remove duplicated code in RISC-V asm bad-reg test) - #136192 (ci: remove unused windows runner) - #136205 (Properly check that array length is valid type during built-in unsizing in index) - #136211 (Update mdbook to 0.4.44) - #136212 (Tweak `&mut self` suggestion span) - #136214 (Make crate AST mutation accessible for driver callback) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-29Handle all `PatExpr`s in dead code analysisOli Scherer-23/+15
2025-01-29Add regression test showing we don't realize some consts are usedOli Scherer-8/+33
2025-01-29Eliminate PatKind::PathOli Scherer-174/+273
2025-01-29Rollup merge of #136214 - momvart:driver_callback_crate_mut, r=bjorn3Matthias Krüger-5/+5
Make crate AST mutation accessible for driver callback Following #134130, this brings back the ability to mutate AST before lowering.
2025-01-29Rollup merge of #136212 - estebank:span-tweak, r=petrochenkovMatthias Krüger-26/+21
Tweak `&mut self` suggestion span ``` error[E0596]: cannot borrow `*self.s` as mutable, as it is behind a `&` reference --> $DIR/issue-38147-1.rs:17:9 | LL | self.s.push('x'); | ^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable | help: consider changing this to be a mutable reference | LL | fn f(&mut self) { | +++ ``` Note the suggestion to add `mut` instead of replacing the entire `&self` with `&mut self`.
2025-01-29Rollup merge of #136211 - ehuss:update-mdbook, r=ehussMatthias Krüger-27/+27
Update mdbook to 0.4.44 Updates to mdbook 0.4.44. Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0444
2025-01-29Rollup merge of #136205 - compiler-errors:len-3, r=BoxyUwUMatthias Krüger-9/+63
Properly check that array length is valid type during built-in unsizing in index This results in duplicated errors, but this class of errors is not new; in general, we aren't really equipped to detect cases where a WF error due to a field type would be shadowed by the parent struct of that field also not being WF. This also adds a note for these types of mismatches to make it clear that this is due to an array type. Fixes #134352 r? boxyuwu
2025-01-29Rollup merge of #136192 - marcoieni:remove-windows-unused-runner, r=KobzolMatthias Krüger-4/+0
ci: remove unused windows runner
2025-01-29Rollup merge of #136190 - taiki-e:dedup, r=compiler-errorsMatthias Krüger-128/+90
Remove duplicated code in RISC-V asm bad-reg test I added this test in https://github.com/rust-lang/rust/pull/132516, but I accidentally repeated the same check twice. https://github.com/rust-lang/rust/blob/aa6f5ab18e67cb815f73e0d53d217bc54b0da924/tests/ui/asm/riscv/bad-reg.rs#L39-L42
2025-01-29Rollup merge of #136092 - tbu-:pr_io_pipe_test, r=joboetMatthias Krüger-1/+1
Test pipes also when not running on Windows and Linux simultaneously Fixes https://github.com/rust-lang/rust/pull/135635#pullrequestreview-2574184488. Based on top of #135635 to avoid merge conflicts.
2025-01-29Rollup merge of #133382 - mu001999-contrib:diag/fnitem, r=lcnrMatthias Krüger-6/+114
Suggest considering casting fn item as fn pointer in more cases Fixes #132648
2025-01-29Auto merge of #136227 - fmease:rollup-ewpvznh, r=fmeasebors-755/+1812
Rollup of 9 pull requests Successful merges: - #136121 (Deduplicate operand creation between scalars, non-scalars and string patterns) - #136134 (Fix SIMD codegen tests on LLVM 20) - #136153 (Locate asan-odr-win with other sanitizer tests) - #136161 (rustdoc: add nobuild typescript checking to our JS) - #136166 (interpret: is_alloc_live: check global allocs last) - #136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items) - #136170 (Reject unsound toggling of Arm atomics-32 target feature) - #136176 (Render pattern types nicely in mir dumps) - #136186 (uefi: process: Fix args) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-29Auto merge of #136117 - lnicola:sync-from-ra, r=lnicolabors-1325/+2163
Subtree update of `rust-analyzer` r? `@ghost`
2025-01-29tests: port `translation` to rmake.rs许杰友 Jieyou Xu (Joe)-79/+194
Co-authored-by: Oneirical <manchot@videotron.ca>
2025-01-29run-make-support: improve docs for `assert_exit_code`许杰友 Jieyou Xu (Joe)-1/+5
2025-01-29run-make-support: add `sysroot` helper许杰友 Jieyou Xu (Joe)-1/+9
Convenience helper for `rustc --print=sysroot`.
2025-01-29btree/node.rs: pop_internal_level: does not invalidate other handlesBart Jacobs-0/+3
2025-01-29Merge pull request #2227 from Joren-vanGoethem/master许杰友 Jieyou Xu (Joe)-1/+0
2025-01-29Rollup merge of #136186 - Ayush1325:uefi-process-args-fix, ↵León Orell Valerian Liehr-4/+3
r=nicholasbishop,Noratrieb uefi: process: Fix args - While working on process env support, I found that args were currently broken. Not sure how I missed it in the PR, but well here is the fix. - Additionally, no point in adding space at the end of args.
2025-01-29Rollup merge of #136176 - oli-obk:pattern-type-mir-opts, r=compiler-errorsLeón Orell Valerian Liehr-0/+31
Render pattern types nicely in mir dumps avoid falling through to the fallback rendering that just does a hex dump r? ``@scottmcm`` best reviewed commit by commit
2025-01-29Rollup merge of #136170 - taiki-e:atomics-32, r=workingjubileeLeón Orell Valerian Liehr-0/+5
Reject unsound toggling of Arm atomics-32 target feature This target feature has the same semantics as RISC-V `forced-atomics` target feature that already marked as Forbidden (https://github.com/llvm/llvm-project/commit/f5ed0cb217a9988f97b55f2ccb053bca7b41cc0c) and toggling it can cause ABI incompatibility. https://github.com/rust-lang/rust/blob/2f348cb7ce4063fa4eb40038e6ada3c5214717bd/compiler/rustc_target/src/target_features.rs#L479-L483 [Comment on feature definition in LLVM](https://github.com/llvm/llvm-project/blob/7109f521975e9cc2e8ba4f52ac2a8e1140bd49b5/llvm/lib/Target/ARM/ARMFeatures.td#L572-L574) also says: > Code built with this feature is not ABI-compatible with code built without this feature, if atomic variables are exposed across the ABI boundary. r? `@workingjubilee` or `@RalfJung` `@rustbot` label +O-Arm
2025-01-29Rollup merge of #136168 - fmease:gci-fix-mono, r=compiler-errorsLeón Orell Valerian Liehr-4/+47
GCI: Don't try to eval / collect mono items inside overly generic free const items Fixes #136156. Thanks for the pointers, errs! There's one (preexisting) thing of note (maybe?). There's a difference between `const _: () = panic!();` and `const _<'a>: () = panic!();`: The former is a pre-mono error, the latter is a post-mono error. For comparison, both `fn _f() { const { panic!() } }` and `fn _f<'a: 'a>() { const { panic!() } }` are post-mono errors. cc `@oli-obk` r? compiler-errors or reassign
2025-01-29Rollup merge of #136166 - RalfJung:interpet-is-alloc-live, r=compiler-errorsLeón Orell Valerian Liehr-2/+4
interpret: is_alloc_live: check global allocs last See https://github.com/rust-lang/rust/pull/136105#discussion_r1930609553. (A perf run makes no sense as this is only used by Miri.)
2025-01-29Rollup merge of #136161 - notriddle:typescript, r=GuillaumeGomezLeón Orell Valerian Liehr-682/+1658
rustdoc: add nobuild typescript checking to our JS By nobuild, I mean that the type annotations are all [in comments], not in the "native" typescript syntax. This is a bit uglier, but it lets you rapid-prototype without tsc, works with all the native browser debugging tools, and keeps Node out of Rust's bootstrap chain. [in comments]: https://news.ycombinator.com/item?id=35892250 This pull request mostly just adds ts-ignore annotations and type declarations. To actually take good advantage of typescript, we'll want to "burn down" this pile of unsafe code until we eventually have a version with almost none of these. This PR also adds tsc to the mingw-check Dockerfile, so that it can't fall out of date like the Closure annotations did. https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/typescript r? `@GuillaumeGomez` `@lolbinarycat`
2025-01-29Rollup merge of #136153 - tmiasko:mv-asan-test, r=lqdLeón Orell Valerian Liehr-0/+0
Locate asan-odr-win with other sanitizer tests
2025-01-29Rollup merge of #136134 - nikic:llvm-20-simd-tests, r=UrgauLeón Orell Valerian Liehr-14/+14
Fix SIMD codegen tests on LLVM 20 The splat constants are printed differently on LLVM 20.
2025-01-29Rollup merge of #136121 - oli-obk:push-zzvxlynmnqpp, r=estebankLeón Orell Valerian Liehr-49/+50
Deduplicate operand creation between scalars, non-scalars and string patterns just something that felt duplicated and would make pattern type handling a bit more roundabout.
2025-01-29Merge pull request #2231 from yegeunyang/#2069许杰友 Jieyou Xu (Joe)-0/+4
2025-01-29Auto merge of #136225 - fmease:rollup-fm7m744, r=fmeasebors-391/+559
Rollup of 7 pull requests Successful merges: - #135625 ([cfg_match] Document the use of expressions.) - #135902 (Do not consider child bound assumptions for rigid alias) - #135943 (Rename `Piece::String` to `Piece::Lit`) - #136104 (Add mermaid graphs of NLL regions and SCCs to polonius MIR dump) - #136143 (Update books) - #136147 (ABI-required target features: warn when they are missing in base CPU) - #136164 (Refactor FnKind variant to hold &Fn) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-28Touch up a sentenceyegeunyang-1/+1
2025-01-29Merge pull request #2232 from yegeunyang/#2114许杰友 Jieyou Xu (Joe)-1/+1
Add a link to declare_lint! macro doc in diagnostics.md
2025-01-29Merge pull request #2229 from notriddle/typescript许杰友 Jieyou Xu (Joe)-0/+9
Add some extra pointers for rustdoc frontend devs
2025-01-28Add link to declare_lint! macroyegeunyang-1/+1
2025-01-28Add "Writing tests" sectionyegeunyang-0/+4