about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-21Rollup merge of #138743 - onur-ozkan:override-is-ci-behaviour, r=KobzolMatthias Krüger-74/+415
bootstrap: add `--ci` flag To make bootstrap act like it's running on CI, we had to override the `GITHUB_ACTIONS` environment variable which is a hidden detail of `CiEnv::is_ci`. Now, we can use the `--ci` flag directly on bootstrap which will be documented automatically from `x --help`. This also helps us to avoid race conditions on bootstrap (overriding `GITHUB_ACTIONS` env in each test can cause that if we run the tests in parallel) tests.
2025-03-21Rollup merge of #138724 - fmease:list-stems-bear-no-name, r=nnethercoteMatthias Krüger-2/+12
Check attrs: Don't try to retrieve the name of list stems Fixes #138723. r? nnethercote or compiler
2025-03-21Rollup merge of #138713 - RalfJung:memory-hook-pointers, r=oli-obkMatthias Krüger-2/+26
interpret memory access hooks: also pass through the Pointer used for the access In some ongoing work on the Miri side, we need the absolute address that the memory access occurred at. That is non-trivial to obtain since we don't have an `ecx`. So pass through the `Pointer` used for the access, which contains the address, and which is available everywhere we are calling these hooks. r? `@oli-obk`
2025-03-21Rollup merge of #138694 - LuuuXXX:fix-platform-support-book, r=jieyouxuMatthias Krüger-3/+3
Fix: add ohos target notes
2025-03-21Rollup merge of #138650 - thaliaarchi:io-write-fmt-known, r=ibraheemdevMatthias Krüger-36/+48
Optimize `io::Write::write_fmt` for constant strings When the formatting args to `fmt::Write::write_fmt` are a statically known string, it simplifies to only calling `write_str` without a runtime branch. Do the same in `io::Write::write_fmt` with `write_all`. Also, match the convention of `fmt::Write` for the name of `args`.
2025-03-21Rollup merge of #137357 - syvb:sv/log-docs, r=tgross35Matthias Krüger-0/+200
Document results of non-positive logarithms The integer versions of logarithm functions panic on non-positive numbers. The floating point versions have different, undocumented behaviour (-inf on 0, NaN on <0). This PR documents that. try-job: aarch64-gnu
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-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 #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-20interpret memory access hooks: also pass through the Pointer used for the accessRalf Jung-2/+26
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-20update completion filesonur-ozkan-48/+370
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-20add test for `Config::is_running_on_ci`onur-ozkan-0/+17
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-20make it possible to override CI/non-CI environment behaviouronur-ozkan-26/+28
Signed-off-by: onur-ozkan <work@onurozkan.dev>
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-19Document results of non-positive logarithmssyvb-0/+200
2025-03-19Check attrs: Don't try to retrieve the name of list stemsLeón Orell Valerian Liehr-2/+12
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-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.