about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-04-15fix typoWaffle Lapkin-1/+1
2025-04-15update submodules if the directory doesn't existWaffle Lapkin-0/+7
2025-04-14Auto merge of #139577 - davidtwco:sizedness-go-vroom, r=oli-obkbors-31/+70
re-use `Sized` fast-path There's an existing fast path for the `type_op_prove_predicate` predicate, checking for trivially `Sized` types, which can be re-used when evaluating obligations within queries. This should improve performance and was found to be beneficial in #137944. r? types
2025-04-14Auto merge of #139814 - matthiaskrgr:rollup-lxkkcz6, r=matthiaskrgrbors-41/+259
Rollup of 8 pull requests Successful merges: - #139127 (Fix up partial res of segment in primitive resolution hack) - #139392 (Detect and provide suggestion for `&raw EXPR`) - #139767 (Visit place in `BackwardIncompatibleDropHint` statement) - #139777 (Remove `define_debug_via_print` for `ExistentialProjection`, use regular structural debug impl) - #139796 (ptr docs: add missing backtics around 'usize') - #139801 (Add myself to mailmap) - #139804 (use `realpath` in `bootstrap.py` when creating build-dir) - #139807 (Improve wording of post-merge report) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-14Rollup merge of #139807 - Kobzol:post-merge-report-wording, r=marcoieniMatthias Krüger-11/+15
Improve wording of post-merge report Slight changes to improve the rendered output e.g. [here](https://github.com/rust-lang/rust/pull/139241#issuecomment-2801733750) if only doctest changes were found. r? `@marcoieni`
2025-04-14Rollup merge of #139804 - WaffleLapkin:real, r=jieyouxuMatthias Krüger-1/+1
use `realpath` in `bootstrap.py` when creating build-dir Fixes #139800 r? `@jieyouxu` My use case for `./build` being a symlink is this: my "default" ~~partition~~ btrfs subvolume is snapshotted/backed up. I don't want to backup target-likes, so I move them to a special subvolume which isn't backed up. `./build` is a symlink into that subvolume. (`build.build-dir` configuration is not fully sufficient, it is still nice to be able to check build files with `ls ./build` or call tools from there)
2025-04-14Rollup merge of #139801 - clubby789:clubby-mailmap, r=jieyouxuMatthias Krüger-0/+1
Add myself to mailmap
2025-04-14Rollup merge of #139796 - RalfJung:usize-backtics, r=jieyouxuMatthias Krüger-1/+1
ptr docs: add missing backtics around 'usize' We almost always have the backticks, except here... so let's just fix that. Barely worth a PR but it's user-visible docs so here we go.
2025-04-14Rollup merge of #139777 - compiler-errors:debuggier-proj, r=lcnrMatthias Krüger-2/+2
Remove `define_debug_via_print` for `ExistentialProjection`, use regular structural debug impl The pretty print impl for `ExistentialProjection` always prints `AssocItem = Ty`: https://github.com/rust-lang/rust/blob/6e830462330a9e34d8176e86d4580dd0820c6fd5/compiler/rustc_middle/src/ty/print/pretty.rs#L3293-L3299 We can't change this, b/c it's used for both pretty printing dyn types and for legacy symbol mangling. Unfortunately, we also use this printing procedure for `Debug` impls. That means that it leaves out the *trait name* and *trait args* when debug printing an `ExistentialProjection` (or an `ExistentialPredicate` which has a variant for `ExistentialProjection`). This leads to awkward situations, like the two seemingly identical existential projection predicates present in a `dyn Trait` type using the definition below: ```rust trait Super { type Assoc; } trait Foo: Super<A, Assoc = i32> + Super<B, Assoc = i32> {} ``` Namely, they both just render as `Projection(Assoc = i32)`! This makes debugging `dyn Trait` type system bugs really hard, so let's use the *regular* debug impl for `ExistentialProjection`.
2025-04-14Rollup merge of #139767 - compiler-errors:www, r=oli-obkMatthias Krüger-25/+19
Visit place in `BackwardIncompatibleDropHint` statement Remove a weird hack from the `LocalUpdater` where we were manually visiting the place stored in a `StatementKind::BackwardIncompatibleDropHint` because the MIR visitor impls weren't doing so. Also, clean up `BackwardIncompatibleDropHint`s in `CleanupPostBorrowck`, since they're not needed for runtime MIR.
2025-04-14Rollup merge of #139392 - compiler-errors:raw-expr, r=oli-obkMatthias Krüger-1/+189
Detect and provide suggestion for `&raw EXPR` When emitting an error in the parser, and we detect that the previous token was `raw` and we *could* have consumed `const`/`mut`, suggest that this may have been a mistyped raw ref expr. To do this, we add `const`/`mut` to the expected token set when parsing `&raw` as an expression (which does not affect the "good path" of parsing, for the record). This is kind of a rudimentary error improvement, since it doesn't actually attempt to recover anything, leading to some other knock-on errors b/c we still treat `&raw` as the expression that was parsed... but at least we add the suggestion! I don't think the parser grammar means we can faithfully recover `&raw EXPR` early, i.e. during `parse_expr_borrow`. Fixes #133231
2025-04-14Rollup merge of #139127 - compiler-errors:prim-ty-hack, r=oli-obkMatthias Krüger-0/+31
Fix up partial res of segment in primitive resolution hack There is a hack in the resolver: ``` // In `a(::assoc_item)*` `a` cannot be a module. If `a` does resolve to a module we // don't report an error right away, but try to fallback to a primitive type. ``` This fixes up the resolution for primitives which would otherwise resolve to a module, but we weren't also updating the res of the path segment, leading to weird diagnostics. We explicitly call `self.r.partial_res_map.insert` instead of `record_partial_res` b/c we have recorded a partial res already, and we specifically want to override it. cc https://github.com/rust-lang/rust/issues/139095#issuecomment-2764371934
2025-04-14Remove define_debug_via_print for ExistentialProjectionMichael Goulet-2/+2
2025-04-14Improve wording of post-merge reportJakub Beránek-11/+15
2025-04-14use `realpath` in `bootstrap.py` when creating build-dirWaffle Lapkin-1/+1
this avoids crashes when `./build` is a symlink to a non-existent directory.
2025-04-14Auto merge of #138603 - xizheyin:issue-137405, r=chenyukangbors-2/+98
Report line number of test when should_panic test failed Closes #137405 --- try-job: x86_64-gnu-llvm-19-3 try-job: test-various
2025-04-14Add myself to mailmapclubby789-0/+1
2025-04-14ptr docs: add missing backtics around 'usize'Ralf Jung-1/+1
2025-04-14Auto merge of #139241 - bvanjoi:less-decoding, r=petrochenkovbors-64/+23
don't store opaque info during encoding Now `remapped_ctxts` reserved and let's check the performance. r? `@petrochenkov`
2025-04-14Auto merge of #139781 - jhpratt:rollup-qadsjvb, r=jhprattbors-1489/+1594
Rollup of 9 pull requests Successful merges: - #138336 (Improve `-Z crate-attr` diagnostics) - #139636 (Encode dep node edge count as u32 instead of usize) - #139666 (cleanup `mir_borrowck`) - #139695 (compiletest: consistently use `camino::{Utf8Path,Utf8PathBuf}` throughout) - #139699 (Proactively update coroutine drop shim's phase to account for later passes applied during shim query) - #139718 (enforce unsafe attributes in pre-2024 editions by default) - #139722 (Move some things to rustc_type_ir) - #139760 (UI tests: migrate remaining compile time `error-pattern`s to line annotations when possible) - #139776 (Switch attrs to `diagnostic::on_unimplemented`) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-13Rollup merge of #139776 - mejrs:diagn2, r=compiler-errorsJacob Pratt-2/+2
Switch attrs to `diagnostic::on_unimplemented` I missed these the last time 😅
2025-04-13Rollup merge of #139760 - petrochenkov:noerrpat2, r=jieyouxuJacob Pratt-293/+321
UI tests: migrate remaining compile time `error-pattern`s to line annotations when possible There's a number of cases in which `error-pattern` is still necessary even for compile time checking. - It checks something that compiler writes directly into stderr as text, and not to the structured json output. This includes some stuff reported during compiler panics, and also diagnostics that happen very early, for example when parsing the command line. - It checks something that exists only in the full rendered diagnostic test, but not in its structured components, for example code fragments or output of `-Ztrack-diagnostics`. (The latter can probably be converted to structured form though.) This is continuation of https://github.com/rust-lang/rust/pull/139137. r? `@jieyouxu`
2025-04-13Rollup merge of #139722 - jackh726:patternkind-walk-toir, r=compiler-errorsJacob Pratt-468/+531
Move some things to rustc_type_ir This moves - `PatternKind` - `FlagComputation` - `TypeWalker` into rustc_type_ir. Not strictly required for rust-analyzer next-solve integration, but helps with code duplication. r? types
2025-04-13Rollup merge of #139718 - folkertdev:unsafe-attributes-earlier-editions, ↵Jacob Pratt-52/+102
r=fmease enforce unsafe attributes in pre-2024 editions by default New unsafe attributes should emit an error when used without the `unsafe(...)` in all editions. The `no_mangle`, `link_section` and `export_name` attributes are exceptions, and can still be used without an unsafe in earlier editions. The only attributes for which this change is relevant right now are `#[ffi_const]` and `#[ffi_pure]`. This change is required for making `#[unsafe(naked)]` sound in pre-2024 editions.
2025-04-13Rollup merge of #139699 - compiler-errors:coroutine-drop-phase, r=scottmcmJacob Pratt-0/+26
Proactively update coroutine drop shim's phase to account for later passes applied during shim query See comments in the pass and on test. Also see https://github.com/rust-lang/rust/pull/137264#issuecomment-2669706718. Fixes https://github.com/rust-lang/rust/issues/137243 Fixes https://github.com/rust-lang/rust/issues/139698 r? scottmcm
2025-04-13Rollup merge of #139695 - jieyouxu:compiletest-utf8path, r=KobzolJacob Pratt-434/+412
compiletest: consistently use `camino::{Utf8Path,Utf8PathBuf}` throughout compiletest already practically assumes UTF-8 paths everywhere. Use `camino`'s `{Utf8Path,Utf8PathBuf}` consistently throughout compiletest to enforce UTF-8 path assumptions. r? ```@Kobzol``` (or compiler/bootstrap)
2025-04-13Rollup merge of #139666 - lcnr:pre-revealing-use-cleanup, r=compiler-errorsJacob Pratt-154/+108
cleanup `mir_borrowck` Cleanup pulled out of #139587. Best reviewed commit by commit. r? compiler-errors
2025-04-13Rollup merge of #139636 - Zoxc:graph-edges-len-u32, r=compiler-errorsJacob Pratt-8/+10
Encode dep node edge count as u32 instead of usize This encodes the dep node edge count as u32 instead of usize. It doesn't need to be usize as the count is limited the the unique number of dep nodes which we use a 32-bit index for. It probably saves some branches for encoding / decoding, but it isn't too hot as the count gets packed in with other fields when it's low. <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th><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><td align="right">Physical Memory</td><td align="right">Physical Memory</td><td align="right">%</th><td align="right">Committed Memory</td><td align="right">Committed Memory</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:unchanged</td><td align="right">0.3343s</td><td align="right">0.3343s</td><td align="right"> -0.00%</td><td align="right">97.02 MiB</td><td align="right">96.89 MiB</td><td align="right"> -0.13%</td><td align="right">167.93 MiB</td><td align="right">167.80 MiB</td><td align="right"> -0.08%</td></tr><tr><td>🟣 <b>hyper</b>:check:unchanged</td><td align="right">0.1353s</td><td align="right">0.1350s</td><td align="right"> -0.19%</td><td align="right">61.91 MiB</td><td align="right">61.83 MiB</td><td align="right"> -0.13%</td><td align="right">124.64 MiB</td><td align="right">124.64 MiB</td><td align="right"> 0.00%</td></tr><tr><td>🟣 <b>regex</b>:check:unchanged</td><td align="right">0.2479s</td><td align="right">0.2481s</td><td align="right"> 0.10%</td><td align="right">78.34 MiB</td><td align="right">78.35 MiB</td><td align="right"> 0.02%</td><td align="right">145.20 MiB</td><td align="right">145.31 MiB</td><td align="right"> 0.08%</td></tr><tr><td>🟣 <b>syn</b>:check:unchanged</td><td align="right">0.5347s</td><td align="right">0.5333s</td><td align="right"> -0.26%</td><td align="right">118.63 MiB</td><td align="right">118.66 MiB</td><td align="right"> 0.02%</td><td align="right">193.05 MiB</td><td align="right">193.11 MiB</td><td align="right"> 0.03%</td></tr><tr><td>Total</td><td align="right">1.2521s</td><td align="right">1.2507s</td><td align="right"> -0.11%</td><td align="right">355.90 MiB</td><td align="right">355.74 MiB</td><td align="right"> -0.05%</td><td align="right">630.83 MiB</td><td align="right">630.87 MiB</td><td align="right"> 0.01%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9991s</td><td align="right"> -0.09%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> -0.06%</td><td align="right">1 byte</td><td align="right">1.00 bytes</td><td align="right"> 0.01%</td></tr></table>
2025-04-13Rollup merge of #138336 - jyn514:crate-attr-diagnostics, r=compiler-errorsJacob Pratt-78/+82
Improve `-Z crate-attr` diagnostics - Show the `#![ ... ]` in the span (to make it clear that it should not be included in the CLI argument) - Show more detailed errors when the crate has valid token trees but invalid syntax. Previously, `crate-attr=feature(foo),feature(bar)` would just say "invalid crate attribute" and point at the comma. Now, it explicitly says that the comma was unexpected, which is useful when using `--error-format=short`. It also fixes the column to show the correct span. - Recover from parse errors. Previously we would abort immediately on syntax errors; now we go on to try and type-check the rest of the crate. The new diagnostic code also happens to be slightly shorter. r? diagnostics
2025-04-14Auto merge of #124141 - ↵bors-532/+164
nnethercote:rm-Nonterminal-and-TokenKind-Interpolated, r=petrochenkov Remove `Nonterminal` and `TokenKind::Interpolated` A third attempt at this; the first attempt was #96724 and the second was #114647. r? `@ghost`
2025-04-14Adjust test directivesxizheyin-33/+23
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-14Report span of test when should_panic test failedxizheyin-2/+108
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-14Auto merge of #139766 - jhpratt:rollup-afrfmnk, r=jhprattbors-393/+827
Rollup of 10 pull requests Successful merges: - #137043 (Initial `UnsafePinned` implementation [Part 1: Libs]) - #138962 (Expect an array when expected and acutal types are both arrays during cast) - #139001 (add `naked_functions_rustic_abi` feature gate) - #139379 (Use delayed bug for normalization errors in drop elaboration) - #139582 (Various coercion cleanups) - #139628 (Suggest remove redundant `$()?` around `vis`) - #139644 (Micro-optimize `InstSimplify`'s `simplify_primitive_clone`) - #139674 (In `rustc_mir_transform`, iterate over index newtypes instead of ints) - #139740 (Convert `tests/ui/lint/dead-code/self-assign.rs` to a known-bug test) - #139741 (fix smir's run! doc and import) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-14Switch to `diagnostic::on_unimplemented`mejrs-2/+2
2025-04-13Visit place in BackwardIncompatibleDropHint statementMichael Goulet-25/+19
2025-04-13Rollup merge of #139741 - os-checker:smir-run-macro, r=scottmcmJacob Pratt-21/+3
fix smir's run! doc and import This PR * adds missing `extern crate rustc_middle` in `rustc_smir::run!` docstring * adds missing `use rustc_smir::rustc_internal` in `run_driver!` scope * also adjust some tests that don't need to import rustc_internalany more
2025-04-13Rollup merge of #139740 - jieyouxu:known-bug, r=nnethercoteJacob Pratt-54/+20
Convert `tests/ui/lint/dead-code/self-assign.rs` to a known-bug test I did a survey pass over `tests/`, and this test seems like the only candidate suitable for conversion into a known-bug test. (Other tests had varying degrees of other issues that known-bug would not be suitable.) r? compiler
2025-04-13Rollup merge of #139674 - yotamofek:pr/mir_transform/index-iterators, ↵Jacob Pratt-53/+46
r=compiler-errors In `rustc_mir_transform`, iterate over index newtypes instead of ints Just makes code more idiomatic/easier to read, IMHO. Also, some drive-by simplifications and cleanups.
2025-04-13Rollup merge of #139644 - ↵Jacob Pratt-17/+8
yotamofek:pr/mir_transform/instsimplify/simplify_primitive_clone, r=compiler-errors Micro-optimize `InstSimplify`'s `simplify_primitive_clone` r? ````@compiler-errors```` , since you already did #139411 and got randomly selected for #139638 (feel free to reassign!) Another one similar in spirit to #139411, but this time for `simplify_primitive_clone`, which is doing a bit of redundant work. Might not show up in benches, but probably worth micro-optimizing since the transformation is run even for debug builds. See inline comments for my reasoning for making these changes.
2025-04-13Rollup merge of #139628 - makai410:suggest-vis, r=compiler-errorsJacob Pratt-6/+128
Suggest remove redundant `$()?` around `vis` Resolves: #139480 .
2025-04-13Rollup merge of #139582 - oli-obk:coercion-cleanups, r=compiler-errorsJacob Pratt-94/+82
Various coercion cleanups I think the commit order is the most reasonable one, but there's probably more ways to get to the same goal. Essentially I got rid of the `simple` and `identity` helpers by adding a dedicated function for the common `identity` case and getting rid of the callbacks alltogether by realizing that all callbacks were of the pattern "use this fixed prefix list of adjustments, then add another adjustment with the unified type as the target type". No behavioral changes intended
2025-04-13Rollup merge of #139379 - matthewjasper:drop-elab-normalization, ↵Jacob Pratt-10/+70
r=compiler-errors Use delayed bug for normalization errors in drop elaboration Normalization can fail due to a lot of different earlier errors, so just use span_delayed_bug if normalization failed. Closes #137287 Closes #135668 r? compiler-errors
2025-04-13Rollup merge of #139001 - folkertdev:naked-function-rustic-abi, ↵Jacob Pratt-107/+142
r=traviscross,compiler-errors add `naked_functions_rustic_abi` feature gate tracking issue: https://github.com/rust-lang/rust/issues/138997 Because the details of the rust abi are unstable, and a naked function must match its stated ABI, this feature gate keeps naked functions with a rustic abi ("Rust", "rust-cold", "rust-call" and "rust-intrinsic") unstable. r? ````@traviscross````
2025-04-13Rollup merge of #138962 - xizheyin:issue-138836, r=compiler-errorsJacob Pratt-23/+38
Expect an array when expected and acutal types are both arrays during cast Closes #138836
2025-04-13Rollup merge of #137043 - Sky9x:unsafe-pinned-pt1-libs, ↵Jacob Pratt-8/+290
r=tgross35,RalfJung,WaffleLapkin Initial `UnsafePinned` implementation [Part 1: Libs] Initial libs changes necessary to unblock further work on [RFC 3467](https://rust-lang.github.io/rfcs/3467-unsafe-pinned.html). Tracking issue: #125735 This PR is split off from #136964, and includes just the libs changes: - `UnsafePinned` struct - private `UnsafeUnpin` structural auto trait - Lang items for both - Compiler changes necessary to block niches on `UnsafePinned` This PR does not change codegen, miri, the existing `!Unpin` hack, or anything else. That work is to be split into later PRs. --- cc ``@RalfJung`` ``@Noratrieb`` ``@rustbot`` label F-unsafe_pinned T-libs-api
2025-04-13Auto merge of #131203 - clubby789:jumpthreading-not, r=compiler-errorsbors-90/+207
JumpThreading: fix bitwise not on non-booleans Fixes #131195 Alternative to #131201
2025-04-13Improve `-Z crate-attr` diagnosticsjyn-78/+82
- Show the `#![ ... ]` in the span (to make it clear that it should not be included in the CLI argument) - Show more detailed errors when the crate has valid token trees but invalid syntax. Previously, `crate-attr=feature(foo),feature(bar)` would just say "invalid crate attribute" and point at the comma. Now, it explicitly says that the comma was unexpected, which is useful when using `--error-format=short`. It also fixes the column to show the correct span. - Recover from parse errors. Previously we would abort immediately on syntax errors; now we go on to try and type-check the rest of the crate. The new diagnostic code also happens to be slightly shorter.
2025-04-13JumpThreading: Bail out on interp errorsclubby789-67/+91
2025-04-13JumpThreading: Re-enable and fix Not ops on non-booleansclubby789-27/+120
2025-04-13UI tests: migrate remaining compile time `error-pattern`s to line annotationsVadim Petrochenkov-293/+321
when possible.