about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-05-27Auto merge of #125602 - RalfJung:interpret-mir-lifetime, r=oli-obkbors-815/+727
interpret: get rid of 'mir lifetime I realized our MIR bodies are actually at lifetime `'tcx`, so we don't need to carry around this other lifetime everywhere. r? `@oli-obk`
2024-05-27Auto merge of #125410 - fmease:adj-lint-diag-api, r=nnethercotebors-751/+600
[perf] Delay the construction of early lint diag structs Attacks some of the perf regressions from https://github.com/rust-lang/rust/pull/124417#issuecomment-2123700666. See individual commits for details. The first three commits are not strictly necessary. However, the 2nd one (06bc4fc67145e3a7be9b5a2cf2b5968cef36e587, *Remove `LintDiagnostic::msg`*) makes the main change way nicer to implement. It's also pretty sweet on its own if I may say so myself.
2024-05-27Auto merge of #125468 - BoxyUwU:remove_defid_from_regionparam, r=compiler-errorsbors-212/+320
Remove `DefId` from `EarlyParamRegion` Currently we represent usages of `Region` parameters via the `ReEarlyParam` or `ReLateParam` variants. The `ReEarlyParam` is effectively equivalent to `TyKind::Param` and `ConstKind::Param` (i.e. it stores a `Symbol` and a `u32` index) however it also stores a `DefId` for the definition of the lifetime parameter. This was used in roughly two places: - Borrowck diagnostics instead of threading the appropriate `body_id` down to relevant locations. Interestingly there were already some places that had to pass down a `DefId` manually. - Some opaque type checking logic was using the `DefId` field to track captured lifetimes I've split this PR up into a commit for generate rote changes to diagnostics code to pass around a `DefId` manually everywhere, and another commit for the opaque type related changes which likely require more careful review as they might change the semantics of lints/errors. Instead of manually passing the `DefId` around everywhere I previously tried to bundle it in with `TypeErrCtxt` but ran into issues with some call sites of `infcx.err_ctxt` being unable to provide a `DefId`, particularly places involved with trait solving and normalization. It might be worth investigating adding some new wrapper type to pass this around everywhere but I think this might be acceptable for now. This pr also has the effect of reducing the size of `EarlyParamRegion` from 16 bytes -> 8 bytes. I wouldn't expect this to have any direct performance improvement however, other variants of `RegionKind` over `8` bytes are all because they contain a `BoundRegionKind` which is, as far as I know, mostly there for diagnostics. If we're ever able to remove this it would shrink the `RegionKind` type from `24` bytes to `12` (and with clever bit packing we might be able to get it to `8` bytes). I am curious what the performance impact would be of removing interning of `Region`'s if we ever manage to shrink `RegionKind` that much. Sidenote: by removing the `DefId` the `Debug` output for `Region` has gotten significantly nicer. As an example see this opaque type debug print before vs after this PR: `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0, T, DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0])` `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), ['a/#0, T, 'a/#0])` r? `@compiler-errors` (I would like someone who understands the opaque type setup to atleast review the type system commit, but the rest is likely reviewable by anyone)
2024-05-27interpret: get rid of 'mir lifetime everywhereRalf Jung-760/+671
2024-05-27interpret: the MIR is actually at lifetime 'tcxRalf Jung-74/+75
2024-05-27Auto merge of #125580 - RalfJung:miri-sync, r=RalfJungbors-1192/+1138
Miri subtree update r? `@ghost`
2024-05-27Auto merge of #125593 - workingjubilee:rollup-67qk7di, r=workingjubileebors-139/+185
Rollup of 8 pull requests Successful merges: - #124048 (Support C23's Variadics Without a Named Parameter) - #125046 (Only allow immutable statics with #[linkage]) - #125466 (Don't continue probing for method if in suggestion and autoderef hits ambiguity) - #125469 (Don't skip out of inner const when looking for body for suggestion) - #125544 (Also mention my-self for other check-cfg docs changes) - #125559 (Simplify the `unchecked_sh[lr]` ub-checks a bit) - #125566 (Notify T-rustdoc for beta-accepted and stable-accepted too) - #125582 (Avoid a `FieldIdx::from_usize` in InstSimplify) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-26Rollup merge of #125582 - scottmcm:less-from-usize, r=jieyouxuJubilee-5/+4
Avoid a `FieldIdx::from_usize` in InstSimplify Just a tiny cleanup I noticed in passing while looking at something unrelated.
2024-05-26Rollup merge of #125566 - camelid:notify-accepted, r=GuillaumeGomezJubilee-0/+26
Notify T-rustdoc for beta-accepted and stable-accepted too Otherwise, it's unclear when the nomination label is removed whether the backport was accepted, thus nomination removed, or if the backport was rejected, thus nomination removed. r? ````@GuillaumeGomez````
2024-05-26Rollup merge of #125559 - scottmcm:simplify-shift-ubcheck, r=workingjubileeJubilee-12/+8
Simplify the `unchecked_sh[lr]` ub-checks a bit It can use the constant in the check, rather than passing it as a parameter.
2024-05-26Rollup merge of #125544 - Urgau:check-cfg-mention-cargo-specific, r=jieyouxuJubilee-0/+3
Also mention my-self for other check-cfg docs changes This PR adds a mention for my-self for the recently added `src/doc/rustc/src/check-cfg` directory. *I had to add a second mention just for the directory since [`Path::starts_with`](https://doc.rust-lang.org/std/path/struct.Path.html#method.starts_with) as used by [triagebot](https://github.com/rust-lang/triagebot/blob/48f29f351cae774caa90f555fbbc6d0df7dce80e/src/handlers/mentions.rs#L69), matches on path components and so can never return true for a file and directory at the same time.*
2024-05-26Rollup merge of #125469 - compiler-errors:dont-skip-inner-const-body, r=cjgillotJubilee-6/+29
Don't skip out of inner const when looking for body for suggestion Self-explanatory title, I'll point out the important logic in an inline comment. Fixes #125370
2024-05-26Rollup merge of #125466 - compiler-errors:dont-probe-for-ambig-in-sugg, ↵Jubilee-2/+34
r=jieyouxu Don't continue probing for method if in suggestion and autoderef hits ambiguity The title is somewhat self-explanatory. When we hit ambiguity in method autoderef steps, we previously would continue to probe for methods if we were giving a suggestion. This seems useless, and causes an ICE when we are not able to unify the receiver later on in confirmation. Fixes #125432
2024-05-26Rollup merge of #125046 - bjorn3:no_mutable_static_linkage, r=cjgillotJubilee-3/+37
Only allow immutable statics with #[linkage]
2024-05-26Rollup merge of #124048 - veera-sivarajan:bugfix-123773-c23-variadics, ↵Jubilee-111/+44
r=compiler-errors Support C23's Variadics Without a Named Parameter Fixes #123773 This PR removes the static check that disallowed extern functions with ellipsis (varargs) as the only parameter since this is now valid in C23. This will not break any existing code as mentioned in the proposal document: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2975.pdf. Also, adds a doc comment for `check_decl_cvariadic_pos()` and fixes the name of the function (`varadic` -> `variadic`).
2024-05-26Auto merge of #125576 - lnicola:sync-from-ra, r=lnicolabors-1321/+1974
Subtree update of `rust-analyzer` r? `@ghost`
2024-05-26Avoid a `FieldIdx::from_usize` in InstSimplifyScott McMurray-5/+4
2024-05-26Auto merge of #125546 - ChrisDenton:mingw-ci, r=Mark-Simulacrumbors-41/+4
Try to not reinstall tools in mingw CI Reinstalling the tools seems prone to failure (e.g. [latest](https://github.com/rust-lang/rust/pull/125529#issuecomment-2130919307)) and is more work. It also seems unnecessary as CI actually uses a vendored tarball for builds. cc `@mati865`
2024-05-26Auto merge of #3631 - RalfJung:blocking-refactor, r=RalfJungbors-1043/+951
completely refactor how we manage blocking and unblocking threads This hides a lot of invariants from the implementation of the synchronization primitives, and makes sure we never have to release or acquire a vector clock on another thread but the active one.
2024-05-26add a macro to declare thread unblock callbacksRalf Jung-249/+256
2024-05-26Auto merge of #122079 - tbu-:pr_copy_file_range_probe, r=the8472bors-19/+48
Less syscalls for the `copy_file_range` probe If it's obvious from the actual syscall results themselves that the syscall is supported or unsupported, don't do an extra syscall with an invalid file descriptor. CC #122052
2024-05-26Auto merge of #3632 - RalfJung:readdir, r=RalfJungbors-35/+33
unix/fs: a bit of cleanup in macos_fbsd_readdir_r
2024-05-26unix/fs: a bit of cleanup in macos_fbsd_readdir_rRalf Jung-35/+33
2024-05-26Auto merge of #3633 - RalfJung:target, r=RalfJungbors-1/+7
fix './miri run --dep --target _'
2024-05-26fix './miri run --dep --target _'Ralf Jung-1/+7
2024-05-26data_race: vector indices can be reused immediately when the thread is goneRalf Jung-82/+37
2024-05-26completely refactor how we manage blocking and unblocking threadsRalf Jung-895/+832
2024-05-26Auto merge of #125574 - matthiaskrgr:rollup-1oljoup, r=matthiaskrgrbors-45/+61
Rollup of 6 pull requests Successful merges: - #125307 (tidy: stop special-casing tests/ui entry limit) - #125375 (Create a triagebot ping group for Rust for Linux) - #125473 (fix(opt-dist): respect existing config.toml) - #125508 (Stop SRoA'ing `DynMetadata` in MIR) - #125561 (Stabilize `slice_flatten`) - #125571 (f32: use constants instead of reassigning a dummy value as PI) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-26Rollup merge of #125571 - tesuji:dummy-pi, r=NilstriebMatthias Krüger-4/+4
f32: use constants instead of reassigning a dummy value as PI
2024-05-26Rollup merge of #125561 - Cyborus04:stabilize-slice-flatten, r=scottmcmMatthias Krüger-11/+4
Stabilize `slice_flatten`
2024-05-26Rollup merge of #125508 - scottmcm:fix-125506, r=NilstriebMatthias Krüger-0/+24
Stop SRoA'ing `DynMetadata` in MIR Fixes #125506
2024-05-26Rollup merge of #125473 - weihanglo:respect-existing-config-toml, r=KobzolMatthias Krüger-17/+14
fix(opt-dist): respect existing config.toml This is another step toward making opt-dist work in sandboxed environments. See also <https://github.com/rust-lang/rust/pull/125465>. opt-dist verifies the final built rustc against a subset of rustc test suite. However it overwrote the pre-existing `config.toml` [^1], and that results in ./vendor/ directory removed [^2]. Instead of overwriting, this patch use `--set <config-value>` to override paths to rustc / cargo / llvm-config. [^1]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77 [^2]: https://github.com/rust-lang/rust/blob/8679004993f08807289911d9f400f4ac4391d2bc/src/bootstrap/bootstrap.py#L1057
2024-05-26Rollup merge of #125375 - Kobzol:triagebot-rfl-ping-group, r=Mark-SimulacrumMatthias Krüger-0/+13
Create a triagebot ping group for Rust for Linux Corresponding rustc-dev-guide PR [here](https://github.com/rust-lang/rustc-dev-guide/pull/1984). Discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Testing.20Rust.20for.20Linux.20in.20our.20CI).
2024-05-26Rollup merge of #125307 - workingjubilee:uproot-entry-limit, r=Mark-SimulacrumMatthias Krüger-13/+2
tidy: stop special-casing tests/ui entry limit It is genuinely more annoying to have this error, now that this value is below the general `ENTRY_LIMIT` cap, when one is trying to clean out tests from tests/ui! This code has served its purpose well, let it rest now rather than force it to continue haunting us.
2024-05-26Auto merge of #125570 - tesuji:stdout-handle, r=Nilstriebbors-7/+5
Use STD_OUTPUT_HANDLE instead of magic number
2024-05-26Do less reinstalling in mingw CIChris Denton-41/+4
2024-05-26f32: use constants instead of reassigning a dummy value as PILzu Tao-4/+4
2024-05-26use proper name instead of magic numberLzu Tao-8/+6
2024-05-26Auto merge of #17296 - mathew-horner:no-clone-target, r=Veykrilbors-3/+3
Avoid clone when constructing runnable label. I stumbled across this when reading this code. This seems like an unnecessary allocation (though likely small?)
2024-05-26Auto merge of #17295 - 0xJonas:fix_passing_env_vars_to_cpptools, r=Veykrilbors-1/+4
Use correct format for setting environment variables when debugging with cpptools The RA VSCode extension uses an incorrect format for the environment variables in the `launch.json` when debugging with the C/C++ Extension. This extension uses a different format than CodeLLDB or NativeDebug, which means that the environment variables are not actually set for the debuggee. What it currently looks like: ```json "env": { "NAME": "VALUE" } ``` What the C/C++ extension expects: ```json "environment": [ { "name": "NAME", "value": "VALUE" } ] ``` For reference: https://code.visualstudio.com/docs/cpp/launch-json-reference#_environment
2024-05-26make release_clock always work on the current threadRalf Jung-106/+115
2024-05-26Auto merge of #124661 - RalfJung:only-structural-consts-in-patterns, r=pnkfelixbors-1209/+185
Turn remaining non-structural-const-in-pattern lints into hard errors This completes the implementation of https://github.com/rust-lang/rust/issues/120362 by turning our remaining future-compat lints into hard errors: indirect_structural_match and pointer_structural_match. They have been future-compat lints for a while (indirect_structural_match for many years, pointer_structural_match since Rust 1.75 (released Dec 28, 2023)), and have shown up in dependency breakage reports since Rust 1.78 (just released on May 2, 2024). I don't expect a lot of code will still depend on them, but we will of course do a crater run. A lot of cleanup is now possible in const_to_pat, but that is deferred to a later PR. Fixes https://github.com/rust-lang/rust/issues/70861
2024-05-25Notify T-rustdoc for beta-accepted and stable-accepted tooNoah Lev-0/+26
Otherwise, it's unclear when the nomination label is removed whether the backport was accepted, thus nomination removed, or if the backport was rejected, thus nomination removed.
2024-05-26Stabilize `slice_flatten`Cyborus-11/+4
2024-05-26Auto merge of #125070 - tbu-:pr_set_extension_panic, r=jhprattbors-0/+36
Panic if `PathBuf::set_extension` would add a path separator This is likely never intended and potentially a security vulnerability if it happens. I'd guess that it's mostly literal strings that are passed to this function in practice, so I'm guessing this doesn't break anyone. CC #125060
2024-05-25opt-dist: dont overrwite config.toml when verifyingWeihang Lo-17/+14
This is another step toward making opt-dist work in sandboxed environments opt-dist verifies the final built rustc against a subset of rustc test suite. However it overwrote the pre-existing `config.toml` [^1], and that results in ./vendor/ directory removed [^2]. Instead of overwriting, this patch use `--set <config-value>` to override paths to rustc / cargo / llvm-config. [^1]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77 [^2]: https://github.com/rust-lang/rust/blob/8679004993f08807289911d9f400f4ac4391d2bc/src/bootstrap/bootstrap.py#L1057
2024-05-26Auto merge of #125518 - saethlin:check-arguments-new-in-const, r=joboetbors-87/+75
Move the checks for Arguments constructors to inline const Thanks `@Skgland` for pointing out this opportunity: https://github.com/rust-lang/rust/pull/117804#discussion_r1612964362
2024-05-25Simplify the `unchecked_sh[lr]` ub-checks a bitScott McMurray-12/+8
2024-05-25Auto merge of #125552 - matthiaskrgr:rollup-f1yybpn, r=matthiaskrgrbors-222/+590
Rollup of 7 pull requests Successful merges: - #121377 (Stabilize `LazyCell` and `LazyLock`) - #122986 (Fix c_char on AIX) - #123803 (Fix `VecDeque::shrink_to` UB when `handle_alloc_error` unwinds.) - #124080 (Some unstable changes to where opaque types get defined) - #124667 (Stabilize `div_duration`) - #125472 (tidy: validate LLVM component names in tests) - #125523 (Exit the process a short time after entering our ctrl-c handler) r? `@ghost` `@rustbot` modify labels: rollup
2024-05-25Removed returnJonas Rinke-3/+4