about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-21Rollup merge of #138364 - BLANKatGITHUB:compiler, r=RalfJungMatthias Krüger-25/+17
ports the compiler test cases to new rust_intrinsic format pr is part of #132735
2025-03-21Auto merge of #138768 - matthiaskrgr:rollup-nfu3cm3, r=matthiaskrgrbors-118/+727
Rollup of 8 pull requests Successful merges: - #137357 (Document results of non-positive logarithms) - #138650 (Optimize `io::Write::write_fmt` for constant strings) - #138694 (Fix: add ohos target notes) - #138713 (interpret memory access hooks: also pass through the Pointer used for the access) - #138724 (Check attrs: Don't try to retrieve the name of list stems) - #138743 (bootstrap: add `--ci` flag) - #138751 (Fix the "used_with_archive" test on Fuchsia) - #138754 (Handle spans of `~const`, `const` and `async` trait bounds in macro expansion) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-21Rollup merge of #138754 - oli-obk:push-vtqtnwluyxop, r=compiler-errorsMatthias Krüger-1/+22
Handle spans of `~const`, `const` and `async` trait bounds in macro expansion r? `@compiler-errors` `visit_span` is actually only used in one place (the `transcribe::Marker`), and all of this syntax is unstable, so while it would still be nice to write a test for it, I wager there's lots more interesting things in `transcribe::Marker` to write tests for. And the worst is some diagnostics being weird or incremental being not as incremental as it could be
2025-03-21Rollup merge of #138751 - Jeff-A-Martin:used-with-archive-test-fuchsia, ↵Matthias Krüger-0/+1
r=jieyouxu Fix the "used_with_archive" test on Fuchsia This change adds Fuchsia OS as a target to the cfg_attr in the pre_main_constructor external declaration. This allows the "tests/ui/attributes/used_with_archive.rs" to pass against Fuchsia.
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 #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-20Handle spans of `~const`, `const` and `async` trait bounds in macro expansionOli Scherer-1/+22
2025-03-20Fix the "used_with_archive" test on FuchsiaJeff Martin-0/+1
This change adds Fuchsia OS as a target to the cfg_attr in the pre_main_constructor external declaration. This allows the "tests/ui/attributes/used_with_archive.rs" to pass against Fuchsia.
2025-03-20interpret memory access hooks: also pass through the Pointer used for the accessRalf Jung-2/+26
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-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.