about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-06-18Auto merge of #141061 - dpaoliello:shimasfn, r=bjorn3bors-6/+6
Change __rust_no_alloc_shim_is_unstable to be a function This fixes a long sequence of issues: 1. A customer reported that building for Arm64EC was broken: #138541 2. This was caused by a bug in my original implementation of Arm64EC support, namely that only functions on Arm64EC need to be decorated with `#` but Rust was decorating statics as well. 3. Once I corrected Rust to only decorate functions, I started linking failures where the linker couldn't find statics exported by dylib dependencies. This was caused by the compiler not marking exported statics in the generated DEF file with `DATA`, thus they were being exported as functions not data. 4. Once I corrected the way that the DEF files were being emitted, the linker started failing saying that it couldn't find `__rust_no_alloc_shim_is_unstable`. This is because the MSVC linker requires the declarations of statics imported from other dylibs to be marked with `dllimport` (whereas it will happily link to functions imported from other dylibs whether they are marked `dllimport` or not). 5. I then made a change to ensure that `__rust_no_alloc_shim_is_unstable` was marked as `dllimport`, but the MSVC linker started emitting warnings that `__rust_no_alloc_shim_is_unstable` was marked as `dllimport` but was declared in an obj file. This is a harmless warning which is a performance hint: anything that's marked `dllimport` must be indirected via an `__imp` symbol so I added a linker arg in the target to suppress the warning. 6. A customer then reported a similar warning when using `lld-link` (<https://github.com/rust-lang/rust/pull/140176#issuecomment-2872448443>). I don't think it was an implementation difference between the two linkers but rather that, depending on the obj that the declaration versus uses of `__rust_no_alloc_shim_is_unstable` landed in we would get different warnings, so I suppressed that warning as well: #140954. 7. Another customer reported that they weren't using the Rust compiler to invoke the linker, thus these warnings were breaking their build: <https://github.com/rust-lang/rust/pull/140176#issuecomment-2881867433>. At that point, my original change was reverted (#141024) leaving Arm64EC broken yet again. Taking a step back, a lot of these linker issues arise from the fact that `__rust_no_alloc_shim_is_unstable` is marked as `extern "Rust"` in the standard library and, therefore, assumed to be a foreign item from a different crate BUT the Rust compiler may choose to generate it either in the current crate, some other crate that will be statically linked in OR some other crate that will by dynamically imported. Worse yet, it is impossible while building a given crate to know if `__rust_no_alloc_shim_is_unstable` will statically linked or dynamically imported: it might be that one of its dependent crates is the one with an allocator kind set and thus that crate (which is compiled later) will decide depending if it has any dylib dependencies or not to import `__rust_no_alloc_shim_is_unstable` or generate it. Thus, there is no way to know if the declaration of `__rust_no_alloc_shim_is_unstable` should be marked with `dllimport` or not. There is a simple fix for all this: there is no reason `__rust_no_alloc_shim_is_unstable` must be a static. It needs to be some symbol that must be linked in; thus, it could easily be a function instead. As a function, there is no need to mark it as `dllimport` when dynamically imported which avoids the entire mess above. There may be a perf hit for changing the `volatile load` to be a `tail call`, so I'm happy to change that part back (although I question what the codegen of a `volatile load` would look like, and if the backend is going to try to use load-acquire semantics). Build with this change applied BEFORE #140176 was reverted to demonstrate that there are no linking issues with either MSVC or MinGW: <https://github.com/rust-lang/rust/actions/runs/15078657205> Incidentally, I fixed `tests/run-make/no-alloc-shim` to work with MSVC as I needed it to be able to test locally (FYI for #128602) r? `@bjorn3` cc `@jieyouxu`
2025-06-18Update/bless clippy tests.Mara Bos-52/+47
2025-06-18Remove outdated test.Mara Bos-1/+0
We no longer error in this case!
2025-06-18Auto merge of #138165 - jdonszelmann:inline, r=oli-obkbors-29/+28
Rewrite `inline` attribute parser to use new infrastructure and improve diagnostics for all parsed attributes r? `@oli-obk` This PR: - creates a new parser for inline attributes - creates consistent error messages and error codes between attribute parsers; inline and others - as such changes a few error messages for other attributes to be (in my eyes) much more consistent - tests ast-lowering lints introduced by rust-lang/rust#138164 since this is now useful for the first time - Coalesce some useless error codes Builds on top of rust-lang/rust#138164 Closes rust-lang/rust#137950
2025-06-18Merge from rust-lang/rustLaurențiu Nicola-2153/+5973
2025-06-18Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-06-18Merge from rustcThe Miri Cronjob Bot-3499/+4797
2025-06-18Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-06-18undojnyfah-1/+1
2025-06-18fix formatjnyfah-11/+11
2025-06-18format functionjnyfah-44/+169
2025-06-18Auto merge of #142644 - jhpratt:rollup-f2jed9t, r=jhprattbors-3/+3
Rollup of 14 pull requests Successful merges: - rust-lang/rust#141574 (impl `Default` for `array::IntoIter`) - rust-lang/rust#141608 (Add support for repetition to `proc_macro::quote`) - rust-lang/rust#142100 (rustdoc: make srcIndex no longer a global variable) - rust-lang/rust#142371 (avoid `&mut P<T>` in `visit_expr` etc methods) - rust-lang/rust#142517 (Windows: Use anonymous pipes in Command) - rust-lang/rust#142520 (alloc: less static mut + some cleanup) - rust-lang/rust#142588 (Generic ctx imprv) - rust-lang/rust#142605 (Don't unwrap in enzyme builds in case of missing llvm-config) - rust-lang/rust#142608 (Refresh module-level docs for `rustc_target::spec`) - rust-lang/rust#142618 (Lint about `console` calls in rustdoc JS) - rust-lang/rust#142620 (Remove a panicking branch in `BorrowedCursor::advance`) - rust-lang/rust#142631 (Dont suggest remove semi inside macro expansion for redundant semi lint) - rust-lang/rust#142632 (Update cargo) - rust-lang/rust#142635 (Temporarily add back -Zwasm-c-abi=spec) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-17fix clippyJana Dönszelmann-4/+4
2025-06-17Rollup merge of #142632 - ehuss:update-cargo, r=ehussJacob Pratt-0/+0
Update cargo 6 commits in fc1518ef02b77327d70d4026b95ea719dd9b8c51..2251525ae503fa196f6d7f9ce6d32eccb2d5f044 2025-06-06 04:49:44 +0000 to 2025-06-16 22:01:27 +0000 - feat: Add custom completer for `cargo remove &lt;TAB&gt;` (rust-lang/cargo#15662) - chore(deps): update msrv (3 versions) to v1.85 (rust-lang/cargo#15668) - refactor: replace InternedString with Cow in IndexPackage (rust-lang/cargo#15559) - highlight the correct words (rust-lang/cargo#15659) - CHANGELOG.md: typo (rust-lang/cargo#15660) - Use `Not::not` rather than a custom `is_false` function (rust-lang/cargo#15645)
2025-06-17Rollup merge of #142371 - fee1-dead-contrib:push-xqlkumzurkus, r=petrochenkovJacob Pratt-3/+3
avoid `&mut P<T>` in `visit_expr` etc methods trying a different way than rust-lang/rust#141636 r? ghost
2025-06-17convert entire codebase to parsed inline attrsJana Dönszelmann-29/+28
2025-06-17Auto merge of #142567 - lnicola:sync-from-ra, r=lnicolabors-3488/+4773
Subtree update of `rust-analyzer` r? `@ghost`
2025-06-17Update libc to 0.2.174Trevor Gross-2/+2
This includes a fix for building on gnux32. [1]: https://github.com/rust-lang/libc/releases/tag/0.2.174
2025-06-17Update cargoEric Huss-0/+0
2025-06-17Try to downgrade objectLaurențiu Nicola-12/+3
2025-06-17Merge pull request #20025 from SoxPopuli/hide_private_imports_without_peLaurențiu Nicola-5/+98
Hide imported privates if private editable is disabled
2025-06-17Auto merge of #137944 - davidtwco:sized-hierarchy, r=oli-obkbors-8/+21
Sized Hierarchy: Part I This patch implements the non-const parts of rust-lang/rfcs#3729. It introduces two new traits to the standard library, `MetaSized` and `PointeeSized`. See the RFC for the rationale behind these traits and to discuss whether this change makes sense in the abstract. These traits are unstable (as is their constness), so users cannot refer to them without opting-in to `feature(sized_hierarchy)`. These traits are not behind `cfg`s as this would make implementation unfeasible, there would simply be too many `cfg`s required to add the necessary bounds everywhere. So, like `Sized`, these traits are automatically implemented by the compiler. RFC 3729 describes changes which are necessary to preserve backwards compatibility given the introduction of these traits, which are implemented and as follows: - `?Sized` is rewritten as `MetaSized` - `MetaSized` is added as a default supertrait for all traits w/out an explicit sizedness supertrait already. There are no edition migrations implemented in this, as these are primarily required for the constness parts of the RFC and prior to stabilisation of this (and so will come in follow-up PRs alongside the const parts). All diagnostic output should remain the same (showing `?Sized` even if the compiler sees `MetaSized`) unless the `sized_hierarchy` feature is enabled. Due to the use of unstable extern types in the standard library and rustc, some bounds in both projects have had to be relaxed already - this is unfortunate but unavoidable so that these extern types can continue to be used where they were before. Performing these relaxations in the standard library and rustc are desirable longer-term anyway, but some bounds are not as relaxed as they ideally would be due to the inability to relax `Deref::Target` (this will be investigated separately). It is hoped that this is implemented such that it could be merged and these traits could exist "under the hood" without that being observable to the user (other than in any performance impact this has on the compiler, etc). Some details might leak through due to the standard library relaxations, but this has not been observed in test output. **Notes:** - Any commits starting with "upstream:" can be ignored, as these correspond to other upstream PRs that this is based on which have yet to be merged. - This best reviewed commit-by-commit. I've attempted to make the implementation easy to follow and keep similar changes and test output updates together. - Each commit has a short description describing its purpose. - This patch is large but it's primarily in the test suite. - I've worked on the performance of this patch and a few optimisations are implemented so that the performance impact is neutral-to-minor. - `PointeeSized` is a different name from the RFC just to make it more obvious that it is different from `std::ptr::Pointee` but all the names are yet to be bikeshed anyway. - `@nikomatsakis` has confirmed [that this can proceed as an experiment from the t-lang side](https://rust-lang.zulipchat.com/#narrow/channel/435869-project-goals/topic/SVE.20and.20SME.20on.20AArch64.20.28goals.23270.29/near/506196491) - FCP in https://github.com/rust-lang/rust/pull/137944#issuecomment-2912207485 Fixes rust-lang/rust#79409. r? `@ghost` (I'll discuss this with relevant teams to find a reviewer)
2025-06-17Hide imported privates if private editable is disabledCharlotte Smith-5/+98
2025-06-17Merge pull request #20023 from Veykril/push-vkqlnyttnqzlLukas Wirth-154/+256
Improve completions in if / while expression conditions
2025-06-17Better completion test sortingLukas Wirth-38/+38
2025-06-17Improve completions in if / while expression conditionsLukas Wirth-122/+224
2025-06-17apply clippy::or_fun_callklensy-4/+5
2025-06-17Never make type mismatch diagnostic stable, even when there is a fixChayim Refael Friedman-6/+2
We show fixes now even for experimental diagnostics anyway, and it has false positives.
2025-06-17Merge pull request #20020 from Veykril/push-yuqmorzsqumwLukas Wirth-11/+15
fix: Reload workspaces when cargo configs change
2025-06-17fix: Reload workspaces when cargo configs changeLukas Wirth-11/+15
2025-06-17chore: Start infesting ide crates with 'db lifetimeLukas Wirth-815/+1214
2025-06-17Merge pull request #20018 from Veykril/push-pkowrtoturkrLukas Wirth-84/+176
fix: Copy lockfiles into target directory before invoking `cargo metadata`
2025-06-17Merge pull request #19939 from ChayimFriedman2/fill-arms-selfLukas Wirth-29/+227
feat: In "Fill match arms", allow users to prefer `Self` to the enum name when possible
2025-06-17Merge pull request #19945 from ChayimFriedman2/private-field-quickfixLukas Wirth-32/+125
feat: Add the quickfix for increasing visibility of a private field to the private-field diagnostic (previously it was only on no-such-field)
2025-06-17fix: Copy lockfiles into target directory before invoking `cargo metadata`Lukas Wirth-84/+176
2025-06-17Merge from rustcThe Miri Cronjob Bot-14/+13
2025-06-17Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-06-16miri: bless testsDavid Wood-4/+4
These error messages include lines of the standard library which have changed and so need updated.
2025-06-16miri: fix buildDavid Wood-1/+1
It isn't clear why the `Deref` impl isn't found for this in a stage two build, but presumably relates to `rustc_middle::ty::RawList` containing an extern type and `Deref` not yet being relaxed to `PointeeSized` (this is technically a breaking change but unlikely to be one and will be tested in a follow-up).
2025-06-16clippy: `{Meta,Pointee,}Sized` in non-minicoreDavid Wood-2/+8
One clippy test is `no_core` and needs to have `MetaSized` and `PointeeSized` added to it.
2025-06-16clippy: add `MetaSized` conditionsDavid Wood-1/+8
Existing lints that had special-casing for `Sized` predicates ought to have these same special cases applied to `MetaSized` predicates.
2025-06-16Change __rust_no_alloc_shim_is_unstable to be a functionDaniel Paoliello-6/+6
2025-06-16feat: Insert required parentheses when typing `+` in trait typeLukas Wirth-8/+92
2025-06-16feat: Show what cargo metadata is doing in statusLukas Wirth-26/+57
2025-06-16Auto merge of #142574 - Kobzol:rollup-ldj386u, r=Kobzolbors-3/+2
Rollup of 12 pull requests Successful merges: - rust-lang/rust#141639 (Expose discriminant values in stable_mir) - rust-lang/rust#142082 (Refactor `rustc_attr_data_structures` documentation) - rust-lang/rust#142125 (Stabilize "file_lock" feature) - rust-lang/rust#142236 (Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls) - rust-lang/rust#142373 (Fix Debug for Location) - rust-lang/rust#142416 (Assorted bootstrap cleanups (step 2)) - rust-lang/rust#142431 (Add initial version of snapshot tests to bootstrap) - rust-lang/rust#142450 (Add documentation on top of `rustc_middle/src/query/mod.rs`) - rust-lang/rust#142528 (clarify `rustc_do_not_const_check` comment) - rust-lang/rust#142530 (use `if let` guards where possible) - rust-lang/rust#142561 (Remove an `njn:` comment accidentaly left behind.) - rust-lang/rust#142566 (Fix `-nopt` CI jobs) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-16Format goto_type_definitionLaurențiu Nicola-4/+2
2025-06-16Rollup merge of #142528 - fee1-dead-contrib:push-rlxklunqkwmv, r=RalfJungJakub Beránek-1/+1
clarify `rustc_do_not_const_check` comment ~~Given that we have used this attribute for other reasons before it seems appropriate to make this a "usually".~~ Add function name as a pointer cc ```@rust-lang/wg-const-eval```
2025-06-16Rollup merge of #142125 - cberner:file_lock_stable, r=ChrisDentonJakub Beránek-2/+1
Stabilize "file_lock" feature Closes https://github.com/rust-lang/rust/issues/130994 r? ```@joshtriplett```
2025-06-16update to literal-escaper 0.0.4 for better API without `unreachable` and ↵Marijn Schouten-165/+137
faster string parsing
2025-06-16Auto merge of #142556 - RalfJung:miri-sync, r=RalfJungbors-1013/+882
Miri subtree update r? `@ghost`