Rollup of 9 pull requests - #163153
Closed
JonathanBrouwer wants to merge 24 commits into
Closed
Rollup of 9 pull requests#163153JonathanBrouwer wants to merge 24 commits into
JonathanBrouwer wants to merge 24 commits into
Conversation
`is_const_pat_that_looks_like_binding` matched the pattern snippet against a plain identifier so the `#` in `let r#x = 0` rejected it and the binding lost both the label pointing at `const x` and the `introduce a variable instead` suggestion. strip a leading `r#` before the check and render the const name with `to_ident_string` in the label so a keyword name prints as `r#fn`. fixes rust-lang#162949
…typeck is tainted We started to check typeck result's tainted_by_errors in check_pat for LateLint, But ideally the check should be in a better place which all lints profit from it.
`DiagInner` impls `PartialEq` and `Hash`, as you'd expect for storing it in a hash table. But there's a couple of strange things. - We only store the hash value of the `DiagInner` to do deduplication, not the `DiagInner` itself, which means the `PartialEq` impl is unused. - The `Hash` impl only considers some of the fields. Some of the ignored fields are clearly deliberate (there are comments) but for some it is unclear if it is deliberate. This commit: - Removes the unused `PartialEq` impl. - Inlines and removes `keys` now that it's not needed for `PartialEq`. - Uses struct deconstruction to ensure no fields can be accidentally ignored. I have preserved existing behaviour by assuming that all the ignored fields are supposed to be ignored. - Renames `hash` as an inherent method `dedup_hash` to indicate that it's not a typical hash function, and simplifies it to just return `Hash128` instead of being generic. - Replaces the unnecessary `collect` on `args` with `as_slice`. - Improves the comment on `emitted_diagnostics`.
Both will be used by the amdgpu target to implement the `gpu-kernel` ABI. `address_space` specifies the address space of an indirect argument. `AmdgpuKernelArg` translates to LLVM’s byref, which is similar to on_stack/byval, however, there is no extra copy made, the pointer may not point to the stack but can point to some other address space, and the passed argument should not be modified. byval and byref are mutually exclusive, so change on_stack to an enum with the new states, Pointer (none), OnStack and AmdgpuKernelArg.
Add support to pass structs, arrays and vectors to amdgpu kernels. Scalars and vectors are taken by value, aggregates are passed by byref pointers. Structs containing a single scalar/vector are handled like a scalar. Judging from clang tests, nvptx seems to do somewhat the same, just using byval instead of byref: https://github.com/llvm/llvm-project/blob/3a8affeef4da19d39191aac316e189eca3214a8c/clang/test/CodeGenCUDA/kernel-args.cu I tested a couple of the lit test signatures on real hardware and it seems to work fine. Given the relatively simple implementation, I hope this amount of testing is enough (the C calling convention seems like a worse fit for Rust’s current ABI code, it’s still giving me headaches).
… r=lcnr Move `Const` from `rustc_middle` to `rustc_type_ir` Split by commit; - Firstly move the type and methods - From `I::Const` -> `Const<I>` - Import `ConstExt` in all places that require the extension trait methods in compiler - Import `ConstExt` in all places that require the extension trait methods in clippy r? @lcnr
… r=oli-obk Check tainted_by_error in LateLint ## Context This PR continues from rust-lang#138679 (comment). In the last PR, I introduced typeck result's tainted_by_error in check_pat. But as we've discussed, I should put the check to a better place which all lints get benefit from the check. ## Change Since visit_nested_body in late.rs is the starting point of late lint for a nested body, I moved the error check to the function. I also rename one ui test case which I introduced in the last PR. I think the new name describes what the test wants to check more. This PR fixes rust-lang#138361 . Note that we need to use actually_rustdoc to call typeck_body() in visit_nested_body. Otherwise rustdoc returns an error. However, as its comment describes we shouldn't use actually_rustdoc if there is an alternative solution. So far I only come up with using actually_rustdoc (this change), or checking tainted_by_error in each check_xxx functions (e.g., check on check_pat in rust-lang#138679, and on check_expr for rust-lang#138361).
Properly implement the gpu-kernel ABI for amdgpu Add support to pass structs, arrays and vectors to amdgpu kernels. Scalars and vectors are taken by value, aggregates are passed by byref pointers. Structs containing a single scalar/vector are handled like a scalar. Judging from clang tests, nvptx seems to do somewhat the same, just using byval instead of byref: https://github.com/llvm/llvm-project/blob/e4e18dba3d77f4a3eea58bcc9ccae5a5498ede7c/clang/test/CodeGenCUDA/kernel-args.cu I tested a couple of the lit test signatures on real hardware and it seems to work fine. Given the relatively simple implementation, I hope this amount of testing is enough (the C calling convention seems like a worse fit for Rust’s current ABI code, it’s still giving me headaches). This adds two members to `PassMode::Indirect`. `address_space` specifies the address space of an on_stack/byval or by_ref pointer argument. `by_ref` translates to LLVM’s byref, which is similar to on_stack/byval, however, there is no extra copy made, the pointer may not point to the stack but can point to some other address space, and the passed argument should not be modified. Both are used by the amdgpu target to implement the `gpu-kernel` ABI. Tracking issue for the `gpu-kernel` ABI: rust-lang#135467 Tracking issue for the amdgpu target: rust-lang#135024
Avoid generating overlapping assignments in DSE This is a fix for rust-lang#162997. Considering we also had rust-lang#155680, I really wonder if this pass should be using LivenessTransferFunction at all.
library: prune allowed lints
…=oli-obk remove unnecessary restriction with next-solver We previously FCP'd to forbid uses of opaque types which only differ in their lifetime arguments during MIR borrowck in rust-lang#116935 (comment). This actually did not end up being necessary after all. Will explain this a bit more in the stabilization documentation for the new solver r? types
…-idents, r=oli-obk emit the constant pattern note for raw identifier bindings `is_const_pat_that_looks_like_binding` matched the pattern snippet against a plain identifier so the `#` in `let r#x = 0` rejected it and the binding lost both the label pointing at `const x` and the `introduce a variable instead` suggestion. strip a leading `r#` before the check and render the const name with `to_ident_string` in the label so a keyword name prints as `r#fn`. fixes rust-lang#162949 r? @oli-obk
add `feature(field_projections)` fixme see the added fixme :> r? types
…r=oli-obk Clean up diagnostic hashing `DiagInner` impls `PartialEq` and `Hash`, as you'd expect for storing it in a hash table. But there's a couple of strange things. - We only store the hash value of the `DiagInner` to do deduplication, not the `DiagInner` itself, which means the `PartialEq` impl is unused. - The `Hash` impl only considers some of the fields. Some of the ignored fields are clearly deliberate (there are comments) but for some it is unclear if it is deliberate. This commit: - Removes the unused `PartialEq` impl. - Inlines and removes `keys` now that it's not needed for `PartialEq`. - Uses struct deconstruction to ensure no fields can be accidentally ignored. I have preserved existing behaviour by assuming that all the ignored fields are supposed to be ignored. - Renames `hash` as an inherent method `dedup_hash` to indicate that it's not a typical hash function, and simplifies it to just return `Hash128` instead of being generic. - Replaces the unnecessary `collect` on `args` with `as_slice`. - Improves the comment on `emitted_diagnostics`. r? @oli-obk
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 22, 2026
Rollup of 9 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-gnu-llvm-21-3 try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu
Contributor
|
☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts by rebasing. This pull request was unapproved. |
Contributor
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.
Successful merges:
Constfromrustc_middletorustc_type_ir#162628 (MoveConstfromrustc_middletorustc_type_ir)feature(field_projections)fixme #163118 (addfeature(field_projections)fixme)Warning
This rollup conflicts with pending auto build #162499 and may need to be recreated if the pending build succeeds.
r? @ghost
Create a similar rollup