Automated pull from upstream HEAD#2452
Closed
ferrocene-automations[bot] wants to merge 668 commits into
Closed
Conversation
fix: Fix handling of params of coroutine fns
update `FIXME(static_mut_refs)` comment to say: use raw pointers instead of references.
find_attr_range_with_source assumes that all syntax nodes came from the original user source code. This isn't true when we do speculative completion of macros: we create additional SyntaxNode values. Ensure that completion is defensive against created syntax nodes, and add a unit test. AI disclosure: Used GPT-5.5 to help implement.
and just always show diffs by default. not sure why you'd want to hide them.
fix: Crash on completion inside macros
This is more robust then assuming it's in Program Files. We still fallback to Program Files as a last resort.
Because we use `ThinVec` rather than `Vec` almost everywhere else in the AST.
Because we use `ThinVec` rather than `Vec` almost everywhere else in the AST.
With comparing `sub_unification_table_root_var` you can have an arbitraty long chain of subtyping relatinships, i.e. a <: b :> c <: d :> e ..., where all a/b/c/d/e/... get the same sub root var. So it's not necessarily true that there exists a type that is directly sub/super of the types compared via `sub_unification_table_root_var`.
…f its nested goals
The unstable attribute on Read::read_le and Read::read_be pointed to the implementation PR rather than the tracking issue, so the docs on doc.rust-lang.org linked to the wrong page.
The docs stated that try_with will return an AccessError when the key has been destroyed. This is not guaranteed: on some platforms, TLS slots can be re-initialized during destruction, so the destroyed state cannot always be observed. Change 'will' to 'may' to accurately reflect the best-effort nature of the check.
…026-07 Update date-check markers for July 2026
view-types: store view types in the AST
Enable Enzyme on x86_64-apple Enable Enzyme for x86_64-apple similar PR: rust-lang/rust#157240 r? @ZuseZ4
std: unconditionally use `preadv`/`pwritev` on AArch64 macOS The stars happened to line up perfectly: macOS 11.0 was the first version to support ARM, and also the first version with `preadv`/`pwritev`. Thus we don't need to use weak linkage if the target is `aarch64-apple-darwin`.
disallow `extern "custom"` on wasm and spirv targets tracking issue: rust-lang/rust#140829 I'm not sure if we should exclude any other architectures? The GPU ones are a bit suspect maybe?
…apping, r=petrochenkov delegation: support mapping of all arguments with `Self` type This PR supports applying target expression to arguments of `Self` type. That the first part of this feature which touches AST -> HIR lowering only and allows lowering of delegation's block several times when there are no definitions inside. The second part will adjust typeck so we can apply adjustments to all mapped arguments as to the first argument of delegation. This should also eventually weak the condition of argument mapping allowing `Box<Self>`, `Arc<Self>`, etc. Part of rust-lang/rust#118212. r? @petrochenkov
Rename some `body_id` to `body_def_id` Since body IDs and item IDs are distinct things, try to use names that do not conflate them. `body_def_id` is a little easier to read as "body-owning definition ID" whereas `body_id` is hard not to just read as "body ID". Related: rust-lang/rust#158611 - I noticed this afterwards. I suspect that `FnCtxt` ought to keep `body_def_id` but maybe add `body_id: BodyId` in addition.
Fixes for QNX SDP 8 This PR contains libstd fixes so libstd can be build for QNX SDP 8. It requires patches to libc-0.2 and cc-rs. The cc-rs patch [was merged]([rust-lang/cc-rs#1775](rust-lang/cc-rs#1775)) already. I have a patch for libc-1.0 [here](rust-lang/libc#5241) which will need backporting to libc-0.2 once merged. With these in place, I was able to remotely `test tests/ui library/std library/alloc library/core` for `x86_64-pc-qnx` using a remote-test-server running on QNX SDP 8.0's QEMU BSP image. The only tests that failed were the two `tests/ui/codegen/huge-stacks.rs` tests, and I did not have enough RAM to run them.
…r=aapoalas Clarify that `LocalKey::try_with` may return `AccessError` The docs for `LocalKey::try_with` state that the function *will* return an `AccessError` when the key has been destroyed. That's not actually guaranteed: - `LocalKey::with` uses `try_with` internally and its docs explicitly acknowledge that it does not always panic when the destructor has run. If `try_with` really did detect every destroyed thread-local, `with` could always panic. - The top-level `LocalKey` docs already note: "On all platforms it's possible for TLS to re-initialize other TLS slots during destruction." Change *will* to *may* to accurately reflect the best-effort nature of the destroyed-key check. Closes rust-lang/rust#157889 @rustbot label +A-docs
Rewrite safety requirements for `Allocator` impls This PR supersedes rust-lang/rust#156544. cc rust-lang/rust#157428, rust-lang/rust#156920 cc @nia-e r? @Amanieu (reviewer of rust-lang/rust#156544) I define the concept of "equivalent allocators", in order to be able to talk about cloning allocators, and to give commonsense guarantees about stdlib `Allocator` impls. I define the concept of "invalidating a memory block" in order to be able to talk about users not being allowed to use a block of allocated memory after its allocator is "gone". An `Allocator` implementation is now allowed to invalidate its allocations when the allocator is mutated or when a lifetime in the allocator type expires. Mutation of an `Allocator` should sensibly be allowed to invalidate its allocations. For example, the `bumpalo` crates has a `Bump::reset` method that takes `&mut self` and invalidates all past allocations. Accesses via `&` still must not invalidate past allocations since, for example, `Box` provides `&` access to the allocator. I still had the "allocator destructor" clause as a separate clause from the `&mut` clause, to avoid questions about whether drop glue of types that don't implement `Drop` but have fields that implement `Drop` counts as creating a `&mut` to the whole thing. The "lifetime expiry" clause closes a hole/ambiguity on when an allocator is considered to be "dropped" if it does not have a destructor. Additionally, this clause matches what is required for `Box::into_pin` and `{Rc, Arc}::pin` to be sound. (Those methods have an `A: 'static` bound to prevent allocating via a `&MyAllocator` and then running `MyAllocator`'s destructor.)
…ycat rustdoc: Fix sidebar heading order Makes sidebar heading order match the order of the headings in the main content.
Fix typetree generation for differentiated functions Further improvements after rust-lang/rust#158278 This fixes a test failure on main (encountered while working on the PR above) in `tests/codegen-llvm/autodiff/autodiffv2.rs`. Further improvements are split out into rust-lang/rust#158440, with high-level docs available in rust-lang/rustc-dev-guide#2911 Also noticed that I can (probably?) remove the llvm_enzyme cfg at this point, rust-lang/rust#158460
powerpc64le_unknown_freebsd.rs: link with -lgcc Starting with FreeBSD 16.0, powerpc64le switches to IEEE long double. 128 bit arithmetics are implemented in LLVM's compiler_rt, which is FreeBSD's libgcc. Link with it so that building on FreeBSD 16.0 succeeds - noop for earlier releases.
diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch Fixes rust-lang/rust#158393 ## Problem When a closure passed to a function requiring `for<'a> FnOnce(&'a mut [u8])` has unannotated parameters (e.g. `|buf|`), the compiler emits the confusing error: ```text implementation of `FnOnce` is not general enough ``` without explaining how to fix it. In many cases, simply adding an explicit type annotation to the closure parameter (e.g. `|buf: &mut [u8]|`) resolves the lifetime ambiguity, but the compiler does not currently provide any guidance. ## What This PR adds a diagnostic suggestion in `placeholder_error.rs` that detects when: - the mismatched trait is an Fn-trait (`FnOnce`, `FnMut`, or `Fn`) - the self type is a local closure - one or more closure parameters do not have explicit type annotations When these conditions are met, the compiler now emits the following help message: ```text help: consider adding an explicit type annotation to the closure parameter to resolve the lifetime ambiguity | | let outer_closure = |buf: &mut [u8]| { | +++++++++++ ``` ## Testing A UI test has been added covering the exact reproduction case from the reported issue.
…macro, r=folkertdev Avoid unused braces lint for macro generated arguments Fixes rust-lang/rust#158747 This changes the `unused_braces` lint to avoid suggesting brace removal for macro arguments when those braces may affect `macro_rules!`. But the fragment kind matters: - `$e:expr` matches an expression. Both `1` and `{ 1 }` are expressions, so removing braces can still leave the macro matching the same kind of input. - `$b:block` only matches a block expression written with braces. `{ 1 }` matches, but `1` does not. So `call_expr!({ 1 })` can usually be simplified to `call_expr!(1)`, while `call_block!({ 1 })` cannot. It seems a more concrect report need a full `macro_rules!` matcher analysis, that seems too heavy for `unused` lint.
…rcoieni
Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts
## Summary
Use our `ci-mirrors` for busybox and ubuntu rootfs artifacts instead of relying on external network sources.
Context: [#t-infra > kernel.org is borked @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/kernel.2Eorg.20is.20borked/near/608261860)
---
try-job: armhf-gnu
Avoid final override ICE for RPITIT associated types Fixes rust-lang/rust#158824 `check_overriding_final_trait_item` was running for every associated item in an impl, including the synthetic anonymous associated type generated for RPITIT.
tests: catch up with LLVM returning f128 on the stack In LLVM 22 the x64 MSVC ABI wasn't matched and f128 was being directly returned in %xmm0, but now it correctly returns the value via a pointer.
… r=petrochenkov delegation: add constraints to new generic args Constraints were not added to new generic args which caused them to be missing from HIR and this produced ICE. Fixes rust-lang/rust#158812. Part of rust-lang/rust#118212. r? @petrochenkov
…=nikic tests: clean up over-constraint on LLVM feature count Upstream dropped a feature, resulting in the invalid-attribute test failing because it was expecting "and 76 more" but now it's "and 75 more". Adjust the test to do a replacement with a placeholder on that text so the test is less brittle.
…uwer Rollup of 19 pull requests Successful merges: - rust-lang/rust#156016 (view-types: store view types in the AST) - rust-lang/rust#157385 (Enable Enzyme on x86_64-apple) - rust-lang/rust#158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - rust-lang/rust#158621 (disallow `extern "custom"` on wasm and spirv targets) - rust-lang/rust#158690 (delegation: support mapping of all arguments with `Self` type) - rust-lang/rust#158696 (Rename some `body_id` to `body_def_id`) - rust-lang/rust#158697 (Fixes for QNX SDP 8) - rust-lang/rust#158760 (Clarify that `LocalKey::try_with` may return `AccessError`) - rust-lang/rust#157801 (Rewrite safety requirements for `Allocator` impls) - rust-lang/rust#158085 (rustdoc: Fix sidebar heading order) - rust-lang/rust#158333 (Fix typetree generation for differentiated functions) - rust-lang/rust#158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - rust-lang/rust#158701 ( diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch) - rust-lang/rust#158791 (Avoid unused braces lint for macro generated arguments) - rust-lang/rust#158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - rust-lang/rust#158841 (Avoid final override ICE for RPITIT associated types) - rust-lang/rust#158889 (tests: catch up with LLVM returning f128 on the stack) - rust-lang/rust#158905 (delegation: add constraints to new generic args) - rust-lang/rust#158922 (tests: clean up over-constraint on LLVM feature count) Failed merges: - rust-lang/rust#158617 (allow mGCA const arguments to fall back to anon consts)
Predicate/clause cleanups `Clause` is a subset of `Predicate`, more or less. (Interning makes things slightly more complicated than that.) There are numerous places where the code deals in predicates but really only clauses are possible. This PR eliminates some of them. Details in individual commits. r? @lqd
This commit is generated by `ferrocene/tools/pull-upstream/pull.sh`. The list of excluded files is defined in `.gitattributes`.
Contributor
|
i think the automation is getting confused that i removed backport:never from #2447 :( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
x.pycompletions. Please run./x run generate-completionsafter fixing the merge conflicts.x.pyhelp file. Please run./x run generate-helpafter fixing the merge conflicts.This PR pulls the following changes from the upstream repository:
157104: Predicate/clause cleanups158924: Rollup of 19 pull requests158922: tests: clean up over-constraint on LLVM feature count158905: delegation: add constraints to new generic args158889: tests: catch up with LLVM returning f128 on the stack158841: Avoid final override ICE for RPITIT associated types158802: Useci-mirrorsinarmhf-gnufor {busybox, ubuntu rootfs} artifacts158791: Avoid unused braces lint for macro generated arguments158701: diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch158646: powerpc64le_unknown_freebsd.rs: link with -lgcc158333: Fix typetree generation for differentiated functions158085: rustdoc: Fix sidebar heading order157801: Rewrite safety requirements forAllocatorimpls158760: Clarify thatLocalKey::try_withmay returnAccessError158697: Fixes for QNX SDP 8158696: Rename somebody_idtobody_def_id158690: delegation: support mapping of all arguments withSelftype158621: disallowextern "custom"on wasm and spirv targets158179: std: unconditionally usepreadv/pwritevon AArch64 macOS157385: Enable Enzyme on x86_64-apple156016: view-types: store view types in the AST158896:rust-analyzersubtree update158891: Rollup of 13 pull requests158881: Update mdbook to 0.5.4158878: borrowck: Inlinefree_region_constraint_info()to simplify the code158867: rewriteAlign::max_for_targetin a more obvious way158860: Deleteimpl_def_idfield fromImplHeader158826: Reorganizetests/ui/issues[19/N]158679: Document blocking guarantees forstd::sync158553: Avoid infinite recursion when trying to build valtrees for self-referential consts158536: Instatiate binder instead of skipping when suggesting function arg error158346: Prevent rustdoc auto-trait ICEs with-Znext-solver=globally158245: Update the rustc_perf submodule158821: add regression test for late-bound type method probe ICE158796: Distinguish null reference production from null pointer dereference in UB checks158478: Use correct typing mode in mir building for the next solver158577: Polish some macro parsing code158847: Rollup of 24 pull requests158838: tidy: Useempty_alternate = truefor triagebot mention glob check158825: Fix typo158810: Add supplementary information for get_unchecked(mut)158786: Add regression test for builtin attr macro values158776: fix: emit diagnostic for AVR target without target-cpu158772: rustc-dev-guide subtree update158771: library: expand HashSet::extract_if coverage158765: Fix ICE on non-ident path indoc(auto_cfg values)158757: Fix incorrect tracking issue forread_le/read_be158755: UseThinVecmore in the AST158752: Reorganizetests/ui/issues[18/N]158730: UpdateFIXME(static_mut_refs)comments158671: Move tests batch 17158310: Remove unexpected usage of Unambig in non-infer variants158183: std: allocate less memory incurrent_exefor OpenBSD157734: Stabilizelocal_key_cell_update158819: PutInhabitedPredicate::NotInModuleearlier in disjunction since it can be a lot faster158785: hook intrinsic-test into aarch64-gnu158782: Add and use cfg(target_has_threads) to enforce no_thread impl usage158775: bootstrap: only encode RUSTFLAGS when a flag contains a space158743: Look for cdb location in the registry first158694: Positive test for closures needing expectations158642: Clarify some interning details158377: add-Zforce-intrinsic-fallbackflag158864: Rollup of 12 pull requests158820: Fix rustdoc ICE on deprecated note in inlined re-export chain158770: Weaken guarantee forFrom<legacy::RangeInclusive> for RangeInclusive158405: rustc_target: Add ARMv8-M related target features158381: Expose debug scope of statement and terminator in rustc_public157966: Emit a suggestion to cast the never type into a concrete type when it fails to satisfy animpl Traitbound157466: Better error message when bare type in impl parameter list158853: Fix typo for link on nto-qnx.md158505: Update POSIX edition links157820: consider subtyping when checking if an infer var is sized158540: Movestd::io::Seektocore::io158537: Addstd::io::cursor::WriteThroughCursor156976: enable eagerparam_envnorm in new solver158705: UseLowerAvailableDepth::Nofor normalizes-to goal itself instead of its nested goals158811: Rollup of 19 pull requests158706: Tweaks to MIR building scope API158698: Update TypeVisitable implementation158689: resolver: don't useFinalizewhen resolving visibilities during AST expansion158659: refactor the normalization incoerce_shared_info158539: MoveSizeHintandIoHandletocore::io158751: rustdoc: Fix crash when trying to inline foreign item which cannot have attributes158711: library: Comment on libtest's dicey internal soundness158704: OptimizeArrayChunks::try_rfoldwithDoubleEndedIterator::next_chunk_back158624: borrowck: Introduce BlameConstraint::to_obligation_cause_from_path()158552: make some tidy errors around python easier to understand158434: delegation: refactor AST -> HIR lowering157857: Stabilize#[my_macro] mod foo;(part ofproc_macro_hygiene)157835: expand free alias types in the auto-trait orphan check157151: JSON target specs: remove 'x86-softfloat' compatibility alias156777: Add -Zautodiff_post_passes flag to limit which llvm passes to run after enzyme to make autodiff tests more robust155989: Updatetransmute_copyto ub_checks and?Sized155932: MIR Call terminator: evaluate destination place before arguments134021: ImplementIntoIteratorfor[&[mut]] Box<[T; N], A>158692: Add release notes for 1.96.1158740: Bump version to 1.99.0158169: Fix debuginfo compression in bootstrap158795: Rollup of 21 pull requests158688: Cleanup attribute docs and add links to other mentioned attributes158687: StreamlineMacEager158684: Add missing generic test coverage for#[splat]158682: Avoid delayed bug for disabled on_type_error arguments158681: Remove unnecessaryHashderives from MIR types158680: Avoid ICE forNonZero<char>in improper_ctypes158677: Add extra splat tests158674: library: Polish transmute'ssplit_at_stdlibexample158669: Removesrc/tools/test-float-parse/Cargo.lock158651: ptr doc: reduce use of unsafe block to where needed158637: hir_ty_lowering: avoid self type lookup for inherent aliases158585: Improve diagnostic for too many super keywords158549: process::exec: using appropriate exit code on vxworks.158473: Addriscv32imfc-unknown-none-elfbare-metal target158021: Remove old MinGW workaround158665: Revert "Remove redundant dyn-compatibility check."158658: Update LLVM submodule158627: Simplify option-iterator flattening in the compiler158606: use ProjectionPredicate instead of AliasRelate158494: Improve E0277 diagnostics for conditionally implemented traits158100: Emit retags in codegen to support BorrowSanitizer (part 4)158691: Update cargo submodule158774: Mirror kernel archives inci-mirrorsto not depend on currently unavailable kernel mirror sources158525: Reorganizetests/ui/issues[17/N]158676: Rollup of 8 pull requests158667: rustc_sanitizers: use twox-hash without default features158364: rustc_target/asm: add LoongArch LSX/LASX inline asm register support158334: rustdoc: Show use-site paths for unevaluated const array lengths158574: Clarify ExitStatusExt documentation158531: Changeadjust_ident_and_get_scopearg toLocalDefId158427: Implementptr::{read,write}_unalignedviarepr(packed)158180: std: useOnceLockfor SGX environment variable storage156737: ImplementDoubleEndedIterator::next_chunk_back158663: Rollup of 8 pull requests158647: Documentstrip_circumfixbehavior on overlapping prefix and suffix.158634: Add missingneeds_dropcheck toDroplessArena.158633: Remove unnecessaryClonederives on resolver types158620: Remove skip_norm_w/i/p().def_id with a helper158613: Fix getrandom fallback test on platforms withpanic=abort158397: delegation: support simplest outputSelfmapping156716: tests: fix: parallel frontend test failures: different alloc ids158294: Use .drectve for MSVC DLL exports158604: resolve: no allocation inresolve_ident_in(_local)_module_*158639: Rollup of 6 pull requests158636: linkchecker: upgrade tohtml5ever v0.39158542: Renamealigntodefault_alignonScalarandPrimitive158516: Deduplicate codegen backends in bootstrap config158483: signed strict division: just use normal division158449: QNX target renaming157718: Do not increase depth when evaluating nested goals ofNormalizesTo158629: Rollup of 7 pull requests158616: Remove dependency fromrustc_metadataonrustc_incremental158614: Fix error message when rejecting implicit stage != 2 in CI158573: stabilizefeature(atomic_from_mut)158569: [rustdoc] Fix handling of inlining ofno_inlineof foreign items157650: rustc_target: Add OpenEmbedded/Yocto Linux base targets157347: ImplementBox::as_non_null().156379: lint oncore::ffi::c_voidas a return type158610: Rollup of 5 pull requests158592: tests: only runlexical-scope-in-match.rsfor LLDB >= 21158571: Update books158563: Test(lib/net): Fixhostname_smoketestfor Win7158560: Move per-function debuginfo methods from codegen to builder methods158600: Fixrustc --unpretty=expandedemit of[const] [unsafe] impl Trait for158595: Rollup of 7 pull requests158591: Fix spacing issue for unused parentheses lint158327: Move attribute and keyword docs fromstdtocore157445: Allow section override when using patchable-function-entries158562: Improve tracing of steps in bootstrap158561: Avoid building rustdoc for tests without doctests158256: Avoid parser panics bubbling out to proc macros158073: bootstrap: fix panic when repo path contains spaces by switching to CARGO_ENCODED_RUSTFLAGS158593: Rollup of 11 pull requests158582: Comment on needed RAM in huge-stacks.rs158568: llvm-wrapper: use accessors for private fields in LLVM 23+158564: fix-Z min-recursion-limitunstable chapter name158543: Note usage of documentation hard links incore::io158468: Include default-stability info in rustdoc JSON.158081: trait-system: Recover deferred closure calls after errors158556: delegation: store child segment flag inPathSegment158375: SupportDefKind::InlineConstinConstKind::Unevaluated156295: Pass the wholeGenericArgstoInterner::for_each_relevant_impl()156230: tests: check wasm compiler_builtins object architecture155722: Introduce aarch64-unknown-linux-pauthtest target158035: resolve: Explicit Set for detecting resolution cycles146275: lint ImproperCTypes: refactor linting architecture (part 3)158477: Remove redundant dyn-compatibility check.