about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-04-15implement cyclic inclusion handlingonur-ozkan-13/+38
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15document config extensionsonur-ozkan-0/+36
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15add new config option: `include`onur-ozkan-1/+29
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-15Auto merge of #139826 - matthiaskrgr:rollup-0q0qvkd, r=matthiaskrgrbors-173/+353
Rollup of 8 pull requests Successful merges: - #139745 (Avoid unused clones in `Cloned<I>` and `Copied<I>`) - #139757 (opt-dist: use executable-extension for host llvm-profdata) - #139778 (Add test for issue 34834) - #139783 (Use `compiletest-ignore-dir` for bootstrap self-tests) - #139797 (Allow (but don't require) `#[unsafe(naked)]` so that `compiler-builtins` can upgrade to it) - #139799 (Specify `--print info=file` syntax in `--help`) - #139811 (Use `newtype_index!`-generated types more idiomatically) - #139813 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-14Rollup merge of #139813 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-18/+46
Miri subtree update r? `@ghost` Fixes build failures on macOS
2025-04-14Rollup merge of #139811 - yotamofek:pr/newtype_cleanups, r=oli-obkMatthias Krüger-87/+61
Use `newtype_index!`-generated types more idiomatically Continuation of sorts of #139674 Shouldn't affect anything, just makes some code simpler
2025-04-14Rollup merge of #139799 - clubby789:print=file, r=jieyouxuMatthias Krüger-17/+16
Specify `--print info=file` syntax in `--help` Closes #139794 I moved the listing of information that can be printed to the help string as it's getting rather long and it makes the `[=FILE]` part easier to see
2025-04-14Rollup merge of #139797 - folkertdev:naked-allow-unsafe, r=tgross35Matthias Krüger-28/+34
Allow (but don't require) `#[unsafe(naked)]` so that `compiler-builtins` can upgrade to it tracking issue: https://github.com/rust-lang/rust/issues/138997 Per https://github.com/rust-lang/rust/pull/134213#issuecomment-2755984503, we want to make the `#[naked]` attribute an unsafe attribute. Making that change runs into a cyclic dependency with `compiler-builtins` which uses `#[naked]`, where `rustc` needs an updated `compiler-builtins` and vice versa. So based on https://github.com/rust-lang/rust/pull/139753 and [#t-compiler/help > updating &#96;compiler-builtins&#96; and &#96;rustc&#96;](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/updating.20.60compiler-builtins.60.20and.20.60rustc.60), this PR allows, but does not require `#[unsafe(naked)]`, and makes that change for some of the tests to check that both `#[naked]` and `#[unsafe(naked)]` are accepted. Then we can upgrade and synchronize `compiler-builtins`, and then make `#[naked]` (without `unsafe`) invalid. r? `@traviscross` (or someone from t-compiler if you're faster and this look allright)
2025-04-14Rollup merge of #139783 - jieyouxu:ignore-dir, r=ZalatharMatthias Krüger-2/+0
Use `compiletest-ignore-dir` for bootstrap self-tests Follow-up to #139705 and #139740. I did another survey pass over `//@ ignore-test` under `tests/`, and this is the only 2 non-tests that should use `compiletest-ignore-dir`. r? `@Zalathar` (or compiler/bootstrap)
2025-04-14Rollup merge of #139778 - reddevilmidzy:add-success-test, r=lcnrMatthias Krüger-0/+30
Add test for issue 34834 closes: #34834 This PR adds a UI test for a case where a trait with an associated type using a higher-ranked trait bound (HRTB) failed to compile in Rust 1.55.0 but succeeded starting from 1.56.0. ```rust pub trait Provides<'a> { type Item; } pub trait Selector: for<'a> Provides<'a> { type Namespace: PartialEq + for<'a> PartialEq<<Self as Provides<'a>>::Item>; fn get_namespace(&self) -> <Self as Provides>::Item; } pub struct MySelector; impl<'a> Provides<'a> for MySelector { type Item = &'a str; } impl Selector for MySelector { type Namespace = String; fn get_namespace(&self) -> &str { unimplemented!() } } fn main() {} ``` * ❌ [compile fail (rustc: 1.55.0)](https://godbolt.org/z/T1jY1Ebo6) * ⭕ [compile pass (rustc: 1.56.0)](https://godbolt.org/z/e4jo11Ma7)
2025-04-14Rollup merge of #139757 - ognevny:opt-dist-hostllvm, r=KobzolMatthias Krüger-1/+3
opt-dist: use executable-extension for host llvm-profdata because it's used for target llvm-profdata too r? Kobzol
2025-04-14Rollup merge of #139745 - thaliaarchi:iter-unused-clone-copy, r=joboetMatthias Krüger-20/+163
Avoid unused clones in `Cloned<I>` and `Copied<I>` Avoid cloning in `Cloned<I>` or copying in `Copied<I>` when elements are only needed by reference or not at all. There is already some precedent for this, given that `__iterator_get_unchecked` is implemented, which can skip elements. The reduced clones are technically observable by a user impl of `Clone`. r? libs-api
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-14Allow (but don't require) `#[unsafe(naked)]` so that `compiler-builtins` can ↵Folkert de Vries-28/+34
upgrade to it
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-14Use `newtype_index!`-generated types more idiomaticallyYotam Ofek-87/+61
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-14update lockfileRalf Jung-4/+4
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-14Specify `--print info=file` syntax in `--help`clubby789-17/+16
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-14Add test for issue 34834reddevilmidzy-0/+30
2025-04-14tests: use `compiletest-ignore-dir` for bootstrap self-testsJieyou Xu-2/+0
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