about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-14Implement `f{16,32,64,128}::{erf,erfc}`Pavel Grigorenko-0/+280
Also add ```rust // #[unstable(feature = "float_gamma", issue = "99842")] ``` to `gamma`-function-related methods on `f16` & `f128`, as per https://github.com/rust-lang/rust/pull/136324#issuecomment-2626270247
2025-02-12Auto merge of #136897 - workingjubilee:revert-unfcped-stab, r=WaffleLapkinbors-12/+126
Revert "Stabilize `extended_varargs_abi_support`" I cannot find an FCP for this, despite it being a stabilization PR which normally means we do an FCP of some kind? It would seem reasonable for _either_ compiler or lang to have FCPed it? I am thus opening a revert PR, which mostly-cleanly applies, so that we can later actually land this properly with a stability report and FCP. - https://github.com/rust-lang/rust/issues/136896 - https://github.com/rust-lang/rust/pull/116161 - https://github.com/rust-lang/rust/issues/100189
2025-02-12Auto merge of #136905 - matthiaskrgr:rollup-8zwcgta, r=matthiaskrgrbors-556/+738
Rollup of 8 pull requests Successful merges: - #135549 (Document some safety constraints and use more safe wrappers) - #135965 (In "specify type" suggestion, skip type params that are already known) - #136193 (Implement pattern type ffi checks) - #136646 (Add a TyPat in the AST to reuse the generic arg lowering logic) - #136874 (Change the issue number for `likely_unlikely` and `cold_path`) - #136884 (Lower fn items as ZST valtrees and delay a bug) - #136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change) - #136891 (Check sig for errors before checking for unconstrained anonymous lifetime) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-12Rollup merge of #136891 - compiler-errors:unconstrained-anon-lt, r=lqdMatthias Krüger-21/+41
Check sig for errors before checking for unconstrained anonymous lifetime Fixes #136841
2025-02-12Rollup merge of #136885 - RalfJung:linux-android-base-cpu, r=jieyouxuMatthias Krüger-2/+2
i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change As per ``@maurer's`` [comment](https://github.com/rust-lang/rust/issues/136495#issuecomment-2648743078), this shouldn't actually change anything since we anyway add a bunch of extensions that bump things up way beyond Pentium 4. But Pentium 4 is consistent with the other i686 targets and I don't know enough about the exact sequence of CPU generations to be confident with more than this. ;)
2025-02-12Rollup merge of #136884 - compiler-errors:fn-zst, r=BoxyUwUMatthias Krüger-9/+50
Lower fn items as ZST valtrees and delay a bug Lower it as a ZST instead of a const error, which we can handle mostly fine. Delay a bug so we don't accidentally support it tho. r? BoxyUwU Fixes #136855 Fixes #136853 Fixes #136854 Fixes #136337 Only added one test bc that's really the crux of the issue (fn item in array length position).
2025-02-12Rollup merge of #136874 - tgross35:likely-unlikely-tracking, r=jhprattMatthias Krüger-3/+3
Change the issue number for `likely_unlikely` and `cold_path` These currently point to rust-lang/rust#26179, which is nearly a decade old and has a lot of outdated discussion. Move these features to a new tracking issue specifically for the recently added API. New tracking issue: https://github.com/rust-lang/rust/issues/136873
2025-02-12Rollup merge of #136646 - oli-obk:pattern-types-ast, r=BoxyUwUMatthias Krüger-264/+241
Add a TyPat in the AST to reuse the generic arg lowering logic This simplifies ast lowering significantly with little cost to the pattern types parser. Also fixes any problems we've had with generic args (well, pushes any problems onto the `generic_const_exprs` feature gate) follow-up to https://github.com/rust-lang/rust/pull/136284#discussion_r1939292367 r? ``@BoxyUwU``
2025-02-12Rollup merge of #136193 - oli-obk:pattern-type-ffi-checks, r=chenyukangMatthias Krüger-88/+178
Implement pattern type ffi checks Previously we just rejected pattern types outright in FFI, but that was never meant to be a permanent situation. We'll need them supported to use them as the building block for `NonZero` and `NonNull` after all (both of which are FFI safe). best reviewed commit by commit.
2025-02-12Rollup merge of #135965 - estebank:shorten-ty-sugg, r=lcnrMatthias Krüger-22/+113
In "specify type" suggestion, skip type params that are already known When we suggest specifying a type for an expression or pattern, like in a `let` binding, we previously would print the entire type as the type system knew it. We now look at the params that have *no* inference variables, so they are fully known to the type system which means that they don't need to be specified. This helps in suggestions for types that are really long, because we can usually skip most of the type params and make the annotation as short as possible: ``` error[E0282]: type annotations needed for `Result<_, ((..., ..., ..., ...), ..., ..., ...)>` --> $DIR/really-long-type-in-let-binding-without-sufficient-type-info.rs:7:9 | LL | let y = Err(x); | ^ ------ type must be known at this point | help: consider giving `y` an explicit type, where the type for type parameter `T` is specified | LL | let y: Result<T, _> = Err(x); | ++++++++++++++ ``` Fix #135919.
2025-02-12Rollup merge of #135549 - oli-obk:push-tmxtpnrloyqu, r=compiler-errorsMatthias Krüger-147/+110
Document some safety constraints and use more safe wrappers Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
2025-02-12Auto merge of #136074 - compiler-errors:deeply-normalize-next-solver, r=lcnrbors-47/+250
Properly deeply normalize in the next solver Turn deep normalization into a `TypeOp`. In the old solver, just dispatch to the `Normalize` type op, but in the new solver call `deeply_normalize`. I chose to separate it into a different type op b/c some normalization is a no-op in the new solver, so this distinguishes just the normalization we need for correctness. Then use `DeeplyNormalize` in the callsites we used to be using a `CustomTypeOp` (for normalizing known type outlives obligations), and also use it to normalize function args and impl headers in the new solver. Finally, use it to normalize signatures for WF checks in the new solver as well. This addresses https://github.com/rust-lang/trait-system-refactor-initiative/issues/146.
2025-02-11library: amend revert of extended_varargs_abi_support for beta diffJubilee Young-1/+3
And leave a comment on the unusual `cfg_attr` Co-authored-by: waffle <waffle.lapkin@gmail.com>
2025-02-11Revert "Stabilize `extended_varargs_abi_support`"Jubilee Young-12/+124
This reverts commit 685f189b4307435b83d625fea397ef36dff4e955.
2025-02-11Auto merge of #136878 - matthiaskrgr:rollup-opilhjv, r=matthiaskrgrbors-556/+225
Rollup of 8 pull requests Successful merges: - #135285 (it-self → itself, build-system → build system, type-alias → type alias) - #135677 (Small `rustc_resolve` cleanups) - #136239 (show supported register classes in error message) - #136246 (include note on variance and example) - #136354 (Update docs for impl keyword) - #136786 (Remove the deduplicate_blocks pass) - #136833 (compiler: die immediately instead of handling unknown target codegen) - #136847 (Simplify intra-crate qualifiers.) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-11Check sig for errors before checking for unconstrained anonymous lifetimeMichael Goulet-21/+41
2025-02-11Auto merge of #136605 - lsunsi:update-rustc-hash, r=lqdbors-8/+8
chore: update rustc-hash 2.1.0 to 2.1.1 This PR updates the rustc-hash crate to include a palliative fix for #135477. The discussion for this can be found in the issue and on https://github.com/rust-lang/rustc-hash/pull/55. This PR is the output of running `cargo +nightly update rustc-hash@2.1.0`. I ran all tests locally and they all seem to pass, with the exception of `tests/ui/process/nofile-limit.rs` which always fails on my setup. `@steffahn` `@orlp` and `@Noratrieb` all have full context on this, I'm opening the pull request trying to be helpful. I'm not sure if anything else needs to be done, like documentation I'm not aware of or running any special CIs but if I can do anything else please let me know!
2025-02-11i686-linux-android: increase CPU baseline to Pentium 4 (without an actual ↵Ralf Jung-2/+2
change)
2025-02-11Deeply normalize signature in new solverMichael Goulet-9/+129
2025-02-11Deeply normalize in impl headerMichael Goulet-1/+29
2025-02-11Deeply normalize args for implied boundsMichael Goulet-1/+23
2025-02-11Make DeeplyNormalize a real type opMichael Goulet-37/+70
2025-02-11Lower fn items as ZST valtrees and delay a bugMichael Goulet-9/+50
2025-02-11Auto merge of #136586 - Kobzol:lto-rustdoc-fix-stage-1, r=onur-ozkanbors-11/+17
Only apply LTO to rustdoc at stage 2 It doesn't make much sense at stage 1, and it was broken anyway. This was implemented in https://github.com/rust-lang/rust/pull/135832. The issue with LTO and stage 1 rustdoc was reported [here](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/x.20test.20with.20lto.20.3D.20.22thin.22.20fails.20to.20build.20rustdoc.3F). r? `@onur-ozkan`
2025-02-11Rollup merge of #136847 - nnethercote:simplify-intra-crate-quals, r=oli-obkMatthias Krüger-51/+53
Simplify intra-crate qualifiers. The following is a weird pattern for a file within `rustc_middle`: ``` use rustc_middle::aaa; use crate::bbb; ``` More sensible and standard would be this: ``` use crate::{aaa, bbb}; ``` I.e. we generally prefer using `crate::` to using a crate's own name. (Exceptions are things like in macros where `crate::` doesn't work because the macro is used in multiple crates.) This commit fixes a bunch of these weird qualifiers. r? `@jieyouxu`
2025-02-11Rollup merge of #136833 - workingjubilee:let-the-impossible-be-impossible, ↵Matthias Krüger-64/+8
r=compiler-errors compiler: die immediately instead of handling unknown target codegen We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die. This allows cleaning up our "error-handling" spread across 5 crates.
2025-02-11Rollup merge of #136786 - compiler-errors:de-de-duplicate-blocks, r=oli-obkMatthias Krüger-414/+0
Remove the deduplicate_blocks pass I don't think this pass does anything. It's a lot of complexity for 🤷 amount of benefit. r? oli-obk
2025-02-11Rollup merge of #136354 - hkBst:patch-34, r=ibraheemdevMatthias Krüger-7/+34
Update docs for impl keyword This started as a fix for #79878, but also introduces some structure (headings), and elaborates a tiny bit on impl Trait syntax.
2025-02-11Rollup merge of #136246 - hkBst:patch-29, r=ibraheemdevMatthias Krüger-2/+96
include note on variance and example Fixes #89150
2025-02-11Rollup merge of #136239 - folkertdev:show-supported-register-classes, ↵Matthias Krüger-8/+23
r=SparrowLii,jieyouxu show supported register classes in error message a simple diagnostic change that shows the supported register classes when an invalid one is found. This information can be hard to find (especially for unstable targets), and this message now gives at least something to try or search for. I've followed the pattern for invalid clobber ABIs. `@rustbot` label +A-inline-assembly
2025-02-11Rollup merge of #135677 - yotamofek:resolve-cleanups2, r=compiler-errorsMatthias Krüger-7/+8
Small `rustc_resolve` cleanups 1. Don't open-code `Reverse` 2. Use slice patterns where possible
2025-02-11Rollup merge of #135285 - tbu-:pr_fix_typo4, r=GuillaumeGomezMatthias Krüger-3/+3
it-self → itself, build-system → build system, type-alias → type alias
2025-02-11Change the issue number for `likely_unlikely` and `cold_path`Trevor Gross-3/+3
These currently point to rust-lang/rust#26179, which is nearly a decade old and has a lot of outdated discussion. Move these features to a new tracking issue specifically for the recently added API. New tracking issue: https://github.com/rust-lang/rust/issues/136873
2025-02-11Auto merge of #136571 - marcoieni:ubuntu-24-large-runners, r=Mark-Simulacrumbors-3/+3
ci: use ubuntu 24 for x86 large runners try-job: dist-powerpc64le-linux try-job: x86_64-gnu-debug try-job: dist-arm-linux try-job: x86_64-fuchsia try-job: x86_64-gnu-distcheck try-job: dist-x86_64-linux try-job: dist-x86_64-linux-alt
2025-02-11Auto merge of #136851 - jhpratt:rollup-ftijn95, r=jhprattbors-336/+241
Rollup of 11 pull requests Successful merges: - #136606 (Fix long lines which rustfmt fails to format) - #136663 (Stabilize `NonZero::count_ones`) - #136672 (library: doc: core::alloc::Allocator: trivial typo fix) - #136704 (Improve examples for file locking) - #136721 (cg_llvm: Reduce visibility of some items outside the `llvm` module) - #136813 (rustc_target: Add the fp16 target feature for AArch32) - #136830 (fix i686-unknown-hurd-gnu x87 footnote) - #136832 (Fix platform support table for i686-unknown-uefi) - #136835 (Stop using span hack for contracts feature gating) - #136837 (Overhaul how contracts are lowered on fn-like bodies) - #136839 (fix ensure_monomorphic_enough) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-11Document some safety constraints and use more safe wrappersOli Scherer-59/+50
2025-02-11Add a safe wrapper for `WriteBitcodeToFile`Oli Scherer-8/+10
2025-02-11Remove an unsafe closure invariant by inlining the closure wrapper into the ↵Oli Scherer-80/+50
called function
2025-02-11Handle pattern types wrapped in `Option` in FFI checksOli Scherer-49/+35
2025-02-11Add a TyPat in the AST to reuse the generic arg lowering logicOli Scherer-264/+241
2025-02-11Correctly handle pattern types in FFI redeclaration lintsOli Scherer-88/+64
2025-02-11Correctly handle pattern types in FFI safetyOli Scherer-47/+12
2025-02-11Add ffi tests for pattern typesOli Scherer-22/+185
2025-02-11include note on variance and exampleMarijn Schouten-2/+96
Fixes #89150 Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
2025-02-11Update docs for impl keywordMarijn Schouten-7/+34
2025-02-11Rollup merge of #136839 - lukas-code:actually-monomorphic-enough, ↵Jacob Pratt-41/+37
r=compiler-errors fix ensure_monomorphic_enough When polymorphization was still a thing, the visitor was used to only recurse into *used generic parameters* of function/closure/coroutine types and allow unused parameters (i.e. the polymorphized parameters) to remain generic. When polymorphization got removed, this got changed to always treat all parameters as polymorphic and never recurse into them: https://github.com/rust-lang/rust/pull/133883/files#diff-210c59e321070d0ca4625c04e9fb064bf43ddc34082e7e33a7ee8a6c577e95afL44-L62 This is clearly wrong and can cause MIR opts to misbehave, for example this currently prints "false" in release mode: ```rust #![feature(core_intrinsics)] fn generic<T>() {} const fn type_id_of_val<T: 'static>(_: &T) -> u128 { std::intrinsics::type_id::<T>() } fn cursed_is_i32<T: 'static>() -> bool { (const { type_id_of_val(&generic::<T>) } == const { type_id_of_val(&generic::<i32>) }) } fn main() { dbg!(cursed_is_i32::<i32>()); } ``` This PR reverts to the old behavior of always treating all types that contain type parameters as too generic, like we used to do without `-Zpolymorphize` before. ~~I'm not including the above as a test case here, because I think there is little value in testing code paths that have been removed and this seems unlikely to regress in a way that would be caught by a regression test, but let me know if you disagree and want me to add a test anyway.~~
2025-02-11Rollup merge of #136837 - compiler-errors:contracts-body-lowering, r=celinvalJacob Pratt-113/+124
Overhaul how contracts are lowered on fn-like bodies Consolidates all of the contracts lowering logic into `lower_fn_body`, rather than having it be split between `lower_item_kind` and `lower_fn_body`. This should fix #136683. r? celinval
2025-02-11Rollup merge of #136835 - compiler-errors:contracts-span-hack, r=celinvalJacob Pratt-59/+17
Stop using span hack for contracts feature gating The contracts machinery is a pretty straightforward case of an *external* feature using a (perma-unstable) *internal* feature within its implementation. There's no reason why it needs to be implemented any differently than other features by using global span tracking hacks to change whether the internals are gated behind the `contracts` or `contracts_internals` feature gate -- for the case of macro expansions we already have `allow_internal_unstable` for exactly this situation. This PR changes the internal, perma-unstable AST syntax to use the `contracts_internals` gate always, and adjusts the macro expansion to use the right spans so that `allow_internal_unstable` works correctly. As a follow-up, there's really no reason to have `contracts` be a *compiler feature* since it's at this point fully a *library feature*; the only reason it's a compiler feature today is so we can mark it as incomplete, but that seems like a weak reason. I didn't do anything in this PR for this. r? ``@celinval``
2025-02-11Rollup merge of #136832 - ehuss:fix-platform-table, r=compiler-errorsJacob Pratt-1/+1
Fix platform support table for i686-unknown-uefi This text was placed in the wrong column.
2025-02-11Rollup merge of #136830 - RalfJung:hurd-x87-footnote, r=NoratriebJacob Pratt-1/+1
fix i686-unknown-hurd-gnu x87 footnote I missed this in https://github.com/rust-lang/rust/pull/136700. r? ``@Noratrieb``