about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-10-28Unify variant struct fields margins with struct fieldsGuillaume Gomez-1/+1
2024-10-28Auto merge of #132251 - jieyouxu:rollup-mtv9mpd, r=jieyouxubors-337/+572
Rollup of 7 pull requests Successful merges: - #131633 (error on alignments greater than `isize::MAX`) - #132086 (Tweak E0277 highlighting and "long type" path printing) - #132220 (Add GUI regression test for doc struct fields margins) - #132225 (Dynamically link run-make support) - #132227 (Pass constness with span into lower_poly_trait_ref) - #132242 (Support `char::is_digit` in const contexts.) - #132243 (Remove `ObligationCause::span()` method) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-28Rollup merge of #132243 - compiler-errors:no-span, r=jieyouxu许杰友 Jieyou Xu (Joe)-46/+38
Remove `ObligationCause::span()` method I think it's an incredibly confusing footgun to expose both `obligation_cause.span` and `obligation_cause.span()`. Especially because `ObligationCause::span()` (the method) seems to just be hacking around a single quirk in the way we set up obligation causes for match arms. First commit removes the need for that hack, with only one diagnostic span changing (but IMO not really getting worse -- I'd argue that it was already confusing).
2024-10-28Rollup merge of #132242 - ultrabear:const_is_digit, r=scottmcm许杰友 Jieyou Xu (Joe)-1/+2
Support `char::is_digit` in const contexts. This PR implements [`feature(const_char_is_digit)` #132241](https://github.com/rust-lang/rust/issues/132241)
2024-10-28Rollup merge of #132227 - compiler-errors:better-const-span, r=Nadrieril许杰友 Jieyou Xu (Joe)-254/+241
Pass constness with span into lower_poly_trait_ref Gives us a span to point at for ~const/const on non-const traits. Split from #132209. r? Nadrieril
2024-10-28Rollup merge of #132225 - clubby789:run-make-dynamic, r=jieyouxu许杰友 Jieyou Xu (Joe)-0/+4
Dynamically link run-make support Fixes #131810 r? `@jieyouxu`
2024-10-28Rollup merge of #132220 - GuillaumeGomez:gui-test-struct-fields-margins, ↵许杰友 Jieyou Xu (Joe)-10/+42
r=notriddle Add GUI regression test for doc struct fields margins Fixes #131402. r? `@notriddle`
2024-10-28Rollup merge of #132086 - estebank:long-types, r=jieyouxu许杰友 Jieyou Xu (Joe)-25/+145
Tweak E0277 highlighting and "long type" path printing Partially address #132013. ![Output from this PR for the repro case in #132013](https://github.com/user-attachments/assets/a073ba37-4adc-411e-81f7-6cb9a945ce3d)
2024-10-28Rollup merge of #131633 - asquared31415:align_isize_max, r=jieyouxu许杰友 Jieyou Xu (Joe)-1/+100
error on alignments greater than `isize::MAX` Fixes #131122 On zulip someone had a concern that it was legal to create a type with alignment `isize::MAX + 1`, but I do not believe this should be allowed for `repr(align)`, as `repr(align)` also increases the *size* of the type, and that would be larger than the maximum allowed size of objects. (cc `@workingjubilee` #131276)
2024-10-28Error on alignments greater than `isize::MAX`asquared31415-1/+100
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
2024-10-28Auto merge of #132200 - Mark-Simulacrum:strengthen-cross-lang, r=RalfJungbors-2/+10
Make clearer that guarantees in ABI compatibility are for Rust only cc https://github.com/rust-lang/rust/pull/132136#issuecomment-2439737631 -- it looks like we already had a note that I missed in my initial look here, but this goes further to emphasize the guarantees, including uplifting it to the top of the general documentation. r? `@RalfJung`
2024-10-27Remove ObligationCause::span() methodMichael Goulet-26/+21
2024-10-27Stop using the whole match expr span for an arm's obligation spanMichael Goulet-21/+18
2024-10-27Support `char::is_digit` in const contextsultrabear-1/+2
2024-10-27Auto merge of #132237 - matthiaskrgr:rollup-ulogwtd, r=matthiaskrgrbors-616/+802
Rollup of 5 pull requests Successful merges: - #132043 (Simplify param handling in `resolve_bound_vars`) - #132214 (Cleanup: Move an impl-Trait check from AST validation to AST lowering) - #132221 (Clean up some comments on lint implementation) - #132228 (Revert "ci update freebsd version proposal, freebsd 12 being eol.") - #132234 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-27Rollup merge of #132234 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-299/+612
Miri subtree update r? `@ghost`
2024-10-27Rollup merge of #132228 - devnexen:ci_update_fbsd_revert, r=workingjubileeMatthias Krüger-19/+19
Revert "ci update freebsd version proposal, freebsd 12 being eol." This reverts commit 1239c81c145d2bfb96f32856f377cd741d5c7256. Fix GH-132185 revert for now until early next year/FreeBSD 13.3 becomes EOL.
2024-10-27Rollup merge of #132221 - ehuss:lint-docs, r=compiler-errorsMatthias Krüger-66/+18
Clean up some comments on lint implementation This updates some doc comments that have gotten very out of date. Some of these macros were removed or renamed in #57726 and #104863 and others. Manual emitting of lints was significantly reworked when the `Diagnostic` infrastructure was added. Rather than try to replicate the high-level documentation, I added pointers to the rustc-dev-guide. I linkified some types so that if they are renamed/removed without updating the docs, it will break CI.
2024-10-27Rollup merge of #132214 - fmease:mv-impl-trait-val-paths, r=compiler-errorsMatthias Krüger-153/+78
Cleanup: Move an impl-Trait check from AST validation to AST lowering Namely the one that rejects `impl Trait` in qself types and non-final path segments. There's no good reason to perform this during AST validation. We have better infrastructure in place in the AST lowerer (`ImplTraitContext`). This shaves off a lot of code. We now lower `impl Trait` in bad positions to `{type error}` which allows us to remove a special case from HIR ty lowering. Coincidentally fixes #126725. Well, it only *masks* it by passing `{type error}` to HIR analysis instead of a "bad" opaque. I was able to find a new reproducer for it. See the issue.
2024-10-27Rollup merge of #132043 - compiler-errors:simplify-rbv, r=cjgillotMatthias Krüger-79/+75
Simplify param handling in `resolve_bound_vars` I always found the flow of the `ResolvedArg` constructors to be a bit confusing; turns out they're also kinda redundantly passing around their data, too. Also, deduplicate some code handling early-bound var to late-bound var conversion between return type notation's two styles: `where <T as Trait>::method(..): Bound` and `where T: Trait<method(..): Bound>`.
2024-10-27Auto merge of #131284 - ↵bors-234/+252
dingxiangfei2009:rename-smart-ptr-to-coerce-referent, r=compiler-errors Rename macro `SmartPointer` to `CoercePointee` As per resolution #129104 we will rename the macro to better reflect the technical specification of the feature and clarify the communication. - `SmartPointer` is renamed to `CoerceReferent` - `#[pointee]` attribute is renamed to `#[referent]` - `#![feature(derive_smart_pointer)]` gate is renamed to `#![feature(derive_coerce_referent)]`. - Any mention of `SmartPointer` in the file names are renamed accordingly. r? `@compiler-errors` cc `@nikomatsakis` `@Darksonn`
2024-10-27Revert "ci update freebsd version proposal, freebsd 12 being eol."David Carlier-19/+19
This reverts commit 1239c81c145d2bfb96f32856f377cd741d5c7256. Fix GH-132185 revert for now until early next year/FreeBSD 13.3 becomes EOL.
2024-10-27Dynamically link run-make supportclubby789-0/+4
2024-10-27Auto merge of #132215 - onur-ozkan:bootstrap-git, r=Kobzolbors-28/+6
simplify force-recompile logic for "library" It’s kind of self-explanatory when looking at it commit by commit.
2024-10-27Clean up some comments on lint implementationEric Huss-66/+18
2024-10-27Auto merge of #132191 - Urgau:midpoint_signed_towards_zero, r=dtolnaybors-40/+122
Round negative signed integer towards zero in `iN::midpoint` This PR changes the implementation of `iN::midpoint` (the signed variants) to round negative signed integers **towards zero** *instead* of negative infinity as is currently the case. This is done so that the obvious expectations[^1] of `midpoint(a, b) == midpoint(b, a)` and `midpoint(-a, -b) == -midpoint(a, b)` are true, which makes the even more obvious implementation `(a + b) / 2` always true. The unsigned variants `uN::midpoint` (which are being [FCP-ed](https://github.com/rust-lang/rust/pull/131784#issuecomment-2417188117)) already rounds towards zero, so there is no consistency issue. cc `@scottmcm` r? `@dtolnay` [^1]: https://github.com/rust-lang/rust/issues/110840#issuecomment-2336753931
2024-10-27Add GUI regression test for doc struct fields marginsGuillaume Gomez-10/+42
2024-10-27Auto merge of #132091 - Zalathar:graph-loops, r=saethlinbors-63/+85
coverage: Don't rely on the custom traversal to find enclosing loops This opens up the possibility of modifying or removing the custom graph traversal used in coverage counter creation, without losing access to the heuristics that care about a node's enclosing loops. Actually changing the traversal is left for future work, because this PR on its own doesn't change the emitted coverage mappings at all.
2024-10-27Move an impl-Trait check from AST validation to AST loweringLeón Orell Valerian Liehr-153/+78
2024-10-27Auto merge of #132213 - workingjubilee:rollup-tg1g3l5, r=workingjubileebors-131/+136
Rollup of 4 pull requests Successful merges: - #132123 (allow type-based search on foreign functions) - #132183 (Fix code HTML items making big blocks if too long) - #132192 (expand: Stop using artificial `ast::Item` for macros loaded from metadata) - #132205 (docs: Correctly link riscv32e from platform-support.md) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-27simplify force-recompile logic for "library"onur-ozkan-19/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-27don't use absolute paths on `git(Some(self.src))`onur-ozkan-10/+3
It will run at the project root, so resolving absolute/top-level paths is unnecessary. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-26Rollup merge of #132205 - workingjubilee:rv32e-platform-docs-mislinked, ↵Jubilee-4/+5
r=tgross35 docs: Correctly link riscv32e from platform-support.md Correctly link the riscv32e platform support page. Just a mistake during the iteration of https://github.com/rust-lang/rust/pull/130555 that was missed in review. Presumably the rv32e-none and rv32i-none pages eventually should get merged, but this is a relatively recent addition to the ISA definition so it is not clear the current RISCV Embedded group has the expertise on-hand... nor did it have their consent.
2024-10-26Rollup merge of #132192 - petrochenkov:macfa, r=compiler-errorsJubilee-120/+94
expand: Stop using artificial `ast::Item` for macros loaded from metadata You don't need a full `Item` for that, and not using a piece of AST helps with https://github.com/rust-lang/rust/pull/131808.
2024-10-26Rollup merge of #132183 - GuillaumeGomez:code-in-docblock, r=notriddleJubilee-6/+20
Fix code HTML items making big blocks if too long Encountered this bug randomly where `code` item in docblocks would look like this: ![Screenshot from 2024-10-26 15-44-46](https://github.com/user-attachments/assets/a9c1df9d-5007-49eb-a7dd-a2c381b2511e) With this fix it looks like this: ![image](https://github.com/user-attachments/assets/ea918595-5434-4781-b68c-6abd38689365) r? ``@notriddle``
2024-10-26Rollup merge of #132123 - lolbinarycat:rustdoc-search-foreign-func, r=notriddleJubilee-1/+17
allow type-based search on foreign functions fixes https://github.com/rust-lang/rust/issues/131804 preferably will be merged after #129708, but that may take a while to be approved due to being a new feature, whereas this is definitely a bug, and should be fixed.
2024-10-27Auto merge of #132167 - Zalathar:llvm-wrappers, r=jieyouxubors-230/+322
Replace some LLVMRust wrappers with calls to the LLVM C API This PR removes the LLVMRust wrapper functions for getting/setting linkage and visibility, and replaces them with direct calls to the corresponding functions in LLVM's C API. To make this convenient and sound, two pieces of supporting code have also been added: - A simple proc-macro that derives `TryFrom<u32>` for fieldless enums - A wrapper type for C enum values returned by LLVM functions, to ensure soundness if LLVM returns an enum value we don't know about In a few places, the use of safe wrapper functions means that an `unsafe` block is no longer needed, so the affected code has changed its indentation level.
2024-10-27Auto merge of #131900 - mrkajetanp:target-feature-pauth-lr, r=Amanieubors-2/+5
rustc_target: Add pauth-lr aarch64 target feature Add the pauth-lr target feature, corresponding to aarch64 FEAT_PAuth_LR. This feature has been added in LLVM 19. It is currently not supported by the Linux hwcap and so we cannot add runtime feature detection for it at this time. r? `@Amanieu`
2024-10-27Use LLVM-C APIs for getting/setting visibilityZalathar-45/+8
2024-10-26docs: Correctly link riscv32e from platform-support.mdJubilee Young-4/+5
2024-10-26Auto merge of #131715 - tgross35:add-const_sockaddr_setters, r=Amanieubors-16/+25
Add an unstable `const_sockaddr_setters` feature Unstably add `const` to the `sockaddr_setters` methods. Included API: ```rust // core::net impl SocketAddr { pub const fn set_ip(&mut self, new_ip: IpAddr); pub const fn set_port(&mut self, new_port: u16); } impl SocketAddrV4 { pub const fn set_ip(&mut self, new_ip: Ipv4Addr); pub const fn set_port(&mut self, new_port: u16); } impl SocketAddrV6 { pub const fn set_ip(&mut self, new_ip: Ipv6Addr); pub const fn set_port(&mut self, new_port: u16); } ``` Tracking issue: <https://github.com/rust-lang/rust/issues/131714>
2024-10-26Make clearer that guarantees in ABI compatibility are for Rust onlyMark Rousskov-2/+10
2024-10-26Pass constness with span into lower_poly_trait_refMichael Goulet-254/+241
2024-10-26Add test for all midpoint expectationsUrgau-0/+55
2024-10-26expand: Stop using artificial `ast::Item` for macros loaded from metadataVadim Petrochenkov-120/+94
2024-10-26Auto merge of #132190 - matthiaskrgr:rollup-rsocfiz, r=matthiaskrgrbors-2/+59
Rollup of 3 pull requests Successful merges: - #131875 (Add WASM | WASI | Emscripten groups to triagebot.toml) - #132019 (Document `PartialEq` impl for `OnceLock`) - #132182 (Downgrade `untranslatable_diagnostic` and `diagnostic_outside_of_impl` to `allow`) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-26Update GUI testGuillaume Gomez-4/+6
2024-10-26Round negative signed integer towards zero in `iN::midpoint`Urgau-40/+67
Instead of towards negative infinity as is currently the case. This done so that the obvious expectations of `midpoint(a, b) == midpoint(b, a)` and `midpoint(-a, -b) == -midpoint(a, b)` are true, which makes the even more obvious implementation `(a + b) / 2` true. https://github.com/rust-lang/rust/issues/110840#issuecomment-2336753931
2024-10-26Rollup merge of #132182 - jieyouxu:downgrade-untranslatable, r=compiler-errorsMatthias Krüger-2/+2
Downgrade `untranslatable_diagnostic` and `diagnostic_outside_of_impl` to `allow` Current implementation of translatable diagnostics infrastructure unfortunately causes some friction for compiler contributors. While we don't have a redesign that causes less friction in place, let's downgrade the internal `untranslatable_diagnostic` and `diagnostic_outside_of_impl` lints so we don't indicate to contributors that they *have* to use the current translation infra. I purposefully left `#[allow(untranslatable_diagnostic)]` and `#[allow(diagnostic_outside_of_impl)]` instances untouched because that seems like unnecessary additional churn. See <https://github.com/rust-lang/rust/issues/132181> for context. r? `@davidtwco` (or wg-diagnostics/compiler)
2024-10-26Rollup merge of #132019 - daboross:document-partialeq-oncelock, ↵Matthias Krüger-0/+20
r=Mark-Simulacrum Document `PartialEq` impl for `OnceLock` Adds documentation to `std::sync::OnceLock`'s `PartialEq` implementation: specifies publicly that `OnceLock`s are compared based on their contents, and nothing else. Created in response to, but not directly related to, https://github.com/rust-lang/rust/issues/131959. ## ne This doesn't create and document `PartialEq::ne`. There's precedent for this in [`RefCell`](https://doc.rust-lang.org/std/cell/struct.RefCell.html#impl-PartialEq-for-RefCell%3CT%3E).