-
Notifications
You must be signed in to change notification settings - Fork 245
Rustc pull update #1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Rustc pull update #1015
+57
−10
Conversation
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
add a scope for `if let` guard temporaries and bindings This fixes my concern with `if let` guard drop order, namely that the guard's bindings and temporaries were being dropped after their arm's pattern's bindings, instead of before (rust-lang/rust#141295 (comment)). The guard's bindings and temporaries now live in a new scope, which extends until (but not past) the end of the arm, guaranteeing they're dropped before the arm's pattern's bindings. This only introduces a new scope for match arms with guards. Perf results (rust-lang/rust#143376 (comment)) seemed to indicate there wasn't a significant hit to introduce a new scope on all match arms, but guard patterns (rust-lang/rust#129967) will likely benefit from only adding new scopes when necessary (with some patterns requiring multiple nested scopes). Tracking issue for `if_let_guard`: rust-lang/rust#51114 Tests are adapted from examples by `@traviscross,` `@est31,` and myself on rust-lang/rust#141295.
Implement `stability_implications` without a visitor. Since rust-lang/rust#143845, the `Annotator` visitor was a no-op when the crate is not staged_api. This PR avoids using a visitor altogether, making `stability_implications` truly a no-op in most cases.
const-eval: full support for pointer fragments This fixes rust-lang/const-eval#72 and makes `swap_nonoverlapping` fully work in const-eval by enhancing per-byte provenance tracking with tracking of *which* of the bytes of the pointer this one is. Later, if we see all the same bytes in the exact same order, we can treat it like a whole pointer again without ever risking a leak of the data bytes (that encode the offset into the allocation). This lifts the limitation that was discussed quite a bit in rust-lang/rust#137280. For a concrete piece of code that used to fail and now works properly consider this example doing a byte-for-byte memcpy in const without using intrinsics: ```rust use std::{mem::{self, MaybeUninit}, ptr}; type Byte = MaybeUninit<u8>; const unsafe fn memcpy(dst: *mut Byte, src: *const Byte, n: usize) { let mut i = 0; while i < n { *dst.add(i) = *src.add(i); i += 1; } } const _MEMCPY: () = unsafe { let ptr = &42; let mut ptr2 = ptr::null::<i32>(); // Copy from ptr to ptr2. memcpy(&mut ptr2 as *mut _ as *mut _, &ptr as *const _ as *const _, mem::size_of::<&i32>()); assert!(*ptr2 == 42); }; ``` What makes this code tricky is that pointers are "opaque blobs" in const-eval, we cannot just let people look at the individual bytes since *we don't know what those bytes look like* -- that depends on the absolute address the pointed-to object will be placed at. The code above "breaks apart" a pointer into individual bytes, and then puts them back together in the same order elsewhere. This PR implements the logic to properly track how those individual bytes relate to the original pointer, and to recognize when they are in the right order again. We still reject constants where the final value contains a not-fully-put-together pointer: I have no idea how one could construct an LLVM global where one byte is defined as "the 3rd byte of a pointer to that other global over there" -- and even if LLVM supports this somehow, we can leave implementing that to a future PR. It seems unlikely to me anyone would even want this, but who knows.^^ This also changes the behavior of Miri, by tracking the order of bytes with provenance and only considering a pointer to have valid provenance if all bytes are in the original order again. This is related to rust-lang/unsafe-code-guidelines#558. It means one cannot implement XOR linked lists with strict provenance any more, which is however only of theoretical interest. Practically I am curious if anyone will show up with any code that Miri now complains about - that would be interesting data. Cc `@rust-lang/opsem`
… r=petrochenkov Sometimes skip over tokens in `parse_token_tree`. r? `@petrochenkov`
Extend the <target>.optimized-compiler-builtins bootstrap option to accept a path to a prebuilt compiler-rt builtins library, and update compiler-builtins to enable optimized builtins without building compiler-rt builtins.
…iltins, r=Kobzol,tgross35 Allow linking a prebuilt optimized compiler-rt builtins library Extend the <target>.optimized-compiler-builtins bootstrap option to accept a path to a prebuilt compiler-rt builtins library, and update compiler-builtins to enable optimized builtins without building compiler-rt builtins.
Implement some more checks in `ptr_guaranteed_cmp`. * Pointers with different residues modulo their allocations' least common alignment are never equal. * Pointers to the same static allocation are equal if and only if they have the same offset. * Pointers to different non-zero-sized static allocations are unequal if both point within their allocation, and not on opposite ends. Tracking issue for `const_raw_ptr_comparison`: <rust-lang/rust#53020> This should not affect `is_null`, the only usage of this intrinsic on stable. Closes rust-lang/rust#144584
…145529, r=GuillaumeGomez make rustdoc::invalid_html_tags more robust best reviewed a commit at a time. I kept finding more edge case so I ended up having to make quite significant changes to the parser in order to make it preserve state across events and handle multiline attributes correctly. fixes rust-lang/rust#145529
test(rustfmt): Verify frontmatter is preserved This is to prove that the frontmatter is preserved. The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang/rust#145617). While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time. Tracking issue: rust-lang/rust#136889
Fix some minor issues in comments Fix some minor issues in comments
…henkov Handle unwinding fatal errors in codegen workers Also directly unwind on fatal errors at the point they are emitted inside the codegen backends. Fixes the coordinator ICE of rust-lang/rust#132240, rust-lang/rust#135075 and rust-lang/rust#145800.
Wait for DPkg frontend lock when trying to remove packages Hopefully this helps with [#t-infra > pr-check-1 fails on "free up disk space"](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/pr-check-1.20fails.20on.20.22free.20up.20disk.20space.22/with/535794424). As suggested by riking in [#t-infra > pr-check-1 fails on "free up disk space" @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/pr-check-1.20fails.20on.20.22free.20up.20disk.20space.22/near/535791579), thanks! r? infra-ci
…by789 compiletest: if a compiler fails, show its output Before, when working on something like a `rustdoc-js` test, if you made a syntax error in a rust file, you would not get that error output unless you ran with `--verbose`, which would also cause an enormous amount of other output to be printed as well. This can also lead to frustration in new contributors who don't think to run with `--verbose`. Now, if rustc or rustdoc is run by compiletest and produces an non-zero exit code, its output will be printed.
Make `x test distcheck` self-contained Before, the checked components were extracted under the checked out source root, which caused us to test some weird combination of tarball + checkout sources/aritfacts/configuration. Now `x test distcheck` works with an external temporary directory instead, which should make it self-contained. I also moved some config from the Dockerfile to the test itself, and fixed an issue in tidy that caused `x test tidy` to fail on tarball sources. I also removed `.args(&builder.config.configure_args)`, because it was passing all kinds of crap from the CI config to the distcheck step, which was making it less reproducible. Fixes: rust-lang/rust#145183 r? ```@jieyouxu``` try-job: x86_64-gnu-distcheck
Don't show warnings from xcrun with -Zverbose-internals These kinds of warnings can make our test suite fail spuriously, so if we want them, we'll need a different flag. This was introduced in rust-lang/rust#131477. Fixes rust-lang/rust#145543. r? apiraino ```@bors``` rollup
Update books ## rust-lang/nomicon 1 commits in 3ff384320598bbe8d8cfe5cb8f18f78a3a3e6b15..57ed4473660565d9357fcae176b358d7e8724ebf 2025-08-18 17:31:07 UTC to 2025-08-18 17:31:07 UTC - Fix unknown field `author` error when building the book (rust-lang/nomicon#500) ## rust-lang/reference 11 commits in 59b8af811886313577615c2cf0e045f01faed88b..89f67b3c1b904cbcd9ed55e443d6fc67c8ca2769 2025-08-22 07:16:52 UTC to 2025-08-14 18:42:19 UTC - Update `instruction_set` to use the attribute template (rust-lang/reference#1912) - Update `debugger_visualizer` to use the attribute template (rust-lang/reference#1922) - Update `collapse_debuginfo` to use the attribute template (rust-lang/reference#1923) - Clarify operand evaluation order in compound assignment with primitiv… (rust-lang/reference#1941) - Switch to using native mdbook fragment redirects (rust-lang/reference#1965) - Fix traits implemented for function items (rust-lang/reference#1969) - Clarify that safe extern items do not require unsafe (rust-lang/reference#1970) - Update `type_length_limit` to use the attribute template (rust-lang/reference#1917) - Add missing rule identifier for const outer generics (rust-lang/reference#1962) - Fix indentation of static path restriction text (rust-lang/reference#1961) - Add doc for `sse4a` and `tbm` (rust-lang/reference#1949) ## rust-lang/rust-by-example 2 commits in adc1f3b9012ad3255eea2054ca30596a953d053d..ad27f82c18464525c761a4a8db2e01785da59e1f 2025-08-20 23:50:16 UTC to 2025-08-13 21:41:46 UTC - Support building books using mdbook in main (v0.5.x) (rust-lang/rust-by-example#1952) - Improve the hints in `fmt` (1.2.3. Formatting); mention type casting (rust-lang/rust-by-example#1951)
Update wasm-component-ld dependency Keeping it up-to-date with the latest changes/features.
Rollup of 12 pull requests Successful merges: - rust-lang/rust#143689 (Allow linking a prebuilt optimized compiler-rt builtins library) - rust-lang/rust#144885 (Implement some more checks in `ptr_guaranteed_cmp`. ) - rust-lang/rust#145535 (make rustdoc::invalid_html_tags more robust) - rust-lang/rust#145766 (test(rustfmt): Verify frontmatter is preserved) - rust-lang/rust#145811 (Fix some minor issues in comments) - rust-lang/rust#145814 (Handle unwinding fatal errors in codegen workers) - rust-lang/rust#145815 (Wait for DPkg frontend lock when trying to remove packages) - rust-lang/rust#145821 (compiletest: if a compiler fails, show its output) - rust-lang/rust#145845 (Make `x test distcheck` self-contained) - rust-lang/rust#145847 (Don't show warnings from xcrun with -Zverbose-internals) - rust-lang/rust#145856 (Update books) - rust-lang/rust#145858 (Update wasm-component-ld dependency) r? `@ghost` `@rustbot` modify labels: rollup
Remove unnecessary stage2 host builds from cross-compiled dist builders This is a repeated regression (rust-lang/rust#138004, rust-lang/rust#138123) that was reintroduced in rust-lang/rust#145472. I thought that we have a test for it, but alas, the "correct" test required `--disable-docs`. I added the test in this PR, and re-added the `dist::Std` build optimization that solves this. r? `@jieyouxu`
Access less HIR attributes from typeck Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions. This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: rust-lang/rust#144841 (comment) Fixes rust-lang/rust#124352
Region inference: Use outlives-static constraints in constraint search Revise the extra `r: 'static` constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive `'static`. This cosmetically changes the output of two UI tests. I blessed them i separate commits with separate motivations, but that can of course be squashed as desired. We probably want that. The PR was extracted out of rust-lang/rust#130227 and consists of one-third of its functional payload. r? lcnr
rustdoc: a few micro-optimizations targeted at build_impl Unsure if these will be anything substantial, but the first one at least should git rid of quite a few branches, second one unsure if it's worth it. r? `@GuillaumeGomez`
Use captures(address) instead of captures(none) for indirect args While provenance cannot be captured through these arguments, the address / object identity can. Fixes rust-lang/rust#137668. r? `@ghost`
This updates the rust-version file to d36f964125163c2e698de5559efefb8217b8b7f0.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: d36f964125163c2e698de5559efefb8217b8b7f0 Filtered ref: 9246173 This merge was created using https://github.com/rust-lang/josh-sync.
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.
Latest update from rustc.