Repository navigation
Rollup of 14 pull requests - #165392
Closed
JonathanBrouwer wants to merge 42 commits into
Closed
Rollup of 14 pull requests#165392JonathanBrouwer wants to merge 42 commits into
JonathanBrouwer wants to merge 42 commits into
Conversation
OpenBSD added getexecpath(3) to libc, which returns an already-canonicalized executable path directly. Replace the sysctl(KERN_PROC_ARGV)-based implementation. This was the last user of div_exact in std, so drop the exact_div feature gate.
…poll impl instead of the desugared creator function.
It is already rejected on such functions, and keeping it only produced a redundant 'incompatible with #[cold]' error.
…being allowed Upstream no longer rejects the combination, so replace the UI test expecting that error with a codegen test checking that the body coroutine still inherits the target features.
…cdylib test: - Add `sys::thread_local::guard::aix` using `__pt_atexit_np` to run main thread TLS destructors on process exit on AIX. - Update `dynamic-loading-cdylib` to use member archive syntax (`RTLD_MEMBER`) for `dlopen` on AIX. - Replace the mode array in `dynamic-loading-cdylib` with a `COMMAND_ARGS` constant that selects `load_only` for musl and AIX because `dlclose` does not invoke TLS destructors on those platforms.
A comment against PR 151817 mentioned that the test file added in this PR kept causing "arbitrary" test file changes. This is because one line of the expanded output sits *just* at 78 columns, which is the pretty-printer's margin. Adding or removing a symbol shifts every index after it, and when one of those gains or loses a digit, the wrapping moves. We cannot use `normalize-stdout` as the layout is decided before normalization runs. We fix this by avoiding a strict golden comparison, and instead using a regex to directly test that the expected syntax contexts exist in the expanded output.
* Add regression test against rigidity assertion * Make non-rigid types equal to one another on error reporting * Bless errors after rigid treatment change * Remove previously useful crash test! * Add suggested comments from code review
…ttr, r=saethlin
Make inline attributes apply to the generated `poll` in async fn
This PR adds lowering code (similar to how track_caller forwarding works) to `async fn` items and `async ||` closures such that any inline attributes put on them are inherited by the generated coroutine (corresponding to the `poll()` implementation) and are not applied to the outer function. This behavior matches the accepted FCP in the first linked issue.
Code like the following now correctly codegen 3 functions
- `async_fn_test::consumer`
- `async_fn_test::hi::{closure#0}`
- `core::ptr::drop_in_place::<async_fn_test::hi::{closure#0}>`
```rust
#[inline(never)]
pub async fn hi() -> i32 {
1337
}
pub fn consumer(cx: &mut Context<'_>) -> Option<i32> {
let fut = hi();
let pinned = pin!(fut);
match pinned.poll(cx) {
Poll::Ready(value) => Some(value),
Poll::Pending => None,
}
}
```
Fixes rust-lang#129347 and fixes rust-lang#106765.
This has already been FCP'ed here: rust-lang#129347
[perf] Reuse CanonicalVarKinds if no new variables were added Have seen a perf improvement locally. The idea is to reuse the output of `mk_canonical_var_kinds` if `self.state.var_kinds` is unchanged
…=lcnr Avoid building a region map when erasing bound regions In `instantiate_bound_regions_with_erased`, a closure always returns `self.lifetimes.re_erased`, so cache map that `instantiate_bound_regions` creates is unnecessary here. https://github.com/rust-lang/rust/blob/09026e0fcc8e3c31697db6ce158d8ff8b7df52d0/compiler/rustc_middle/src/ty/fold.rs#L64-L78
…hnTitor std: Use getexecpath() for current_exe() on OpenBSD OpenBSD added getexecpath(3) to libc, which returns an already-canonicalized executable path directly. Replace the sysctl(KERN_PROC_ARGV)-based implementation. This was the last user of div_exact in std, so drop the exact_div feature gate.
offload: pass the linked device image to the host pass Closes rust-lang#164057 Follow-up to: rust-lang#164455 The host pass now takes the linked device output (`<crate>.ptx` for NVPTX, `<crate>.elf` for AMDGPU) instead of the device bitcode. The device crate must now be built as a cdylib. rustc only passes --export-symbol to llvm-bitcode-linker for cdylibs, so a bin would lose its kernels to internalization. I had to add [lib] in Cargo.toml ```toml [lib] name = "sample_offload" path = "src/main.rs" crate-type = ["cdylib"] ``` Without it, the runtime fails at startup ``` PluginInterface error: Failure to init kernel: "requested object was not found in the binary image" error in cuModuleGetFunction('_RNvC14sample_offload6kernel'): named symbol not found omptarget error: Failed to load kernel _RNvC14sample_offload6kernel ``` I’m not sure whether bin device crates should export their kernels too, so I left the linker untouched for now. The second commit fixes another runtime error without `--emit=llvm-bc`/`llvm-ir`. (my understanding is that we should not have to set these after this PR, because no device.bc anymore) The “already wrapped” check in handle_offload relied on a value name, which LLVM drops unless --emit=llvm-bc/llvm-ir is given, so the kernel got wrapped twice. I verified on UofT nvidia gpunode (amdgpunodes was not available for my account). r? ZuseZ4
…r=GuillaumeGomez Reenable some cg_gcc tests that were disabled
…rtdev Don't use `llvm_type` as the type of `static`s. This PR replaces the two uses of `llvm_type` as the type of `static`s - only the size of the static matters, so `cx.type_array(cx.type_i8(), layout.size)` is sufficient. As `static`s have to be redefined if the initialiser type is not the same as the existing type. using an LLVM `i8` array here is more optimal as it means the static type already matches the initializer in cases where the initializer is just plain bytes. r? @folkertdev
Replace `builtin #` with `k#` Part of rust-lang#153839. Also renames internal feature `builtin_syntax` to `internal_syntax` (without tombstoning) and keeps/reuses tracking issue rust-lang#110680 (whose contents are going to get updated post merge). ~~Blocked on rust-lang#161775 getting picked up by stage0 rustfmt~~ (happened in PR rust-lang#163483). <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
… r=fmease Avoid oscillating line wrapping due to symbol indices A comment against PR rust-lang#151817 mentioned that the test file added in this PR kept causing "arbitrary" test file changes. This is because one line of the expanded output sits *just* at 78 columns, which is the pretty-printer's margin. Adding or removing a symbol shifts every index after it, and when one of those gains or loses a digit, the wrapping moves. We cannot use `normalize-stdout` as the layout is decided before normalization runs. We fix this by avoiding a strict golden comparison, and instead using a regex to directly test that the expected syntax contexts exist in the expanded output. **LLM disclosure**: I used an LLM to help me understand the problem and how the regex would look, which the LLM then actioned. I reviewed the diff and the commit (along with the message) was performed by hand with me (with the LLM checking the content of the commit message, but the commit message was, indeed, written by a human).
…mease Use `MalformedLintAttributeInput` in more places This makes the diagnostics prettier :3
…ic-loading-cdylib, r=workingjubilee AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test Fix dynamic loading on AIX so it can be properly tested. - Add `sys::thread_local::guard::aix` using `__pt_atexit_np` to run main thread TLS destructors on process exit on AIX. - Update `dynamic-loading-cdylib` to use member archive syntax (`RTLD_MEMBER`) for `dlopen` on AIX. - Replace the mode array in `dynamic-loading-cdylib` with a `TEST_MODE` constant that selects `load_only` for musl and AIX because `dlclose` does not invoke TLS destructors on those platforms.
Fix rigidity assertion ICE Closes rust-lang#158773. The ICE was caused by non-rigid types reaching given depth on the code that disallowed them. We tried normalization first, according to @adwinwhite guidance, but it didn't work because the type could not be normalized at that point. What worked was preventing the non-rigid types reaching the assertion by treating non-rigid types equal to anything on an upper level. This fixed ICE and changed some diagnostics. The commits show all history: regression test, fix, and test changes. r? @adwinwhite
…ngjubilee Remove `AbiAlign` The first commit removes the final use of `AbiAlign` (as a field of `LayoutData`), and the second commit removes `AbiAlign` itself. r? @workingjubilee
… r=ShoyuVanilla Refactorings in preparation for the move trait r? project-trait-system-refactor This does a couple of innocent refactorings that are necessary *both* for Forget and Move. By merging it, both the `Move` trait pr (rust-lang#161457) and work on the Forget trait can continue without conflicts, and when reviewing them, these refactorings don't need to be considered again. > [!NOTE] > I've not used an LLM for any part of this PR, or any other PR I make. This includes any related work like research.
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:
pollin async fn #149245 (Make inline attributes apply to the generatedpollin async fn)llvm_typeas the type ofstatics. #165371 (Don't usellvm_typeas the type ofstatics.)builtin #withk##162232 (Replacebuiltin #withk#)MalformedLintAttributeInputin more places #165029 (UseMalformedLintAttributeInputin more places)AbiAlign#165354 (RemoveAbiAlign)r? @ghost
Create a similar rollup