about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-09-17Rollup merge of #146564 - cjgillot:mir-nolen, r=scottmcmStuart Cook-183/+56
Remove Rvalue::Len again. Now that we have `RawPtrKind::FakeForPtrMetadata`, we can reimplement `Rvalue::Len` using `PtrMetadata(&raw const (fake) place)`. r? ``@scottmcm``
2025-09-17Rollup merge of #146552 - cjgillot:resume-noremap, r=jackh726Stuart Cook-29/+22
StateTransform: Do not renumber resume local. MIR parameters are not explicitly assigned-to when entering the MIR body. If we want to save their values inside the coroutine state, we need to do so explicitly. This was done by renaming the `_2` local, and introducing an explicit assignment pre-transform. This particular trick confuses me. This version makes explicit that we are assigning parameters to saved locals. r? ``@dingxiangfei2009``
2025-09-17Rollup merge of #146259 - camsteffen:remove-the-box, r=jackh726Stuart Cook-0/+22
Suggest removing Box::new instead of unboxing it
2025-09-17Rollup merge of #145838 - dianne:non-extending-super-let, r=jackh726,traviscrossStuart Cook-5/+19
don't apply temporary lifetime extension rules to non-extended `super let` Reference PR: rust-lang/reference#1980 This changes the semantics for `super let` (and macros implemented in terms of it, such as `pin!`, `format_args!`, `write!`, and `println!`) as suggested by ````@theemathas```` in https://github.com/rust-lang/rust/issues/145784#issuecomment-3218658335, making `super let` initializers only count as [extending expressions](https://doc.rust-lang.org/nightly/reference/destructors.html#extending-based-on-expressions) when the `super let` itself is within an extending block. Since `super let` initializers aren't temporary drop scopes, their temporaries outside of inner temporary scopes are effectively always extended, even when not in extending positions; this only affects two cases as far as I can tell: - Block tail expressions in Rust 2024. This PR makes `f(pin!({ &temp() }))` drop `temp()` at the end of the block in Rust 2024, whereas previously it would live until after the call to `f` because syntactically the `temp()` was in an extending position as a result of `super let` in `pin!`'s expansion. - `super let` nested within a non-extended `super let` is no longer extended. i.e. a normal `let` is required to treat `super let`s as extending (in which case nested `super let`s will also be extending). Closes rust-lang/rust#145784 This is a breaking change. Both static and dynamic semantics are affected. The most likely breakage is for programs to stop compiling, but it's technically possible for drop order to silently change as well (as in rust-lang/rust#145784). Since this affects stable macros, it probably would need a crater run. Nominating for discussion alongside rust-lang/rust#145784: ````@rustbot```` label +I-lang-nominated +I-libs-api-nominated Tracking issue for `super let`: rust-lang/rust#139076
2025-09-17Rollup merge of #145660 - jbatez:darwin_objc, r=jdonszelmann,madsmtm,tmandryStuart Cook-11/+482
initial implementation of the darwin_objc unstable feature Tracking issue: https://github.com/rust-lang/rust/issues/145496 This feature makes it possible to reference Objective-C classes and selectors using the same ABI used by native Objective-C on Apple/Darwin platforms. Without it, Rust code interacting with Objective-C must resort to loading classes and selectors using costly string-based lookups at runtime. With it, these references can be loaded efficiently at dynamic load time. r? ```@tmandry``` try-job: `*apple*` try-job: `x86_64-gnu-nopt`
2025-09-17Rollup merge of #145181 - Borgerr:remove-fixme-from-has-sigdrop, r=lcnrStuart Cook-8/+1
remove FIXME block from `has_significant_drop`, it never encounters inference variables The `FIXME` block in `Ty::has_significant_drop` is outdated as related queries can now handle type inference. https://github.com/rust-lang/rust/blob/321a89bec57b8ca723d1af8f784490b950458c6a/compiler/rustc_middle/src/ty/util.rs#L1378-L1389 Closes rust-lang/rust#86868 (other places mentioned in the issue have been resolved, or moved to other issues) r? types
2025-09-17Rollup merge of #145071 - cuviper:min-llvm-20, r=nikicStuart Cook-237/+69
Update the minimum external LLVM to 20 With this change, we'll have stable support for LLVM 20 and 21. For reference, the previous increase to LLVM 19 was rust-lang/rust#139275. cc ```@rust-lang/wg-llvm``` r? nikic
2025-09-17Merge modules dyn_compatibility and lint into dyn_traitLeón Orell Valerian Liehr-550/+550
2025-09-17Remove `DynKind`León Orell Valerian Liehr-233/+138
2025-09-17Use `LLVMDIBuilderCreateStructType`Zalathar-42/+29
2025-09-17Use `LLVMDIBuilderCreatePointerType`Zalathar-52/+45
2025-09-17Use `LLVMDIBuilderCreateBasicType`Zalathar-18/+12
2025-09-17Use `LLVMDIBuilderCreateArrayType`Zalathar-25/+15
2025-09-17Use `LLVMDIBuilderCreateUnionType`Zalathar-34/+25
2025-09-17Use `LLVMDIBuilderCreateSubroutineType`Zalathar-19/+23
2025-09-16Do not renumber resume local.Camille Gillot-27/+20
2025-09-16Add test.Camille Gillot-2/+2
2025-09-16Remove Rvalue::Len.Camille Gillot-183/+56
2025-09-16Enable DestinationPropagation by default.Camille GILLOT-246/+2
2025-09-16Auto merge of #146650 - matthiaskrgr:rollup-rjrklz9, r=matthiaskrgrbors-11/+33
Rollup of 5 pull requests Successful merges: - rust-lang/rust#146442 (Display ?Sized, const, and lifetime parameters in trait item suggestions across a crate boundary) - rust-lang/rust#146474 (Improve `core::ascii` coverage) - rust-lang/rust#146605 (Bump rustfix 0.8.1 -> 0.8.7) - rust-lang/rust#146611 (bootstrap: emit hint if a config key is used in the wrong section) - rust-lang/rust#146618 (Do not run ui test if options specific to LLVM are used when another codegen backend is used) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-16Update the FIXME comments in the generic three_way_compareJosh Stone-8/+11
2025-09-16Update the minimum external LLVM to 20Josh Stone-237/+66
2025-09-16Auto merge of #138271 - mu001999-contrib:fix-138234, r=jackh726bors-0/+8
Keep space if arg does not follow punctuation when lint unused parens Fixes rust-lang/rust#138234 If the arg follows punctuation, still pass `left_pos` with `None` and no space will be added, else then pass `left_pos` with `Some(arg.span.lo())`, so that we can add the space as expected. And `emit_unused_delims` can make sure no more space will be added if the expr follows space. --- Edited: Directly use the `value_span` to check whether the expr removed parens will follow identifier or be followed by identifier.
2025-09-16Rollup merge of #146442 - Qelxiros:trait-suggestion-generics, r=BoxyUwUMatthias Krüger-11/+33
Display ?Sized, const, and lifetime parameters in trait item suggestions across a crate boundary context: rust-lang/rust#145929 This fixes the MetaSized issue and adds const generics and early bound lifetimes. Late bound lifetimes are harder because they aren't returned by `generics_of`. I'm going to look into it, but there's no guarantee I'll be successful. Fixes https://github.com/rust-lang/rust/issues/146404. r? `@BoxyUwu`
2025-09-16Detect top-level `...` in argument typeEsteban Küber-2/+22
When writing something like the expression `|_: ...| {}`, we now detect the `...` during parsing explicitly instead of relying on the detection in `parse_ty_common` so that we don't talk about "nested `...` are not supported". ``` error: unexpected `...` --> $DIR/no-closure.rs:6:35 | LL | const F: extern "C" fn(...) = |_: ...| {}; | ^^^ | = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list ```
2025-09-16cmse: fix 'region variables should not be hashed'Folkert de Vries-0/+1
2025-09-16Reword noteEsteban Küber-1/+1
2025-09-16fmtEsteban Küber-2/+3
2025-09-16Add span for struct tail recursion limit errorTawan Muadmuenwai-34/+66
2025-09-16handle const generics, ?Sized, early bound lifetimesJeremy Smart-11/+33
2025-09-16Mark some coverage-related bindings as safeZalathar-10/+14
2025-09-16Stop using `as_c_char_ptr` for coverage-related bindingsZalathar-7/+12
2025-09-16Keep space if expr follows identifier when lint unused parensMu001999-0/+8
2025-09-16Auto merge of #146516 - cjgillot:dest-prop-aggregate, r=Amanieubors-12/+31
DestinationPropagation: avoid creating overlapping assignments. r? `@Amanieu` Fixes https://github.com/rust-lang/rust/issues/146383
2025-09-16fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadicFolkert de Vries-0/+6
2025-09-16Suggest removing Box::newCameron Steffen-0/+22
2025-09-16Auto merge of #146614 - Zalathar:rollup-hcxvdi1, r=Zalatharbors-1242/+1450
Rollup of 9 pull requests Successful merges: - rust-lang/rust#145095 (Migrate `UnsizedConstParamTy` to unstable impl of `ConstParamTy_`) - rust-lang/rust#145960 (Split `FnCtxt::report_args_error` into subfunctions) - rust-lang/rust#146402 (interpret: fix overlapping aggregate initialization) - rust-lang/rust#146466 (llvm-wrapper: other cleanup) - rust-lang/rust#146574 (compiletest: Enable new-output-capture by default) - rust-lang/rust#146599 (replace some `#[const_trait]` with `const trait`) - rust-lang/rust#146601 (compiletest: Make `./x test --test-args ...` work again) - rust-lang/rust#146608 (improve internal bootstrap docs) - rust-lang/rust#146609 (bootstrap: lower verbosity of cargo to one less than bootstrap's) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-15Don’t suggest foreign `doc(hidden)` types in E0277 diagnosticsJules Bertholet-1/+16
2025-09-16Restrict simple assignment condition.Camille Gillot-2/+8
2025-09-16Rollup merge of #146466 - klensy:llvm-wrapper-c, r=cuviperStuart Cook-131/+0
llvm-wrapper: other cleanup Cleanup few things around llvm-wrapper: First commit removes unused macro, added back in https://github.com/rust-lang/rust/pull/31709 it was used in `LLVMRustHasFeature`; second removes unused function, third one removes `jsbackend` llvm component - this is looks like remnants of some removed backend?
2025-09-16Rollup merge of #146402 - RalfJung:aggregate-init, r=saethlinStuart Cook-8/+29
interpret: fix overlapping aggregate initialization This fixes the problem pointed out by ````@saethlin```` in https://github.com/rust-lang/rust/issues/146383#issuecomment-3273224645. Also clarify when exactly current de-facto MIR semantics allow overlap of the LHS and RHS in an assignment.
2025-09-16Rollup merge of #145960 - scrabsha:push-kskuprrtmnky, r=jdonszelmannStuart Cook-1022/+1378
Split `FnCtxt::report_args_error` into subfunctions
2025-09-16Rollup merge of #145095 - tiif:unstable_const_param, r=BoxyUwUStuart Cook-81/+43
Migrate `UnsizedConstParamTy` to unstable impl of `ConstParamTy_` Now that we have ``#[unstable_feature_bound]``, we can remove ``UnsizedConstParamTy`` that was meant to be an unstable impl of stable type and ``ConstParamTy_`` trait. r? `@BoxyUwU`
2025-09-15Rollup merge of #146559 - Jules-Bertholet:fix-typo, r=nnethercoteMatthias Krüger-1/+1
Fix typo in error message
2025-09-15remove FIXME from `has_significant_drop`, replaced with checking ↵ash-8/+1
non_region_infer
2025-09-15Introduce CoerceShared lang item and traitAapo Alasuutari-0/+2
2025-09-15Make llvm_enzyme a regular cargo featurebjorn3-8/+20
This makes it clearer that it is set by the build system rather than by the rustc that compiles the current rustc. It also avoids bootstrap needing to pass --check-cfg llvm_enzyme to rustc.
2025-09-15Split `FnCtxt::report_args_error` into subfunctionsSasha Pourcelot-1022/+1378
2025-09-15Silence inference error on `PatKind::Err`Esteban Küber-2/+8
2025-09-15Detect attempt to use var-args in closureEsteban Küber-9/+23
``` error: unexpected `...` --> $DIR/varargs-in-closure-isnt-supported.rs:5:20 | LL | let mut lol = |...| (); | ^^^ not a valid pattern | = note: C-variadic type `...` is not allowed here ```