about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-09-15Add documentation for select_where_possible and select_all_or_errortiif-1/+16
2025-09-15Add check to make sure ConstParamTy impls of certain types are gated with ↵tiif-15/+23
#[unstable_feature_bound(unsized_const_params)]
2025-09-15Remove UnsizedConstParamTy trait and make it into an unstable impltiif-65/+4
2025-09-15rustc_codegen_llvm: Adjust RISC-V inline assembly's clobber listTsukasa OI-0/+1
Despite that the `fflags` register (representing floating point exception flags) is stated as a flag register in the reference, it's not in the default clobber list of the RISC-V inline assembly and it would be better to fix it.
2025-09-14Fix typo in error messageJules Bertholet-1/+1
2025-09-14Elaborate comment.Camille Gillot-2/+6
2025-09-14Comment.Camille Gillot-0/+9
2025-09-14Auto merge of #145881 - fmease:mv-var-to-dyn-buf-lints, r=joshtriplettbors-432/+303
Move more early buffered lints to dyn lint diagnostics Follow-up to rust-lang/rust#145747. Presently, it's unclear to me if it's possible to migrate all variants to dyn lint diagnostics without regressing performance because for some early lints `decorate_builtin_lint` performs a bit more work (past PR rust-lang/rust#124417 has shown that eagerly decorating early lints is incredibly heavy and we had to revert back to lazily decorating in rust-lang/rust#125410). Let's see how this fares once I tackle the more 'risky' variants. cc `@joshtriplett` (you can immediately unsubscribe again, I just want to prevent duplicate efforts).
2025-09-14Move more early buffered lints to dyn lint diagnostics (4/N)León Orell Valerian Liehr-98/+66
2025-09-14Move more early buffered lints to dyn lint diagnostics (3/N)León Orell Valerian Liehr-55/+39
2025-09-14Remove a dead early lintLeón Orell Valerian Liehr-18/+0
Dropped in favor a hard error in RUST-127907.
2025-09-14Move more early buffered lints to dyn lint diagnostics (2/N)León Orell Valerian Liehr-71/+50
2025-09-14Move more early buffered lints to dyn lint diagnostics (1/N)León Orell Valerian Liehr-190/+148
2025-09-14Drop armebv7r-none-eabi* to Tier 3Jonathan 'theJPster' Pallant-2/+2
These targets are not widely used, and are difficult to test because qemu-system-arm cannot emulate them.
2025-09-13merge crate-level into ALLOWED_TARGETSJana Dönszelmann-62/+23
2025-09-13initial implementation of the darwin_objc unstable featureJo Bates-11/+482
2025-09-13Auto merge of #146526 - jhpratt:rollup-afb1dgo, r=jhprattbors-14/+24
Rollup of 8 pull requests Successful merges: - rust-lang/rust#113095 (Document `become` keyword) - rust-lang/rust#146159 (Some hygiene doc improvements) - rust-lang/rust#146171 (tidy: check that error messages don't start with a capitalized letter) - rust-lang/rust#146419 (Update the arm-* and aarch64-* platform docs.) - rust-lang/rust#146473 (Revert "Constify SystemTime methods") - rust-lang/rust#146506 (Fix small typo in check-cfg.md) - rust-lang/rust#146517 (fix Condvar::wait_timeout docs) - rust-lang/rust#146521 (document `core::ffi::VaArgSafe`) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-13Rollup merge of #146171 - scrabsha:push-wovnxxwltsun, r=WaffleLapkinJacob Pratt-2/+2
tidy: check that error messages don't start with a capitalized letter
2025-09-13Rollup merge of #146159 - camsteffen:hygiene-docs, r=petrochenkovJacob Pratt-12/+22
Some hygiene doc improvements Improve some doc comments around SyntaxContext, outer_expn and friends. Based on discussion at https://github.com/rust-lang/rust/pull/146100. r? petrochenkov
2025-09-13Auto merge of #146491 - ↵bors-8/+3
jdonszelmann:update-fixme-compare_method_predicate_entailment, r=lcnr update fixme in compare_method_predicate_entailment resulting from review of EII r? `@lcnr` Just the comment update separately from https://github.com/rust-lang/rust/pull/146348/files since it doesn't really belong in that PR. Should be trivial
2025-09-13Improve the documentation around ZERO_AR_DATEMads Marquart-3/+13
2025-09-13Mark reads in statements to avoid overlapping assingments.Camille Gillot-10/+19
2025-09-13Stop counting opaques.Camille Gillot-25/+24
2025-09-13Do not hash opaques in GVN.Camille Gillot-39/+90
2025-09-13Introduce ValueSet.Camille Gillot-21/+97
2025-09-13update fixme in compare_method_predicate_entailment resulting from review of EIIJana Dönszelmann-8/+3
2025-09-13Auto merge of #145186 - camsteffen:assoc-impl-kind, r=petrochenkovbors-298/+289
Make `AssocItem` aware of its impl kind The general goal is to have fewer query dependencies by making `AssocItem` aware of its parent impl kind (inherent vs. trait) without having to query the parent def_kind. See individual commits.
2025-09-13Rollup merge of #146456 - IoaNNUwU:issue-146446, r=estebankJacob Pratt-4/+10
Fix panic and incorrectly suggested examples in `format_args` macro. Follow up on rust-lang/rust#146123 Fixes: rust-lang/rust#146446 r? `@estebank`
2025-09-13Rollup merge of #144498 - Noratrieb:rustc-json-schema, r=jieyouxu,davidtwcoJacob Pratt-724/+357
Add --print target-spec-json-schema This schema is helpful for people writing custom target spec JSON. It can provide autocomplete in the editor, and also serves as documentation when there are documentation comments on the structs, as `schemars` will put them in the schema. I was motivated to do this because I saw someone write their own version of this schema by hand, so demand for this clearly exists. It's not a lot of effort to implement, so I thought it would make sense. MCP: https://github.com/rust-lang/compiler-team/issues/905 I think it would also be useful to put this in the sysroot in `etc` so people can link it directly in their editors. I would have loved to add a test that validates the JSON schema against the spec JSON of every builtin target, but I don't want to do it as the JSON schema validation crates have incredible amounts of dependencies because JSON schema supports a ton of random features. I don't want to add that, even as a dev dependency.
2025-09-13Rollup merge of #146403 - cyrgani:array-sugg-sorting, r=fee1-deadJana Dönszelmann-3/+15
sort array trait implementation suggestions correctly Fixes rust-lang/rust#135098. Previously tried in rust-lang/rust#137428.
2025-09-13Rollup merge of #146389 - jdonszelmann:no-std, r=oli-obkJana Dönszelmann-3/+39
Convert `no_std` and `no_core` to the new attribute infrastructure r? ```@oli-obk``` Also added a test for these, since we didn't have any and I was kind of surprised new diagnostics didn't break anything hehe
2025-09-12Don't store defaultness for inherent impl itemsCameron Steffen-6/+9
2025-09-12Split AssocContainer::{InherentImpl,TraitImpl}Cameron Steffen-174/+139
2025-09-12Introduce hir::ImplItemImplKindCameron Steffen-70/+98
2025-09-12Rename AssocItemContainer -> AssocContainerCameron Steffen-64/+62
2025-09-12Introduce trait_item_ofCameron Steffen-28/+25
2025-09-12Add --print target-spec-json-schemaNoratrieb-9/+113
This schema is helpful for people writing custom target spec JSON. It can provide autocomplete in the editor, and also serves as documentation when there are documentation comments on the structs, as `schemars` will put them in the schema.
2025-09-12Introduce `target_spec_enum` macro to avoid duplicationNoratrieb-715/+244
With this macro we only need to enumerate every variant once. This saves a lot of duplication already between the definition, the `FromStr` impl and the `ToJson` impl. It also enables us to do further things with it like JSON schema generation.
2025-09-12Remove unreachable unsized arg handling in `store_fn_arg/store_arg` in codegenZachary S-15/+5
2025-09-12Auto merge of #146329 - lcnr:opaque-type-infer-alias-candidates, r=BoxyUwUbors-38/+207
consider item bounds for non-yet-defined opaque types Based on rust-lang/rust#140405. fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/182 fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/196 fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/205 there's some jank here, see https://github.com/rust-lang/trait-system-refactor-initiative/issues/229 ## Design If the self type is an inference variable which has been sub-unified with am opaque type, we need to incompletely guide inference to avoid breakage. In this case, we - look at the item bounds of all sub-unified opaque types, and - blanket impls which do not constrain the self type Even if there are applicable candidates, we always force their certainty to be `Maybe`, so they will always have to be reproven once we've constrained the inference variable. This is a bit iffy, see the added tests. r? `@BoxyUwU`
2025-09-12sort array trait implementation suggestions correctlycyrgani-3/+15
2025-09-12Rollup merge of #146308 - cyrgani:concat-integer-literals, r=jackh726Stuart Cook-1/+17
support integer literals in `${concat()}` Tracking issue: rust-lang/rust#124225 Adds support for using integer literals as arguments to `${concat()}` macro expressions. Integer formatting such as `1_000` is preserved by this.
2025-09-12Rollup merge of #144549 - folkertdev:va-arg-arm, r=saethlinStuart Cook-1/+20
match clang's `va_arg` assembly on arm targets tracking issue: https://github.com/rust-lang/rust/issues/44930 For this example ```rust #![feature(c_variadic)] #[unsafe(no_mangle)] unsafe extern "C" fn variadic(a: f64, mut args: ...) -> f64 { let b = args.arg::<f64>(); let c = args.arg::<f64>(); a + b + c } ``` We currently generate (via llvm): ```asm variadic: sub sp, sp, #12 stmib sp, {r2, r3} vmov d0, r0, r1 add r0, sp, #4 vldr d1, [sp, #4] add r0, r0, #15 bic r0, r0, #7 vadd.f64 d0, d0, d1 add r1, r0, #8 str r1, [sp] vldr d1, [r0] vadd.f64 d0, d0, d1 vmov r0, r1, d0 add sp, sp, #12 bx lr ``` LLVM is not doing a good job. In fact, it's well-known that LLVM's implementation of `va_arg` is kind of bad, and we implement it ourselves (based on clang) for many targets already. For arm, our own `emit_ptr_va_arg` saves 3 instructions. Next, it turns out it's important for LLVM to explicitly start and end the lifetime of the `va_list`. In https://github.com/rust-lang/rust/pull/146059 I already end the lifetime, but when looking at this again, I noticed that it is important to also start it, see https://godbolt.org/z/EGqvKTTsK: failing to explicitly start the lifetime uses an extra register. So, the combination of `emit_ptr_va_arg` with starting/ending the lifetime makes rustc emit exactly the instructions that clang generates:: ```asm variadic: sub sp, sp, #12 stmib sp, {r2, r3} vmov d16, r0, r1 vldr d17, [sp, #4] vadd.f64 d16, d16, d17 vldr d17, [sp, #12] vadd.f64 d16, d16, d17 vmov r0, r1, d16 add sp, sp, #12 bx lr ``` The arguments to `emit_ptr_va_arg` are based on [the clang implementation](https://github.com/llvm/llvm-project/blob/03dc2a41f3d9a500e47b513de5c5008c06860d65/clang/lib/CodeGen/Targets/ARM.cpp#L798-L844). r? ``@workingjubilee`` (I can re-roll if your queue is too full, but you do seem like the right person here) try-job: armhf-gnu
2025-09-12remove outdated jsbackend leftoversklensy-7/+0
2025-09-12Auto merge of #146328 - zetanumbers:fix-141951, r=lcnrbors-5/+40
Skip typeck for items w/o their own typeck context Skip items which forward typeck to their ancestor. Should remove some potential but unnecessary typeck query waits, hence might improve performance for the parallel frontend. Thanks to `@ywxt` for a fix suggestion Fixes rust-lang/rust#141951
2025-09-11Skip cleanups on unsupported targetsAlex Crichton-8/+30
This commit is an update to the `AbortUnwindingCalls` MIR pass in the compiler. Specifically a new boolean is added for "can this target possibly unwind" and if that's `false` then terminators are all adjusted to be unreachable/not present. The end result is that this fixes 140293 for wasm targets. The motivation for this PR is that currently on WebAssembly targets the usage of the `C-unwind` ABI can lead LLVM to either (a) emit exception-handling instructions or (b) hit a LLVM-ICE-style codegen error. WebAssembly as a base instruction set does not support unwinding at all, and a later proposal to WebAssembly, the exception-handling proposal, was what enabled this. This means that the current intent of WebAssembly targets is that they maintain the baseline of "don't emit exception-handling instructions unless enabled". The commit here is intended to restore this behavior by skipping these instructions even when `C-unwind` is present. Exception-handling is a relatively tricky and also murky topic in WebAssembly, however. There are two sets of instructions LLVM can emit for WebAssembly exceptions, Rust's Emscripten target supports exceptions, WASI targets do not, the LLVM flags to enable this are not always obvious, and additionally this all touches on "changing exception-handling behavior should be a target-level concern, not a feature". Effectively WebAssembly's exception-handling integration into Rust is not finalized at this time. The best idea at this time is that a parallel set of targets will eventually be added which support exceptions, but it's not clear if/when to do this. In the meantime the goal is to keep existing targets working while still enabling experimentation with exception-handling with `-Zbuild-std` and various permutations of LLVM flags. To that extent this commit does not blanket disable these landing pads and cleanup routines for WebAssembly but instead checks to see if panic=unwind is enabled or if `+exception-handling` is enabled. Tests are updated here as well to account for this where, by default, using a `C-unwind` ABI won't affect Rust codegen at all. If `+exception-handling` is enabled, however, then Rust codegen will look like native platforms where exceptions are caught and the program aborts. More-or-less I've done my best to keep exceptions working on wasm where it's possible to have them work, but turned them off where they're not supposed to be emitted.
2025-09-12Use raw fmt str in format macroIoaNNUwU-4/+10
2025-09-11remove unused getLongestEntryLengthklensy-8/+0
2025-09-11remove unused macroklensy-116/+0
2025-09-11incompletely prefer opaque type bounds when self type bottoms out in inferMichael Goulet-14/+174