about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-21test(ui): add tuple-struct-where-clause-suggestion ui test for #91520Karol Zwolak-0/+38
2025-03-21Auto merge of #138761 - flip1995:clippy-subtree-update, r=Manishearthbors-1149/+4616
Clippy subtree update r? `@Manishearth` Cargo.lock update is because of the `ui_test` dependency bump in Clippy.
2025-03-21Auto merge of #138760 - matthiaskrgr:rollup-2edtg2h, r=matthiaskrgrbors-0/+0
Rollup of 8 pull requests Successful merges: - #138435 (Add support for postfix yield expressions) - #138685 (Use `Option<Ident>` for lowered param names.) - #138700 (Suggest `-Whelp` when pass `--print lints` to rustc) - #138727 (Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType`) - #138729 (Clean up `FnCtxt::resolve_coroutine_interiors`) - #138731 (coverage: Add LLVM plumbing for expansion regions) - #138732 (Use `def_path_str` for def id arg in `UnsupportedOpInfo`) - #138735 (Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-20Auto merge of #138747 - matthiaskrgr:rollup-68x44rw, r=matthiaskrgrbors-240/+499
Rollup of 8 pull requests Successful merges: - #138435 (Add support for postfix yield expressions) - #138685 (Use `Option<Ident>` for lowered param names.) - #138700 (Suggest `-Whelp` when pass `--print lints` to rustc) - #138727 (Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType`) - #138729 (Clean up `FnCtxt::resolve_coroutine_interiors`) - #138731 (coverage: Add LLVM plumbing for expansion regions) - #138732 (Use `def_path_str` for def id arg in `UnsupportedOpInfo`) - #138735 (Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-20Update Cargo.lockPhilipp Krones-6/+6
2025-03-20Merge commit '1e5237f4a56ae958af7e5824343eacf737b67083' into ↵Philipp Krones-1144/+4611
clippy-subtree-update
2025-03-20Rollup merge of #138735 - jieyouxu:drop-llvm-alias, r=nikicMatthias Krüger-8/+10
Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group Because it's way too easy to confuse LLVM Icebreakers ping group versus trying to ping WG-llvm. And AFAIK, icebreakers-llvm isn't really used in a good while. I also fixed the rustc-dev-guide docs about ```@rustbot`` ping llvm` (and changed that to the raw ping group name ```@rustbot`` icebreakers-llvm`) because it's very confusing. Previously discussed in [#t-compiler/wg-llvm > Ping group renaming](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fwg-llvm/topic/Ping.20group.20renaming/with/453005029). FYI ``@rust-lang/wg-llvm`` FYI ``@RalfJung`` (since you asked in https://github.com/rust-lang/rust/pull/138120#issuecomment-2710466874) r? ``@nikic`` (or wg-llvm)
2025-03-20Rollup merge of #138732 - compiler-errors:did, r=jieyouxuMatthias Krüger-11/+12
Use `def_path_str` for def id arg in `UnsupportedOpInfo` We could alternatively just omit the def path from the label, but I think it's fine to keep around Fixes #138730
2025-03-20Rollup merge of #138731 - Zalathar:llvm-expansion, r=jieyouxuMatthias Krüger-34/+97
coverage: Add LLVM plumbing for expansion regions This is currently unused, but paves the way for future work on expansion regions without having to worry about the FFI parts. The span conversion refactoring is only loosely related, but I've included it here because it would conflict with the main changes in `fill_region_tables`, and is pretty straightforward on its own.
2025-03-20Rollup merge of #138729 - compiler-errors:gen, r=lcnrMatthias Krüger-16/+19
Clean up `FnCtxt::resolve_coroutine_interiors` Random cleanups before I make a PR that stalls generator obligations. r? lcnr
2025-03-20Rollup merge of #138727 - compiler-errors:ty-var-origin, r=fmeaseMatthias Krüger-64/+60
Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType` The ordering of ty var unification means that we may end up with a root variable whose ty var origin is from another item's params. Let's not rely on this by just unifying the infer vars with the params of the impl + resolving. It's kinda goofy but it's clearer IMO. Fixes #132826. r? ``@fmease`` or ``@lcnr``
2025-03-20Rollup merge of #138700 - xizheyin:issue-138612, r=NadrierilMatthias Krüger-0/+15
Suggest `-Whelp` when pass `--print lints` to rustc Closes #138612
2025-03-20Rollup merge of #138685 - ↵Matthias Krüger-87/+125
nnethercote:use-Option-Ident-for-lowered-param-names, r=compiler-errors Use `Option<Ident>` for lowered param names. Parameter patterns are lowered to an `Ident` by `lower_fn_params_to_names`, which is used when lowering bare function types, trait methods, and foreign functions. Currently, there are two exceptional cases where the lowered param can become an empty `Ident`. - If the incoming pattern is an empty `Ident`. This occurs if the parameter is anonymous, e.g. in a bare function type. - If the incoming pattern is neither an ident nor an underscore. Any such parameter will have triggered a compile error (hence the `span_delayed_bug`), but lowering still occurs. This commit replaces these empty `Ident` results with `None`, which eliminates a number of `kw::Empty` uses, and makes it impossible to fail to check for these exceptional cases. Note: the `FIXME` comment in `is_unwrap_or_empty_symbol` is removed. It actually should have been removed in #138482, the precursor to this PR. That PR changed the lowering of wild patterns to `_` symbols instead of empty symbols, which made the mentioned underscore check load-bearing. r? ```@compiler-errors```
2025-03-20Rollup merge of #138435 - eholk:prefix-yield, r=oli-obkMatthias Krüger-20/+161
Add support for postfix yield expressions We've been having a discussion about whether we want postfix yield, or want to stick with prefix yield, or have both. I figured it's easy enough to support both for now and let us play around with them while the feature is still experimental. This PR treats `yield x` and `x.yield` as semantically equivalent. There was a suggestion to make `yield x` have a `()` type (so it only works in coroutines with `Resume = ()`. I think that'd be worth trying, either in a later PR, or before this one merges, depending on people's opinions. #43122
2025-03-20fix: `missing_const_for_fn` FP on unstable const traits (#14294)Timo-16/+112
Closes #14020 Closes #14290 Closes #14091 Add checks for unstable const traits. changelog: [`missing_const_for_fn`] fix FP on unstable const traits
2025-03-20Rustup (#14445)Philipp Krones-453/+380
r? @ghost changelog: none
2025-03-20Bump nightly version -> 2025-03-20Philipp Krones-2/+2
2025-03-20Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-1217/+4619
2025-03-20Auto merge of #138515 - petrochenkov:cfgtrace, r=nnethercotebors-19/+136
expand: Leave traces when expanding `cfg_attr` attributes Currently `cfg_trace` just disappears during expansion, but after this PR `#[cfg_attr(some tokens)]` will leave a `#[cfg_attr_trace(some tokens)]` attribute instead of itself in AST after expansion (the new attribute is built-in and inert, its inner tokens are the same as in the original attribute). This trace attribute can then be used by lints or other diagnostics, #133823 has some examples. Tokens in these trace attributes are set to an empty token stream, so the traces are non-existent for proc macros and cannot affect any user-observable behavior. This is also a weakness, because if a proc macro processes some code with the trace attributes, they will be lost, so the traces are best effort rather than precise. The next step is to do the same thing with `cfg` attributes (`#[cfg(TRUE)]` currently remains in both AST and tokens after expanding, it should be replaced with a trace instead). The idea belongs to `@estebank.`
2025-03-20make `never_loop` applicability more flexible (#14203)Timo-5/+193
The applicability of `never_loop` is currently set to `Unspecified`, but if the loop block does not contain `break` or `continue`, it can be `MachineApplicable`. changelog: [`never_loop`]: the applicability is now `MachineApplicable` when the loop block contains neither `break` nor `continue`
2025-03-20Rollup merge of #138735 - jieyouxu:drop-llvm-alias, r=nikicMatthias Krüger-8/+10
Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group Because it's way too easy to confuse LLVM Icebreakers ping group versus trying to ping WG-llvm. And AFAIK, icebreakers-llvm isn't really used in a good while. I also fixed the rustc-dev-guide docs about ``@rustbot` ping llvm` (and changed that to the raw ping group name ``@rustbot` icebreakers-llvm`) because it's very confusing. Previously discussed in [#t-compiler/wg-llvm > Ping group renaming](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fwg-llvm/topic/Ping.20group.20renaming/with/453005029). FYI `@rust-lang/wg-llvm` FYI `@RalfJung` (since you asked in https://github.com/rust-lang/rust/pull/138120#issuecomment-2710466874) r? `@nikic` (or wg-llvm)
2025-03-20Rollup merge of #138732 - compiler-errors:did, r=jieyouxuMatthias Krüger-11/+12
Use `def_path_str` for def id arg in `UnsupportedOpInfo` We could alternatively just omit the def path from the label, but I think it's fine to keep around Fixes #138730
2025-03-20Rollup merge of #138731 - Zalathar:llvm-expansion, r=jieyouxuMatthias Krüger-34/+97
coverage: Add LLVM plumbing for expansion regions This is currently unused, but paves the way for future work on expansion regions without having to worry about the FFI parts. The span conversion refactoring is only loosely related, but I've included it here because it would conflict with the main changes in `fill_region_tables`, and is pretty straightforward on its own.
2025-03-20Rollup merge of #138729 - compiler-errors:gen, r=lcnrMatthias Krüger-16/+19
Clean up `FnCtxt::resolve_coroutine_interiors` Random cleanups before I make a PR that stalls generator obligations. r? lcnr
2025-03-20Rollup merge of #138727 - compiler-errors:ty-var-origin, r=fmeaseMatthias Krüger-64/+60
Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType` The ordering of ty var unification means that we may end up with a root variable whose ty var origin is from another item's params. Let's not rely on this by just unifying the infer vars with the params of the impl + resolving. It's kinda goofy but it's clearer IMO. Fixes #132826. r? `@fmease` or `@lcnr`
2025-03-20Rollup merge of #138700 - xizheyin:issue-138612, r=NadrierilMatthias Krüger-0/+15
Suggest `-Whelp` when pass `--print lints` to rustc Closes #138612
2025-03-20Rollup merge of #138685 - ↵Matthias Krüger-87/+125
nnethercote:use-Option-Ident-for-lowered-param-names, r=compiler-errors Use `Option<Ident>` for lowered param names. Parameter patterns are lowered to an `Ident` by `lower_fn_params_to_names`, which is used when lowering bare function types, trait methods, and foreign functions. Currently, there are two exceptional cases where the lowered param can become an empty `Ident`. - If the incoming pattern is an empty `Ident`. This occurs if the parameter is anonymous, e.g. in a bare function type. - If the incoming pattern is neither an ident nor an underscore. Any such parameter will have triggered a compile error (hence the `span_delayed_bug`), but lowering still occurs. This commit replaces these empty `Ident` results with `None`, which eliminates a number of `kw::Empty` uses, and makes it impossible to fail to check for these exceptional cases. Note: the `FIXME` comment in `is_unwrap_or_empty_symbol` is removed. It actually should have been removed in #138482, the precursor to this PR. That PR changed the lowering of wild patterns to `_` symbols instead of empty symbols, which made the mentioned underscore check load-bearing. r? ``@compiler-errors``
2025-03-20Rollup merge of #138435 - eholk:prefix-yield, r=oli-obkMatthias Krüger-20/+161
Add support for postfix yield expressions We've been having a discussion about whether we want postfix yield, or want to stick with prefix yield, or have both. I figured it's easy enough to support both for now and let us play around with them while the feature is still experimental. This PR treats `yield x` and `x.yield` as semantically equivalent. There was a suggestion to make `yield x` have a `()` type (so it only works in coroutines with `Resume = ()`. I think that'd be worth trying, either in a later PR, or before this one merges, depending on people's opinions. #43122
2025-03-20Auto merge of #133889 - compiler-errors:inh-unstable, r=Nadrierilbors-2/+132
Consider fields to be inhabited if they are unstable Fixes #133885 with a simple heuristic r? Nadrieril Not totally certain if this needs T-lang approval or a crater run.
2025-03-20Auto merge of #138695 - nikic:llvm-20.1.1, r=dianqkbors-0/+0
Update to LLVM 20.1.1 Fixes https://github.com/rust-lang/rust/issues/138212. Fixes https://github.com/rust-lang/rust/issues/137909.
2025-03-20Disambiguate between wg-llvm and icebreakers-llvm in rustc-dev-guideJieyou Xu-7/+10
2025-03-20Remove `llvm` and `llvms` triagebot ping aliases for icebreakers-llvmJieyou Xu-1/+0
Because it's way too easy to confuse that versus trying to ping WG-llvm. And AFAIK, icebreakers-llvm isn't really used in a good while.
2025-03-20Auto merge of #137930 - nnethercote:use-Wunused-crate-dependencies, ↵bors-60/+51
r=jieyouxu,Nadrieril Use `Wunused-crate-dependencies` for the compiler An implementation of https://github.com/rust-lang/compiler-team/issues/844. r? `@jieyouxu`
2025-03-20Use def_path_str for def id arg in UnsupportedOpInfoMichael Goulet-11/+12
2025-03-20coverage: Convert and check span coordinates without a local file IDZalathar-27/+40
For expansion region support, we will want to be able to convert and check spans before creating a corresponding local file ID. If we create local file IDs eagerly, but some expansion turns out to have no successfully-converted spans, LLVM will complain about that expansion's file ID having no regions.
2025-03-20Pre cleanupsMichael Goulet-16/+19
2025-03-20Do not rely on type_var_origin in OrphanCheckErr::NonLocalInputTypeMichael Goulet-64/+60
2025-03-20coverage: Add LLVM plumbing for expansion regionsZalathar-7/+57
This is currently unused, but paves the way for future work on expansion regions without having to worry about the FFI parts.
2025-03-20Auto merge of #138687 - calebzulawski:sync-from-portable-simd-2025-03-19, ↵bors-46/+96
r=workingjubilee Portable SIMD subtree update
2025-03-19fix suggestion for assignments have enclosing parentheses under ↵Timo-5/+34
`needless_late_init` (#14169) fixes #9895 changelog: [`needless_late_init`]: correct suggestion when assignments have enclosing parentheses
2025-03-20Convert `rustc_serialize` integration tests to unit tests.Nicholas Nethercote-14/+16
Because (a) the vast majority of compiler tests are unit tests, and (b) this works better with `unused_crate_dependencies`.
2025-03-20Use `-Wunused_crate_dependencies` for compiler crates.Nicholas Nethercote-53/+42
It's very useful. There are some false positives involving integration tests in `rustc_pattern_analysis` and `rustc_serialize`. There is also a false positive involving `rustc_driver_impl`'s `rustc_randomized_layouts` feature. And I removed a `rustc_span` mention in a doc comment in `rustc_log` because it wasn't integral to the comment but caused a dev-dependency.
2025-03-19Auto merge of #138714 - matthiaskrgr:rollup-8uwbpwv, r=matthiaskrgrbors-435/+988
Rollup of 7 pull requests Successful merges: - #135394 (`MaybeUninit` inherent slice methods part 2) - #137051 (Implement default methods for `io::Empty` and `io::Sink`) - #138001 (mir_build: consider privacy when checking for irrefutable patterns) - #138540 (core/slice: Mark some `split_off` variants unstably const) - #138589 (If a label is placed on the block of a loop instead of the header, suggest moving it to the header.) - #138594 (Fix next solver handling of shallow trait impl check) - #138613 (Remove E0773 "A builtin-macro was defined more than once.") Failed merges: - #138602 (Slim `rustc_parse_format` dependencies down) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-19Add MSRV check for `question_mark` (#14436)Manish Goregaokar-4/+80
changelog: [`question_mark`]: Now respects the [`msrv`] configuration
2025-03-19Rollup merge of #138613 - m-ou-se:no-more-e0773, r=jdonszelmann,petrochenkovMatthias Krüger-149/+40
Remove E0773 "A builtin-macro was defined more than once." Error E0773 "A builtin-macro was defined more than once" is triggered when using the same `#[rustc_builtin_macro(..)]` twice. However, it can only be triggered in unstable code (using a `rustc_` attribute), and there doesn't seem to be any harm in using the same implementation from `compiler/rustc_builtin_macros/…` for multiple macro definitions. By changing the Box to an Arc in `SyntaxExtensionKind`, we can throw away the `BuiltinMacroState::{NotYetSeen, AlreadySeen}` logic, simplifying things.
2025-03-19Rollup merge of #138594 - oli-obk:no-select, r=lcnrMatthias Krüger-22/+86
Fix next solver handling of shallow trait impl check I'm trying to remove unnecessary direct calls to `select`, and this one seemed like a good place to start 😆 r? `@compiler-errors` or `@lcnr`
2025-03-19Rollup merge of #138589 - ↵Matthias Krüger-25/+296
zachs18:block-label-not-supported-here-loop-body-help, r=petrochenkov If a label is placed on the block of a loop instead of the header, suggest moving it to the header. Fixes #138585 If a label is placed on the block of a loop instead of the header, suggest to the user moving it to the loop header instead of ~~suggesting to remove it~~ emitting a tool-only suggestion to remove it. ```rs fn main() { loop 'a: { return; } } ``` ```diff error: block label not supported here --> src/main.rs:2:10 | 2 | loop 'a: { return; } | ^^^ not supported here + | +help: if you meant to label the loop, move this label before the loop + | +2 - loop 'a: { return; } +2 + 'a: loop { return; } + | ``` Questions for reviewer: * The "desired output" in the linked issue had the main diagnostic be "misplaced loop label". Should the main diagnostic message the changed instead of leaving it as "block label not supported here"? * Should this be `Applicability::MachineApplicable`?
2025-03-19Rollup merge of #138540 - okaneco:const_split_off_first_last, r=m-ou-seMatthias Krüger-8/+18
core/slice: Mark some `split_off` variants unstably const Tracking issue: #138539 Add feature gate `#![feature(const_split_off_first_last)]` Mark `split_off_first`, `split_off_first_mut`, `split_off_last`, and `split_off_last_mut` slice methods unstably const
2025-03-19Rollup merge of #138001 - meithecatte:privately-uninhabited, r=NadrierilMatthias Krüger-50/+121
mir_build: consider privacy when checking for irrefutable patterns This PR fixes #137999. Note that, since this makes the compiler reject code that was previously accepted, it will probably need a crater run. I include a commit that factors out a common code pattern into a helper function, purely because the fact that this was repeated all over the place was bothering me. Let me know if I should split that into a separate PR instead.
2025-03-19Rollup merge of #137051 - thaliaarchi:io-optional-impls/empty, r=m-ou-seMatthias Krüger-13/+218
Implement default methods for `io::Empty` and `io::Sink` Implements default methods of `io::Read`, `io::BufRead`, and `io::Write` for `io::Empty` and `io::Sink`. These implementations are equivalent to the defaults, except in doing less unnecessary work. `Read::read_to_string` and `BufRead::read_line` both have a redundant call to `str::from_utf8` which can't be inlined from `core` and `Write::write_all_vectored` has slicing logic which can't be simplified (See on [Compiler Explorer](https://rust.godbolt.org/z/KK6xcrWr4)). The rest are optimized to the minimal with `-C opt-level=3`, but this PR gives that benefit to unoptimized builds. This includes an implementation of `Write::write_fmt` which just ignores the `fmt::Arguments<'_>`. This could be problematic whenever a user formatting impl is impure, but the docs do not guarantee that the args will be expanded. Tracked in https://github.com/rust-lang/rust/issues/136756. r? `@m-ou-se`