about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-13Simplify lit_to_mir_constant a bitbjorn3-16/+11
2025-03-13Return blocks from DropTree::build_mirbjorn3-20/+17
Rather than requiring the user to pass in a correctly sized blocks map.
2025-03-13Auto merge of #138249 - compiler-errors:auto-self, r=lcnrbors-43/+4
Do not register `Self: AutoTrait` when confirming auto trait (in old solver) Every built-in auto impl for a trait goal like `Ty: Auto` immediately registers another obligation of `Ty: Auto` as one of its nested obligations, leading to us stressing the cycle detection machinery a lot more than we need to. This is because all traits have a `Self: Trait` predicate. To fix this, remove the call to `impl_or_trait_obligations` in `vtable_auto_impl`, since auto traits do not have where clauses. r? lcnr
2025-03-13Auto merge of #138416 - Manishearth:rollup-fejor9p, r=Manishearthbors-1448/+1488
Rollup of 12 pull requests Successful merges: - #134076 (Stabilize `std::io::ErrorKind::InvalidFilename`) - #137504 (Move methods from Map to TyCtxt, part 4.) - #138175 (Support rmeta inputs for --crate-type=bin --emit=obj) - #138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs) - #138280 (fix ICE in pretty-printing `global_asm!`) - #138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js) - #138331 (Use `RUSTC_LINT_FLAGS` more) - #138357 (merge `TypeChecker` and `TypeVerifier`) - #138394 (remove unnecessary variant) - #138403 (Delegation: one more ICE fix for `MethodCall` generation) - #138407 (Delegation: reject C-variadics) - #138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-12Auto merge of #138076 - tmiasko:pred-count, r=matthewjasperbors-3/+6
Calculate predecessor count directly Avoid allocating a vector of small vectors merely to determine how many predecessors each basic block has. Additionally use u8 and saturating operations. The pass only needs to distinguish between [0..1] and [2..].
2025-03-12Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgrbors-815/+836
Rollup of 7 pull requests Successful merges: - #137314 (change definitely unproductive cycles to error) - #137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`) - #138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr) - #138331 (Use `RUSTC_LINT_FLAGS` more) - #138345 (Some autodiff cleanups) - #138387 (intrinsics: remove unnecessary leading underscore from argument names) - #138390 (fix incorrect tracing log) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-12Rollup merge of #138409 - xingxue-ibm:use-sigaction, r=compiler-errorsManish Goregaokar-24/+3
Use sa_sigaction instead of sa_union.__su_sigaction for AIX Revert test cases to use `sa_sigaction` instead of `sa_union.__su_sigaction`, now that the `libc` crate implementation for AIX defines `sa_sigaction` as a direct member of `struct sigaction`, aligning it with implementations on other similar platforms. ([[AIX] Use sa_sigaction instead of the union](https://github.com/rust-lang/libc/pull/4250)).
2025-03-12Rollup merge of #138407 - Bryanskiy:delegation-variadic, r=petrochenkovManish Goregaokar-11/+52
Delegation: reject C-variadics The explanation is contained in attached issues. Fixes https://github.com/rust-lang/rust/issues/127443 Fixes https://github.com/rust-lang/rust/issues/127413 r? `@petrochenkov`
2025-03-12Rollup merge of #138403 - Bryanskiy:delegation-ice-2, r=petrochenkovManish Goregaokar-0/+35
Delegation: one more ICE fix for `MethodCall` generation self-explanatory Fixes https://github.com/rust-lang/rust/issues/138362 r? `@petrochenkov`
2025-03-12Rollup merge of #138394 - lcnr:yeet-variant, r=compiler-errorsManish Goregaokar-11/+6
remove unnecessary variant
2025-03-12Rollup merge of #138357 - lcnr:goodbye-TypeVerifier-rarw, r=compiler-errorsManish Goregaokar-806/+697
merge `TypeChecker` and `TypeVerifier` Stacked on top of #138354. Best reviewed commit by commit. r? `@compiler-errors`
2025-03-12Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, ↵Manish Goregaokar-95/+39
r=onur-ozkan,jieyouxu Use `RUSTC_LINT_FLAGS` more An alternative to the failed #138084. Fixes #138106. r? `````@jieyouxu`````
2025-03-12Rollup merge of #138318 - lolbinarycat:rustdoc-js-less-expect-error-part2, ↵Manish Goregaokar-37/+52
r=notriddle Rustdoc: remove a bunch of @ts-expect-error from main.js r? ```````@notriddle``````` Most remaining instances of ````````@ts-expect-error```````` in `search.js` and `main.js` are some sort of unchecked assertion, most of them involving nullibility, and we have yet to decide on how to handle these.
2025-03-12Rollup merge of #138280 - folkertdev:mir-dump-asm-const, r=compiler-errorsManish Goregaokar-1/+22
fix ICE in pretty-printing `global_asm!` fixes https://github.com/rust-lang/rust/issues/138260 since https://github.com/rust-lang/rust/pull/137180, `global_asm!` gets a fake body, that the pretty printing logic did not know what to do with. based on [#t-compiler/help > tests for MIR pretty printing](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/tests.20for.20MIR.20pretty.20printing) I created `tests/ui/unpretty/mir` which seemed as good a place as any for a test. If there is a better place, let me know. try-job: test-various try-job: x86_64-apple-2
2025-03-12Rollup merge of #138259 - compiler-errors:disentangle-ribs, r=BoxyUwUManish Goregaokar-114/+196
Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs In #137617, the `ConstParamTy` rib was adjusted to act kinda like the `ForwardGenericParamBan`. However, this means that it no longer served its purpose banning generics from *parent items*. Although we still are checking for param type validity using the `ConstParamTy_` trait, which means that we weren't accepting code we shouldn't, I think it's a bit strange for us not to be rejecting code like this during *resolution* and instead letting these malformed const generics leak into the type system: ```rust trait Foo<T> { fn bar<const N: T>() {} } ``` This PR does a few things: 1. Introduce a `ForwardGenericParamBanReason` enum, and start using the `ForwardGenericParamBan` rib to ban forward-declared params in const tys when `generic_const_parameter_types` is enabled. 2. Start using the `ConstParamTy` rib to ban *all* generics when `generic_const_parameter_types` is disabled. 3. Improve the diagnostics for both of the cases above, and for forward-declared params in parameter defaults too :3 r? `@BoxyUwU` or reassign
2025-03-12Rollup merge of #138175 - sam-mccall:binobj, r=nnethercoteManish Goregaokar-1/+33
Support rmeta inputs for --crate-type=bin --emit=obj This already works for --emit=metadata, but is possible anytime we're not linking. Tests: - `rmeta_bin` checks we're not changing --emit=link (already passes) - `rmeta_bin-pass` tests the new behavior for --emit=obj (would fail today) and also --emit=metadata which isn't changing
2025-03-12Rollup merge of #137504 - nnethercote:remove-Map-4, r=ZalatharManish Goregaokar-441/+390
Move methods from Map to TyCtxt, part 4. A follow-up to https://github.com/rust-lang/rust/pull/137350. r? ```@Zalathar```
2025-03-12Rollup merge of #134076 - GrigorenkoPV:InvalidFilename, r=joboetManish Goregaokar-2/+2
Stabilize `std::io::ErrorKind::InvalidFilename` FCP complete: https://github.com/rust-lang/rust/issues/130192#issuecomment-2674989358 Tracking issues: #86442 & #130192 This PR: - Stabilizes `InvalidFilename` without changing its name to `InvalidFileName`. - Fixes the doc comment (https://github.com/rust-lang/rust/issues/130192#issuecomment-2429534640) - Does not separate "the name is too long" case into a separate `ErrorKind`. That case is currently documented to be covered by `InvalidFilename` in the doc. I'm not sure if it would be possible to change this later or if that would be an unacceptable breaking change. - Does not map more raw OS errors to this `ErrorKind` (as suggested in https://github.com/rust-lang/rust/issues/86442#issuecomment-1441709738). This can presumably be addressed later.
2025-03-12Rollup merge of #138390 - onur-ozkan:fix-invalid-tracing-log, r=jieyouxuMatthias Krüger-5/+1
fix incorrect tracing log Previous information is not correct.
2025-03-12Rollup merge of #138387 - RalfJung:intrinsic-arg-names, r=oli-obkMatthias Krüger-369/+362
intrinsics: remove unnecessary leading underscore from argument names This is unnecessary since https://github.com/rust-lang/rust/pull/135840.
2025-03-12Rollup merge of #138345 - oli-obk:autodiff-cleanup, r=compiler-errorsMatthias Krüger-11/+5
Some autodiff cleanups cc ````@ZuseZ4```` just some things I noticed
2025-03-12Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, ↵Matthias Krüger-95/+39
r=onur-ozkan,jieyouxu Use `RUSTC_LINT_FLAGS` more An alternative to the failed #138084. Fixes #138106. r? ````@jieyouxu````
2025-03-12Rollup merge of #138269 - Ayush1325:uefi-fs-permission, r=joboetMatthias Krüger-64/+35
uefi: fs: Implement FileType, FilePermissions and FileAttr - In UEFI, both FileType and FilePermissions are represented by the attr bitfield. - Using simple bools here since both are represented by a single bit. - Add `FILE_PERMISSION` mask for constructing attribute while change permissions. cc ````@nicholasbishop````
2025-03-12Rollup merge of #137701 - cuviper:sharded-hashtable, r=fmeaseMatthias Krüger-66/+109
Convert `ShardedHashMap` to use `hashbrown::HashTable` The `hash_raw_entry` feature (#56167) has finished fcp-close, so the compiler should stop using it to allow its removal. Several `Sharded` maps were using raw entries to avoid re-hashing between shard and map lookup, and we can do that with `hashbrown::HashTable` instead.
2025-03-12Rollup merge of #137314 - lcnr:cycles-with-unknown-kind, r=compiler-errorsMatthias Krüger-205/+285
change definitely unproductive cycles to error builds on top of #136824 by adding a third variant to `PathKind` for paths which may change to be coinductive in the future but must not be so right now. Most notably, impl where-clauses of not yet coinductive traits. With this, we can change cycles which are definitely unproductive to a proper error. This fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/114. This does not affect stable as we keep these cycles as ambiguous during coherence. r? ````````@compiler-errors```````` ````````@nikomatsakis````````
2025-03-12Disentangle ForwardGenericParamBan and ConstParamTy ribsMichael Goulet-114/+196
2025-03-12Use sa_sigaction instead of sa_union.__su_sigaction for AIX.Xing Xue-24/+3
2025-03-12Auto merge of #138083 - nnethercote:rm-NtItem-NtStmt, r=petrochenkovbors-141/+269
Remove `NtItem` and `NtStmt` Another piece of #124141. r? `@petrochenkov`
2025-03-12Delegation: reject C-variadicsBryanskiy-11/+52
2025-03-12Delegation: one more ICE fix for `MethodCall` generationBryanskiy-0/+35
2025-03-12Auto merge of #137612 - Kobzol:bootstrap-2024, r=onur-ozkanbors-53/+83
Update bootstrap to edition 2024 The stage0 compiler now supports edition 2024, so we can update bootstrap to it. I manually reviewed all the changes from `cargo fix --edition` and reverted most of them (`if let` -> `matches` changes and two unneeded usages of `use <>`). r? `@onur-ozkan` try-job: dist-x86_64-msvc
2025-03-12remove unnecessary variantlcnr-11/+6
2025-03-12fix incorrect tracing logonur-ozkan-5/+1
Previous information is not correct. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-12Auto merge of #138388 - matthiaskrgr:rollup-kbax8sz, r=matthiaskrgrbors-197/+354
Rollup of 8 pull requests Successful merges: - #138161 (Add PeekMut::refresh) - #138174 (Elaborate trait assumption in `receiver_is_dispatchable`) - #138313 (Update books) - #138347 (Reduce `kw::Empty` usage, part 2) - #138360 (Fix false-positive in `expr_or_init` and in the `invalid_from_utf8` lint) - #138372 (Refactor `pick2_mut` & `pick3_mut` to use `get_disjoint_mut`) - #138376 (Item-related cleanups) - #138377 (Remove unnecessary lifetime from `PatInfo`.) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-12Rollup merge of #138377 - nnethercote:rustc_hir_typeck, r=compiler-errorsMatthias Krüger-25/+27
Remove unnecessary lifetime from `PatInfo`. r? ```@jackh726```
2025-03-12Rollup merge of #138376 - nnethercote:hir-ItemKind-ident-precursors, ↵Matthias Krüger-56/+24
r=compiler-errors Item-related cleanups I have been looking at `hir::Item` closely and found a few minor cleanup opportunities. r? ```@spastorino```
2025-03-12Rollup merge of #138372 - Eclips4:issue-138196, r=scottmcmMatthias Krüger-15/+20
Refactor `pick2_mut` & `pick3_mut` to use `get_disjoint_mut` Closes #138196
2025-03-12Rollup merge of #138360 - Urgau:fix-fp-expr_or_init, r=wesleywiserMatthias Krüger-64/+58
Fix false-positive in `expr_or_init` and in the `invalid_from_utf8` lint This PR fixes the logic for finding initializer in the `expr_or_init` and `expr_or_init_with_outside_body` functions. If the binding were to be mutable (`let mut`), the logic wouldn't consider that the initializer expression could have been modified and would return the init expression even-trough multiple subsequent assignments could have been done. Example: ```rust let mut a = [99, 108, 130, 105, 112, 112]; // invalid, not UTF-8 loop { a = *b"clippy"; // valid break; } std::str::from_utf8_mut(&mut a); // currently warns, with this PR it doesn't ``` This PR modifies the logic to excludes mutable let bindings. Found when using `expr_or_init` in https://github.com/rust-lang/rust/pull/119220. r? compiler
2025-03-12Rollup merge of #138347 - nnethercote:less-kw-Empty-2, r=compiler-errorsMatthias Krüger-21/+41
Reduce `kw::Empty` usage, part 2 A few small `kw::Empty` removals, or steps toward removals. r? fmease
2025-03-12Rollup merge of #138313 - rustbot:docs-update, r=jieyouxuMatthias Krüger-0/+1
Update books ## rust-lang/book 11 commits in 4a01a9182496f807aaa5f72d93a25ce18bcbe105..81a976a237f84b8392c4ce1bd5fd076eb757a2eb 2025-02-27 22:10:41 UTC to 2025-02-24 18:36:27 UTC - Ch. 10: Make social media discussion generic. (rust-lang/book#4249) - Another Ch. 17 -> 18 fix (rust-lang/book#4247) - Ch. 05: further tweak to wording about `user1` availability (rust-lang/book#4246) - Ch. 02: Fix rand version mistake (from testing) (rust-lang/book#4245) - Ch. 19: Correct the discussion of `fn` type and closures (rust-lang/book#4244) - Edition maintenance: scripting the updates for future work (rust-lang/book#4243) - Ch. 17: fresh-eyes edits (rust-lang/book#4242) - Ch. 17: drop lifetime not required in 2024 Edition (rust-lang/book#4212) - Appendix B, Operators: Replace “member access” with “field access” and “method call”. (rust-lang/book#4240) - Update to Rust 1.85 and 2024 Edition! (rust-lang/book#4241) - Chapter 1: fix 'four things' now that spacing is not emphasized (rust-lang/book#4239) ## rust-lang/edition-guide 2 commits in daa4b763cd848f986813b5cf8069e1649f7147af..1e27e5e6d5133ae4612f5cc195c15fc8d51b1c9c 2025-03-04 22:02:00 UTC to 2025-02-26 12:47:41 UTC - Mention both `rustfmt.toml` and `.rustfmt.toml` (rust-lang/edition-guide#372) - Fix a typo (rust-lang/edition-guide#370) ## rust-lang/nomicon 1 commits in 8f5c7322b65d079aa5b242eb10d89a98e12471e1..b4448fa406a6dccde62d1e2f34f70fc51814cdcc 2025-03-01 04:48:05 UTC to 2025-03-01 04:48:05 UTC - Update to 2024 edition (rust-lang/nomicon#481) ## rust-lang/reference 8 commits in 615b4cec60c269cfc105d511c93287620032d5b0..dda31c85f2ef2e5d2f0f2f643c9231690a30a626 2025-03-09 14:25:25 UTC to 2025-02-25 16:07:17 UTC - Rework note blocks and change admonition rendering (rust-lang/reference#1754) - Add more information on rules and tests (rust-lang/reference#1753) - Mention `explicit_builtin_cfgs_in_flags` lint cfg chapter (rust-lang/reference#1747) - fixup test links (rust-lang/reference#1741) - Fix diagnostics typo: `do_no_recommend` -> `do_not_recommend` (rust-lang/reference#1749) - panic runtime and C-unwind documentation (rust-lang/reference#1226) - Closures: fix example of desugaring (rust-lang/reference#1743) - Update boolean.md, Comment breaks paragraph format (rust-lang/reference#1744) ## rust-lang/rust-by-example 1 commits in 66543bbc5b7dbd4e679092c07ae06ba6c73fd912..6f69823c28ae8d929d6c815181c73d3e99ef16d3 2025-03-09 13:12:24 UTC to 2025-03-09 13:12:24 UTC - Update mdbook to 0.4.46 (rust-lang/rust-by-example#1914) try-job: x86_64-gnu-distcheck
2025-03-12Rollup merge of #138174 - compiler-errors:elaborate-unsize-self-pred, r=BoxyUwUMatthias Krüger-12/+105
Elaborate trait assumption in `receiver_is_dispatchable` Fixes #138172. See comment on the linked test. Probably not a fix for the general problem, bc I think this may still be incomplete for other weird `where` clauses on the receiver. But 🤷, supertraits seems like an obvious one to fix.
2025-03-12Rollup merge of #138161 - HeroicKatora:heap-peek-mut-refresh, r=dtolnayMatthias Krüger-4/+78
Add PeekMut::refresh I'm not sure if this should go through ACP or not. BinaryHeap is not the most critical data structure in the standard library and it would be understandable if maintainer throughput is thus too limited to accept this PR without a proper design phase that ensures the required understanding of consequence over a longer time period. This aims to improve the useability of heaps for priority-based work queues. In certain scenarios, modifications on the most relevant or critical items are performed until a condition that determines the work items have been sufficiently addressed. For instance the criticality could be a deadline that is relaxed whenever some part of a work item is completed. Such a loop will repeatedly access the most critical item and put it back in a sorted position when it is complete. Crucially, due to the ordering invariant we know that all necessary work was performed when the completed item remains the most critical. Getting this information from the heap position avoids a (potentially more costly) check on the item state itself. A customized `drop` with boolean result would avoid up to two more comparisons performed in both the last no-op refresh and Drop code but this occurs once in each execution of the above scenario whereas refresh occurs any number of times. Also note that the comparison overhead of Drop is only taken if the element is mutably inspected to determine the end condition, i.e. not when refresh itself is the break condition.
2025-03-12intrinsics: remove unnecessary leading underscore from argument namesRalf Jung-369/+362
2025-03-12Auto merge of #138052 - lqd:lld-linker-messages, r=jieyouxubors-2/+3
strip `-Wlinker-messages` wrappers from `rust-lld` rmake test The `tests/run-make/rust-lld` rmake test is failing locally on my M1, due to linker messages being in a different shape than the test expects: it asserts that the LLD version is the first linker message, which is seemingly not always the case on osx I guess. ```console thread 'main' panicked at /Users/lqd/rust/lqd-rust/tests/run-make/rust-lld/rmake.rs:24:5: the LLD version string should be present in the output logs: warning: linker stderr: rust-lld: directory not found for option -L/usr/local/lib LLD 20.1.0 (https://github.com/rust-lang/llvm-project.git 1c3bb96fdb6db7b8e8f24edb016099c223fdd27e) Library search paths: /Users/lqd/rust/lqd-rust/build/aarch64-apple-darwin/test/run-make/rust-lld/rmake_out /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib Framework search paths: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks ``` This PR normalizes away the `-Wlinker-messages` wrappers around the linker output, to remove the requirement that the linker version is the first linker message / is prefixed with the warning wrapper in the regex. (also another strange thing to explain the pre-existing regex: it seems the LLD version is sometimes output on stderr sometimes on stdout cool stuff) We could do this for the other lld rmake tests, but they're only enabled on x64 linux so less likely to have random linker messages appearing without anyone noticing.
2025-03-12Remove unnecessary lifetime from `PatInfo`.Nicholas Nethercote-25/+27
2025-03-12Auto merge of #137795 - Jarcho:idx_opt, r=davidtwcobors-0/+10
Allow bounds checks when enumerating `IndexSlice` to be elided Without this hint, each loop iteration has to separately bounds check the index. See https://godbolt.org/z/zrfPY4Ten for an example. This is technically a behaviour change, but only in cases where the compiler is going to crash anyways.
2025-03-12Factor out some repeated code in `parse_item_impl`.Nicholas Nethercote-24/+13
2025-03-12Inline and remove `State::print_item_type`.Nicholas Nethercote-22/+11
It has a single call site. The removal of the closure argument is a nice touch.
2025-03-12Remove unused `OwnerNode::ident` method.Nicholas Nethercote-10/+0
2025-03-12Make panic's more specificKirill Podoprigora-10/+13